Comments (21)
@stephenashank yep! Thanks for your efforts and sorry for being late with the response.
from google-compute-engine-plugin.
How did you set up the network in the first place?
from google-compute-engine-plugin.
Update?
from google-compute-engine-plugin.
That's a pretty vague question. How did I set up the network in Google? How did I set up network in the Jenkins plugin config? What information are you looking for?
from google-compute-engine-plugin.
Are you setting it up via the UI in the instance configuration form? Using JCasC?
With the UI, there are auto-populated options that should work out of the box.
from google-compute-engine-plugin.
Also, it would also help for me to see what your instance configuration is.
from google-compute-engine-plugin.
I set set up the network in the Jenkins UI. It does have a drop down for subnetworks but the only that appears is 'default'. There aren't any other options.
The instance is Centos7 n1-standard-4. The service account has 'Compute Network Admin'.
from google-compute-engine-plugin.
If you see there, it seems what is in your config matches values we use for integration testing.
@stephenashank can you take a look?
from google-compute-engine-plugin.
In our production project we do not have a subnet called 'default'. Is that a requirement?
In our staging project we have a subnet called 'default'. When I tried to bring in a new slave, I would get this error:
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"
}
from google-compute-engine-plugin.
I was able to reproduce your problem in the UI: even when I had created a new subnetwork under the default network, it was not showing up in the list despite the service account having the Compute Network Admin role.
So I looked closer and realized that as it stands now, selecting the default subnetwork is required when default is chosen as the network, because no additional items are retrieved, we just assume that default will be used:
from google-compute-engine-plugin.
Weird, how did you reproduce that? It works fine for me in the UI.
from google-compute-engine-plugin.
I was only able to see subnetworks that were not default when I removed the block above.
To reproduce I did this: in cloud console, select VPC network then VPC networks and click on the default network. Then click Add subnet to create a custom subnet. Make sure to add it to the region that you are using for configuration, and choose any IP range that is allowed.
Then, I reopened the Jenkins configuration which already had the default network selected, and clicked on the dropdown. I expected to see both of the subnets for the network and region (default and the one I created) but only saw default.
from google-compute-engine-plugin.
Should be fixed as soon as we issue the next release.
from google-compute-engine-plugin.
Cut a release! Let me know how it goes @jhartnett. It is release 3.3.0.
from google-compute-engine-plugin.
I do have a concern about the current implementation because after updating to the latest v3.3.0 I receive the following response from the plugin while trying to start a slave:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid value for field 'resource.networkInterfaces[0].subnetwork': 'No subnetworks exist in the given network and region.'. The URL is malformed.",
"reason" : "invalid"
} ],
"message" : "Invalid value for field 'resource.networkInterfaces[0].subnetwork': 'No subnetworks exist in the given network and region.'. The URL is malformed."
}
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:1067)
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.jenkins.plugins.computeengine.client.ComputeClient.insertInstance(ComputeClient.java:359)
at com.google.jenkins.plugins.computeengine.InstanceConfiguration.provision(InstanceConfiguration.java:284)
at com.google.jenkins.plugins.computeengine.ComputeEngineCloud.doProvision(ComputeEngineCloud.java:411)
In my project, I still have a Legacy VPC network
and thus there are no dedicated sub-networks in it. I have downgraded the plugin version to v3.2.0 to be able to start slaves again.
from google-compute-engine-plugin.
@stephenashank it looks like the previous PR which was submitted for this issue is now interfering with customers using legacy VPCs. Could you PTAL. Thanks.
from google-compute-engine-plugin.
I was able to track down the issue:
Previously when using a legacy VPC, I'm guessing the default subnetwork would be used in the NetworkConfiguration for the instance, and then in the block above when constructing the network interface, the subnetwork would be omitted. I should be able to fix this by allowing users to select an empty value for subnetwork, and then omitting it from the network interface in that case as well. Does that work for your use case @yuri-sergiichuk?
from google-compute-engine-plugin.
In my case, with the plugin v3.2.0, the subnetwork is automatically set to default
. Is it what you're asking?
from google-compute-engine-plugin.
Yes that answered my question. The behavior should be restored for legacy VPCs with release 3.3.2 which was just deployed. It can take up to 8 hours to reach the update center, so please check that out when you can.
from google-compute-engine-plugin.
@yuri-sergiichuk Was your issue resolved?
from google-compute-engine-plugin.
No worries. In that case I will close this out.
from google-compute-engine-plugin.
Related Issues (20)
- Feature request: try different zones if the one specified in config does not have enough resources HOT 4
- Feature request: Option to delay agent connection to allow custom startup script to finish HOT 3
- Option the set MAXIMUM triggered builds for an agent
- Enable billing measure of GCP Jenkins workers HOT 2
- The hpi download link is broken HOT 2
- Add new spot for provision type HOT 2
- New Node with "Google Compute Engine" failed HOT 1
- Add an ability to provide image family name instead of image name HOT 1
- Create snapshot defaulting to multi-region
- Expose Prefix Start Agent Command and Suffix Start Agent Command
- Jobs on preempted VMs hang indefinitely until manually cancelled HOT 2
- Option to limit run time of VM HOT 1
- Large number of offline build executors when there is no capacity
- Add option for enabling nested virtualization
- External IP Address can't be configured HOT 10
- Attaching a start up script to an instance template
- Nullsafe operator required
- Change mahine type from configuration not working
- Long wait times to provision a VM in GCP HOT 4
- Jenkins losing connection to GCE VM / GCE VM shutting down HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-compute-engine-plugin.