You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Ignasi Barrera (JIRA)" <ji...@apache.org> on 2015/01/26 11:14:34 UTC

[jira] [Commented] (JCLOUDS-812) IllegalStateException when launching node on EC2 with overrideLoginCredentials defined

    [ https://issues.apache.org/jira/browse/JCLOUDS-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14291642#comment-14291642 ] 

Ignasi Barrera commented on JCLOUDS-812:
----------------------------------------

The failure happens in the following line:
https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/callables/SudoAwareInitManager.java#L115-L117

Previous versions of jclouds allowed null values and we did no checks there. It is possible that the old code was just passing a "null" string there and a configuration error was silently ignored: that code is reached if the credentials are configured to require {{sudo}}. In that case, a password must be provided so it can be passed to the {{sudo}} command.

Do you need to use sudo to authenticate? Are you providing the password?

> IllegalStateException when launching node on EC2 with overrideLoginCredentials defined
> --------------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-812
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-812
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 1.8.1
>         Environment: Ubuntu 13.04
> Java 1.7
>            Reporter: Kasper Madsen
>              Labels: ec2, regression
>
> Code that works on 1.7.0, breaks with error after update to version 1.8.1 (it works without the .overrideLoginCredentials setting). The following command breaks:
> {code:java}
> _newNodes = (Set<NodeMetadata>) _compute.createNodesInGroup(
>    _clustername,
>    _nodeids.size(),
>    _compute.templateBuilder()
>       .hardwareId(_instanceType)
>       .locationId(_region)
>       .imageId(_image)
>       .options(
>          new TemplateOptions()
>                .runAsRoot(false)
>                .wrapInInitScript(true)
>                .inboundPorts(Tools.getPortsToOpen())
>                .userMetadata("daemons", _daemons.toString())
>                .runScript(new StatementList(_initScript))
>               .overrideLoginCredentials(Tools.getPrivateKeyCredentials(_username))
>                .authorizePublicKey(Tools.getPublicKey()))
>          .build());
> {code}
> I get the following error:
> {noformat}
> 2015-01-26 00:23:50 [ERROR] << problem customizing node(eu-west-1/i-6130e886): 
> java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
> 	at com.google.common.base.Absent.get(Absent.java:47)
> 	at org.jclouds.compute.callables.SudoAwareInitManager.execScriptAsRoot(SudoAwareInitManager.java:116)
> 	at org.jclouds.compute.callables.SudoAwareInitManager.runAction(SudoAwareInitManager.java:84)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSsh.doCall(RunScriptOnNodeAsInitScriptUsingSsh.java:131)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.future(RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java:64)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.doCall(RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java:56)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSsh.call(RunScriptOnNodeAsInitScriptUsingSsh.java:73)
> 	at org.jclouds.compute.strategy.CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.call(CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java:121)
> 	at org.jclouds.compute.strategy.CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.call(CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java:49)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)
> 2015-01-26 00:25:19 [ERROR] Problem launching instance
> org.jclouds.compute.RunNodesException: error running 1 node group(kxperiment) location(eu-west-1) image(ami-f1f80a86) size(m1.medium) options({loginUser=ubuntu, loginPrivateKeyPresent=true, authenticateSudo=true, inboundPorts=[22, 6627, 8080, 80], scriptPresent=true, publicKeyPresent=true, userMetadata={daemons=[ZK, MASTER, UI]}, userDataCksum=2f4a740b})
> Execution failures:
> 0 error[s]
> Node failures:
> 1) IllegalStateException on node eu-west-1/i-6130e886:
> java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
> 	at com.google.common.base.Absent.get(Absent.java:47)
> 	at org.jclouds.compute.callables.SudoAwareInitManager.execScriptAsRoot(SudoAwareInitManager.java:116)
> 	at org.jclouds.compute.callables.SudoAwareInitManager.runAction(SudoAwareInitManager.java:84)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSsh.doCall(RunScriptOnNodeAsInitScriptUsingSsh.java:131)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.future(RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java:64)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.doCall(RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilComplete.java:56)
> 	at org.jclouds.compute.callables.RunScriptOnNodeAsInitScriptUsingSsh.call(RunScriptOnNodeAsInitScriptUsingSsh.java:73)
> 	at org.jclouds.compute.strategy.CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.call(CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java:121)
> 	at org.jclouds.compute.strategy.CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.call(CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.java:49)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)
> 1 error[s]
> 	at org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:222)
> 	at org.jclouds.ec2.compute.EC2ComputeService.createNodesInGroup(EC2ComputeService.java:148)
> 	at dk.kaspergsm.stormdeploy.LaunchNodeThread.run(LaunchNodeThread.java:76)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)