jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aled Sage (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JCLOUDS-678) NPE on GCE attachDisk when VM not found (because user-error wrong region specified)
Date Wed, 20 Aug 2014 12:39:25 GMT
Aled Sage created JCLOUDS-678:
---------------------------------

             Summary: 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
            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.2#6252)

Mime
View raw message