Whew. Now I'm relieved that this is not a *bugfoot*. After attaching the 
debugger one more time, I found out that the `AuthenticationException` was 
caused by the `ProfitBricksComputeServiceAdapter` [generating a 
password](https://github.com/devcsrj/jclouds/commit/1391384dd5d58e5ccbe91ca4f5fb8c0f63800fb8#diff-6af74fe6e33ae1d12faae140fee688d2L118),
 if none is provided. This doesn't make sense to snapshots.

The latest commit sets loginUser and password as null for snapshots, so that 
[no `LoginCredentials` is 
created](https://github.com/devcsrj/jclouds/commit/1391384dd5d58e5ccbe91ca4f5fb8c0f63800fb8#diff-6af74fe6e33ae1d12faae140fee688d2R241).

```
testSpawnNodeFromImage(org.jclouds.profitbricks.compute.extensions.ProfitBricksImageExtensionLiveTest)
  Time elapsed: 329.445 sec  <<< FAILURE!
java.lang.NullPointerException: no credentials found for node 
81a0ee10-7c64-4129-bf8a-68c14afc8cd7
        at 
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:253)
        at 
org.jclouds.compute.functions.CreateSshClientOncePortIsListeningOnNode.apply(CreateSshClientOncePortIsListeningOnNode.java:62)
        at 
org.jclouds.compute.functions.CreateSshClientOncePortIsListeningOnNode.apply(CreateSshClientOncePortIsListeningOnNode.java:40)
        at 
org.jclouds.compute.extensions.internal.BaseImageExtensionLiveTest.checkReachable(BaseImageExtensionLiveTest.java:167)
        at 
org.jclouds.compute.extensions.internal.BaseImageExtensionLiveTest.testSpawnNodeFromImage(BaseImageExtensionLiveTest.java:136)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:696)
        at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:882)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1189)
        at 
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
        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)
```

My question, what's the cleanest approach to set the credentials for the newly 
created image? Or should the [test 
method](https://github.com/jclouds/jclouds/blob/master/compute/src/test/java/org/jclouds/compute/extensions/internal/BaseImageExtensionLiveTest.java#L134)
 be updated?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/929#issuecomment-191569462

Reply via email to