Skip to content
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

Start an agent on custom network gcp #12

Closed
mayacdoit opened this issue Dec 6, 2017 · 7 comments
Closed

Start an agent on custom network gcp #12

mayacdoit opened this issue Dec 6, 2017 · 7 comments
Labels

Comments

@mayacdoit
Copy link

mayacdoit commented Dec 6, 2017

Hi,
The agent is able to start on gcp default network, but when change the google cloud "Network" to our own internal subnet, in this case called "staging" the agent fails and not even get created on google cloud console.
Here is the error on teamcity:
Error:

com.google.cloud.compute.ComputeException: Invalid value for field 'resource.networkInterfaces[0]': ''. Subnetwork should be specified for custom subnetmode networkcom.google.cloud.compute.ComputeException: Invalid value for field 'resource.networkInterfaces[0]': ''. Subnetwork should be specified for custom subnetmode network
at com.google.cloud.compute.spi.v1.HttpComputeRpc.translate(HttpComputeRpc.java:96)
at com.google.cloud.compute.spi.v1.HttpComputeRpc.createInstance(HttpComputeRpc.java:889)
at com.google.cloud.compute.ComputeImpl$61.call(ComputeImpl.java:1664)
at com.google.cloud.compute.ComputeImpl$61.call(ComputeImpl.java:1661)
at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:91)
at com.google.cloud.RetryHelper.run(RetryHelper.java:74)
at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:51)
at com.google.cloud.compute.ComputeImpl.create(ComputeImpl.java:1661)
at jetbrains.buildServer.clouds.google.connector.GoogleApiConnectorImpl$createVmAsync$1.doResume(GoogleApiConnectorImpl.kt:104)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:54)
at kotlinx.coroutines.experimental.DispatchTask.run(CoroutineDispatcher.kt:123)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid value for field 'resource.networkInterfaces[0]': ''. Subnetwork should be specified for custom subnetmode network",
"reason" : "invalid"
} ],
"message" : "Invalid value for field 'resource.networkInterfaces[0]': ''. Subnetwork should be specified for custom subnetmode network"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.cloud.compute.spi.v1.HttpComputeRpc.createInstance(HttpComputeRpc.java:887)
... 14 more
@dtretyakov dtretyakov added the bug label Dec 6, 2017
@dtretyakov
Copy link
Contributor

@mayacdoit, thanks for reporting. We need to introduce selector for sub network.

dtretyakov added a commit that referenced this issue Dec 9, 2017
@dtretyakov
Copy link
Contributor

@mayacdoit, could you please download the latest snapshot plugin build to verify, that your case was resolved?

@mayacdoit
Copy link
Author

Thanks for the quick respond.
I upload the new plugin. But on subnetworks it only let me choose 1 subnetwork although there are 3 subnetworks available. Unfortunately, I needed the one that wasn't showing up.

Thanks,

@dtretyakov
Copy link
Contributor

@mayacdoit, could you please ensure that the required subnet is located in the region which was selected for that image? Available subnets in the lists should be from that region.
image
image

dtretyakov added a commit that referenced this issue Dec 10, 2017
@dtretyakov
Copy link
Contributor

@mayacdoit, I have fixed possible cause of this issue, so please update the plugin to the latest snapshot build before check.

@mayacdoit
Copy link
Author

Now it works better. Good work
But there is another issue. We need to work with gsutil. From the main image there is no issue to run gsutil. From the agents started with teamcity I get: "ServiceException: 401 Anonymous users does not have storage.objects.list access to bucket mybucket"
When launching an image manually gsutil works fine. Digging a bit on the internet didn't help finding a solution.

@dtretyakov
Copy link
Contributor

@mayacdoit, thanks for letting me know that use case with subnet selection works fine.

I've created a separate issue for the problem with gsutil: #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants