You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/10/16 23:22:33 UTC

[jira] [Commented] (JCLOUDS-678) NPE on GCE attachDisk when VM not found (because user-error wrong region specified)

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

ASF subversion and git services commented on JCLOUDS-678:
---------------------------------------------------------

Commit ea0f2d876b49c4208c916776d2ded3500a905619 in jclouds-labs-google's branch refs/heads/master from [~nacx]
[ https://git-wip-us.apache.org/repos/asf?p=jclouds-labs-google.git;h=ea0f2d8 ]

JCLOUDS-678: Do not silently return null in POST operations


> NPE on GCE attachDisk when VM not found (because user-error wrong region specified)
> -----------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-678
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-678
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-labs-google
>    Affects Versions: 1.8.0
>            Reporter: Aled Sage
>            Assignee: Ignasi Barrera
>            Priority: Minor
>
> When attaching a disk to a VM, I got an NPE (because I specified the wrong zone - user error!)
>     2014-08-19 17:27:39,455 ERROR b.l.b.AbstractVolumeManagerLiveTest [main]: Error creating and attaching volume
>     java.lang.NullPointerException: operation should not be null
>         at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229) ~[guava-17.0.jar:na]
>         at brooklyn.location.blockstore.gce.GoogleComputeEngineVolumeManager.waitForOperationToBeDone(GoogleComputeEngineVolumeManager.java:183) ~[classes/:na]
>         at brooklyn.location.blockstore.gce.GoogleComputeEngineVolumeManager.attachBlockDevice(GoogleComputeEngineVolumeManager.java:111) ~[classes/:na]
>         at brooklyn.location.blockstore.AbstractVolumeManager.createAttachAndMountVolume(AbstractVolumeManager.java:38) ~[classes/:na]
>         at brooklyn.location.blockstore.AbstractVolumeManagerLiveTest.testCreateAndAttachVolume(AbstractVolumeManagerLiveTest.java:158) ~[test-classes/:na]
> The sequence of events were:
> 1. create VM without specifying region (it was created in asia-east1-c)
> 2. attach disk to the VM (but specifying europe-west1-a)
> 2.1 jclouds calls POST https://www.googleapis.com/compute/v1/projects/jclouds-gce/zones/europe-west1-a/instances/brooklyn-ryqx-aled-1d9/attachDisk
> 2.2 jclouds gets back a 404, so returns null from InstanceApi.attachDiskInZone
>     2014-08-19 17:27:39,451 DEBUG jclouds.wire [main]: << "  "code": 404,[\n]"
>     2014-08-19 17:27:39,451 DEBUG jclouds.wire [main]: << "  "message": "The resource 'projects/jclouds-gce/zones/europe-west1-a/instances/brooklyn-ryqx-aled-1d9' was not found"[\n]"
> 2.3 tries to look up operation with id null; throws NPE
> I'd have preferred a more graceful error earlier, to say that the VM could not be found.
> Unfortunately the nice message is not available to the caller of instanceApi.attachDiskInZone; it just returns null.



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