Skip to content

chore: adding code for bulk instances insert in cloud-client #6131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

SriharshaM
Copy link

@SriharshaM SriharshaM commented Oct 5, 2021

Fixes #issue

Adding code for Bulk Instances Create

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • Appropriate changes to README are included in PR
  • API's need to be enabled to test (tell us)
  • Environment Variables need to be set (ask us to set them)
  • Tests pass: mvn clean verify required
  • Lint passes: mvn -P lint checkstyle:check required
  • Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only
  • Please merge this PR for me once it is approved.

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Oct 5, 2021
@snippet-bot
Copy link

snippet-bot bot commented Oct 5, 2021

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@google-cla
Copy link

google-cla bot commented Oct 5, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Oct 5, 2021
@SriharshaM
Copy link
Author

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.

What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot I signed it!

@google-cla google-cla bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Oct 5, 2021
@shubha-rajan shubha-rajan added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 8, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 8, 2021
Resolved the issues as suggested
@shubha-rajan shubha-rajan added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 11, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 11, 2021
@shubha-rajan
Copy link
Contributor

shubha-rajan commented Oct 14, 2021

@SriharshaM It looks like you have some failing tests for Java 11. Can you fix them? Please let me know if you need help debugging them.

#
# compute/cloud-client
#

[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 55.193 s <<< FAILURE! - in compute.SnippetsIT
[ERROR] compute.SnippetsIT  Time elapsed: 55.167 s  <<< ERROR!
com.google.api.gax.rpc.InvalidArgumentException: Bad Request
Caused by: com.google.api.client.http.HttpResponseException:
400 Bad Request
POST https://compute.googleapis.com:443/compute/v1/projects/java-docs-samples-testing/zones/us-central1-a/instances/bulkInsert?requestId=requestId
{
  "error": {
    "code": 400,
    "message": "Invalid value for field 'resource.sourceInstanceTemplate': 'instanceTemplate'. The URL is malformed.",
    "errors": [
      {
        "message": "Invalid value for field 'resource.sourceInstanceTemplate': 'instanceTemplate'. The URL is malformed.",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}


[ERROR] compute.SnippetsIT  Time elapsed: 55.17 s  <<< ERROR!
com.google.api.gax.rpc.NotFoundException: Not Found
Caused by: com.google.api.client.http.HttpResponseException:
404 Not Found
DELETE https://compute.googleapis.com:443/compute/v1/projects/java-docs-samples-testing/global/firewalls/firewall-rule-d406ef04-877d-4467-939c-e0eaa0200097
{
  "error": {
    "code": 404,
    "message": "The resource 'projects/java-docs-samples-testing/global/firewalls/firewall-rule-d406ef04-877d-4467-939c-e0eaa0200097' was not found",
    "errors": [
      {
        "message": "The resource 'projects/java-docs-samples-testing/global/firewalls/firewall-rule-d406ef04-877d-4467-939c-e0eaa0200097' was not found",
        "domain": "global",
        "reason": "notFound"
      }
    ]
  }
}


[ERROR] Errors:
[ERROR] compute.SnippetsIT.null
[ERROR]   Run 1: SnippetsIT » InvalidArgument Bad Request
[ERROR]   Run 2: SnippetsIT » NotFound Not Found
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5:verify (default) on project gce-diregapic-samples: There are test failures.
[ERROR]
[ERROR] Please refer to /tmpfs/src/github/java-docs-samples/compute/cloud-client/target/failsafe-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

 Testing failed: Maven returned a non-zero exit code.



err: exit status 1

@SriharshaM
Copy link
Author

SriharshaM commented Oct 21, 2021

@shubha-rajan I am not able to replicate the bulk instances error although that seems to have to do with my code. I am not sure of the firewall one as that seems to have been some hard coding which does not seem to be from my code. Can you please clarify on this. TIA!

@Sita04 Sita04 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 25, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 25, 2021
@Sita04
Copy link
Contributor

Sita04 commented Oct 27, 2021

@SriharshaM

Going through the build logs, I saw that the API you are trying to hit has a malformed URL.
"Invalid value for field 'resource.sourceInstanceTemplate': 'instanceTemplate'. The URL is malformed."
Please double-check to see what needs to be changed in the format.

The firewall exception occurs during the cleanup() phase.
Since the setup() failed (at create bulk instance) before creating a firewall rule, when the cleanup tries to delete the firewall, it threw a 404 Not found exception. Thanks for the catch! This has been modified now in the patch: #6308

Let @shubha-rajan or I know if we could help!

@eaball35 eaball35 added the needs work This is a pull request that needs a little love. label Feb 22, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-wontfix label Apr 16, 2022
@averikitsch
Copy link
Contributor

@SriharshaM @Sita04 @shubha-rajan PTAL or close

@stale stale bot removed the stale-wontfix label Jun 27, 2022
@averikitsch averikitsch added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 27, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 27, 2022
@SriharshaM
Copy link
Author

SriharshaM commented Jun 28, 2022 via email

@Sita04 Sita04 closed this Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. needs work This is a pull request that needs a little love. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants