You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Jonathan Miller <jo...@appsbroker.com> on 2015/07/20 18:03:20 UTC

GCE problem 'error: group'

Hi Chaps,

I want to try the Jenkins jcloud plugin on Google Compute Engine, but
I keep stumbling on issues that I can't resolve.

I thought I would try to run a simple example script to get jclouds
working from the command line, prior to tackling the Jenkins issues,
so I tried these examples:

https://github.com/jclouds/jclouds-examples/tree/master/compute-basics

java -jar target/compute-basics-jar-with-dependencies.jar \
     google-compute-engine \
     [my-project-service-account-email]@developer.gserviceaccount.com \
     [/path/to/json-key.json] \
     jaamtest add

which gives

>> adding node to group jaamtest
-  >> searching params({locationId=us-central1-a, osFamily=debian,
osVersion=7\..*})
-  <<   matched
image(https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20150710)
hardware(https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/machineTypes/f1-micro)
location(us-central1-a)
-  >> running 1 node group(jaamtest) location(us-central1-a)
image(https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20150710)
hardwareProfile(https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/machineTypes/f1-micro)
options({scriptPresent=true})
-  >> creating default keypair...
error: group


this results in the creation of a Network called jclouds-jaamtest  in
my GCE account, but nothing more.

It seems odd to me that I am not providing any configuration of the
node that I would like to add.

I hope I am missing something very simple, and I would appreciate any advice.

Cheers, and thanks in anticipation



-- 
Jonathan Miller

-- 


Follow us on:   <https://plus.google.com/+Appsbroker/>  
<https://twitter.com/appsbroker>  
<http://www.linkedin.com/company/appsbroker-consulting-limited/careers?trk=top_nav_careers>


Appsbroker Consulting Limited, Registered office: Appsbroker House, The 
Square, Swindon,
SN1 3EB, Company Number: 5702796, VAT Number: GB 876 3533 92, Company 
registered in England and Wales.
________________________________________
PLEASE NOTE AS RECIPIENT OF THIS EMAIL: Any views or opinions presented are 
solely those of the author and do not represent those of Appsbroker 
Consulting Limited. This e-mail is confidential and intended solely for the 
addressee. If you are not the intended recipient, be advised that you have 
received this mail in error and that any use, dissemination, forwarding, 
printing or copying of this e-mail is strictly prohibited. Furthermore, if 
you are not the intended recipient, please email it back to the sender and 
then immediately permanently delete it.

Re: GCE problem 'error: group'

Posted by Andrew Phillips <an...@apache.org>.
> I really appreciate it.

Hey, we're not done yet (or is it all working now?) ;-) But glad to hear 
this is helping...

Regards

ap

Re: GCE problem 'error: group'

Posted by Andrew Phillips <an...@apache.org>.
Hi Jonathan

Glad we're getting a few steps further!

> Also, I am unclear where I would set the machine type,
> zone etc. in this example (if the example would allow
> that) - any advice would be gratefully received.

jclouds uses the concept of a "template" that describes your 
requirements for the type of machine to boot. It'll then try to find an 
available image type to match those requirements.

The compute-basics example uses a very simple, hard-coded template:

https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java#L146-L158

You can change the code in here to create a different, more specific 
template. See the TemplateBuilder Javadoc [1] for details.

I'm afraid I can help that much with the credential error, except to 
point out that the way jclouds tries to access the target machines in 
the example is configured here:

https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java#L158

You may need to build your own AdminAccess object with different 
settings. See the AdminAccess.Builder [2] Javadoc for details.

Regards

ap

[1] 
https://jclouds.apache.org/reference/javadoc/1.9.x/org/jclouds/compute/domain/TemplateBuilder.html
[2] 
https://jclouds.apache.org/reference/javadoc/1.9.x/org/jclouds/scriptbuilder/statements/login/AdminAccess.Builder.html

Re: GCE problem 'error: group'

Posted by Jonathan Miller <jo...@appsbroker.com>.
Thanks, Andrew, that is much better - I get an instance created now.
The error (below) is now down to ssh AFAICS.

I have a keychain set up, and unlocked on the machine that this is running from.
After the instance is created ( and the error below) I can log in
without entering a password

jaamiller@ci-master$ ssh NEW-INSTANCE-IP
jaamiller@jaam-test-e6d:~$

but jclouds cannot log in because it doesn't have access to my
keychain. Is it just a matter of using a password-less key?

Also, I am unclear where I would set the machine type, zone etc. in
this example (if the example would allow that) - any advice would be
gratefully received.

Thanks again

Jonathan

-----------------

java -jar target/compute-basics-jar-with-dependencies.jar
google-compute-engine MyID@developer.gserviceaccount.com
~jaamiller/jaam-test-project-79bdf4efdc6d.json jaam-test  add
>> initializing {id=google-compute-engine, name=Google Compute Engine Api, views=[org.jclouds.compute.ComputeServiceContext], endpointName=https endpoint, identityName=client_email which usually looks like project_id@developer.gserviceaccount.com or project_id-extended_uid@developer.gserviceaccount.com, credentialName=Optional.of(PEM encoded P12 private key associated with client_email), documentation=https://developers.google.com/compute/docs, api=interface org.jclouds.googlecomputeengine.GoogleComputeEngineApi}
>> adding node to group jaam-test
-  >> searching params({locationId=us-central1-a, osFamily=debian,
osVersion=7\..*})
-  <<   matched
image(https://www.googleapis.com/compute/v1/projects/gce-nvme/global/images/nvme-backports-debian-7-wheezy-v20150423)
hardware(https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/machineTypes/f1-micro)
location(us-central1-a)
-  >> running 1 node group(jaam-test) location(us-central1-a)
image(https://www.googleapis.com/compute/v1/projects/gce-nvme/global/images/nvme-backports-debian-7-wheezy-v20150423)
hardwareProfile(https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/machineTypes/f1-micro)
options({scriptPresent=true})
-  >> creating default keypair...
-  >> adding node location(us-central1-a) name(jaam-test-e6d)
image(634999531103483430) hardware(1000)
-  << PENDING node(https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/instances/jaam-test-e6d)
-  >> blocking on sockets [104.197.32.104:22, 10.240.28.120:22] for
600000 MILLISECONDS
-  << socket 10.240.28.120:22 opened
-  Disabling high-strength ciphers: cipher strengths apparently
limited by JCE policy
-  >> running [/tmp/init-bootstrap init] as jclouds@10.240.28.120
-  << init(0)
-  >> running [sudo /tmp/init-bootstrap start] as jclouds@10.240.28.120
-  << start(0)
-  << exitstatus(0)
-  << customized
node(https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/instances/jaam-test-e6d)
<< node https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/instances/jaam-test-e6d:
[10.240.28.120, 104.197.32.104]
>> running [echo hello] on group jaam-test as jaamiller
-  >> blocking on sockets [104.197.32.104:22, 10.240.28.120:22] for
600000 MILLISECONDS
-  << socket 10.240.28.120:22 opened
error executing echo hello on group jaam-test: error runScript on
filtered nodes options({loginUser=jaamiller,
loginPasswordPresent=true, loginPrivateKeyPresent=true,
runAsRoot=false, wrapInInitScript=false})
Execution failures:

0 error[s]
Node failures:

1) IllegalArgumentException on node
https://www.googleapis.com/compute/v1/projects/jaam-test-project/zones/us-central1-a/instances/jaam-test-e6d:
java.lang.IllegalArgumentException: you must specify a password, a key
or an SSH agent needs to be available
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125)
at org.jclouds.sshj.SshjSshClient.<init>(SshjSshClient.java:148)
at org.jclouds.sshj.config.SshjSshClientModule$Factory.create(SshjSshClientModule.java:77)
at org.jclouds.compute.functions.CreateSshClientOncePortIsListeningOnNode.apply(CreateSshClientOncePortIsListeningOnNode.java:68)
at org.jclouds.compute.functions.CreateSshClientOncePortIsListeningOnNode.apply(CreateSshClientOncePortIsListeningOnNode.java:40)
at org.jclouds.compute.callables.RunScriptOnNodeUsingSsh.init(RunScriptOnNodeUsingSsh.java:99)
at org.jclouds.compute.strategy.InitializeRunScriptOnNodeOrPlaceInBadMap.call(InitializeRunScriptOnNodeOrPlaceInBadMap.java:61)
at org.jclouds.compute.strategy.InitializeRunScriptOnNodeOrPlaceInBadMap.call(InitializeRunScriptOnNodeOrPlaceInBadMap.java:34)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


1 error[s]

On 21 July 2015 at 13:57, Andrew Phillips <an...@apache.org> wrote:
>> error: group(class java.lang.NullPointerException)
>
>
> An NPE, eh? I see that the code seems to have changed relative to the
> current trunk - do you think you could build against 2.0.0-SNAPSHOT and run
> the example again to see if anything's changed?
>
> I've pasted a version of the compute-basics POM with the required changes
> (basically, changing jclouds.version, changing the google-compute-engine
> group ID and adding the Apache snapshot repo) here:
>
> http://pastie.org/private/zlfanz26pzc0hydsc2zwq
>
> Thanks for sending over that additional info!
>
> Regards
>
> ap



-- 
Jonathan Miller
DevOps Engineer, Appsbroker Consulting
Mob: 07580 779841

-- 


Follow us on:   <https://plus.google.com/+Appsbroker/>  
<https://twitter.com/appsbroker>  
<http://www.linkedin.com/company/appsbroker-consulting-limited/careers?trk=top_nav_careers>


Appsbroker Consulting Limited, Registered office: Appsbroker House, The 
Square, Swindon,
SN1 3EB, Company Number: 5702796, VAT Number: GB 876 3533 92, Company 
registered in England and Wales.
________________________________________
PLEASE NOTE AS RECIPIENT OF THIS EMAIL: Any views or opinions presented are 
solely those of the author and do not represent those of Appsbroker 
Consulting Limited. This e-mail is confidential and intended solely for the 
addressee. If you are not the intended recipient, be advised that you have 
received this mail in error and that any use, dissemination, forwarding, 
printing or copying of this e-mail is strictly prohibited. Furthermore, if 
you are not the intended recipient, please email it back to the sender and 
then immediately permanently delete it.

Re: GCE problem 'error: group'

Posted by Andrew Phillips <an...@apache.org>.
> error: group(class java.lang.NullPointerException)

An NPE, eh? I see that the code seems to have changed relative to the 
current trunk - do you think you could build against 2.0.0-SNAPSHOT and 
run the example again to see if anything's changed?

I've pasted a version of the compute-basics POM with the required 
changes (basically, changing jclouds.version, changing the 
google-compute-engine group ID and adding the Apache snapshot repo) 
here:

http://pastie.org/private/zlfanz26pzc0hydsc2zwq

Thanks for sending over that additional info!

Regards

ap

Re: GCE problem 'error: group'

Posted by Andrew Phillips <an...@apache.org>.
Hi Jonathan

If you built the examples from source, could you modify the error 
handling line in [1] to also print out the type of the exception and the 
stacktrace? E.g. from:

} catch (Exception e) {
   System.err.println("error: " + e.getMessage());
   error = 1;
} finally {

to

} catch (Exception e) {
   System.err.println("error: " + e.getMessage() + "(" + e.getClass() + 
")");
   e.printStackTrace(System.err);
   error = 1;
} finally {

Could you then run the example again and add the output to this thread?

Thanks!

ap

[1] 
https://github.com/jclouds/jclouds-examples/blob/master/compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java#L237