Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NPE from .disks().getById(diskId) #1255

Open
metaldectr opened this issue Aug 5, 2020 · 3 comments
Open

[BUG] NPE from .disks().getById(diskId) #1255

metaldectr opened this issue Aug 5, 2020 · 3 comments
Assignees
Labels
customer-response-expected Mgmt Issues that refer to the management plane

Comments

@metaldectr
Copy link

Exception or Stack Trace
Caused by java.lang.IllegalArgumentException: Parameter resourceGroupName is required and cannot be null.
/opt/lib/azure-mgmt-compute-1.22.0.jar!/com/microsoft/azure/management/compute/implementation/DisksInner.class:529 in getByResourceGroupWithServiceResponseAsync
/opt//lib/azure-mgmt-compute-1.22.0.jar!/com/microsoft/azure/management/compute/implementation/DisksInner.class:508 in getByResourceGroupAsync
/opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/TopLevelModifiableResourcesImpl.class:64 in getInnerAsync
/opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:115 in getByResourceGroupAsync
/opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:80 in getByIdAsync
/opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:69 in getById
/opt/lib/azure-mgmt-resources-1.22.0.jar!/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.class:34

Setup (please complete the following information):

  • JRE Version: 11
  • SDK Version: 1.22.0
@weidongxu-microsoft
Copy link
Member

@metaldectr

Could you share your disk ID? The exception seems be caused by invalid resource ID (hence the resource group cannot be extraced).

@metaldectr
Copy link
Author

I get diskId from vm.dataDisks()

VirtualMachine
/**
* @return the managed data disks associated with this virtual machine, indexed by LUN
*/
Map<Integer, VirtualMachineDataDisk> dataDisks();

and get Id from this object.

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Aug 7, 2020

@metaldectr
Would you help paste the id here (with redact if you prefer)?

I am fine with my test (with 1.36.0)

            var vm = azure.virtualMachines().getById(VM_ID);
            var id = vm.dataDisks().entrySet().iterator().next().getValue().id();

            var disk = azure.disks().getById(id);

The format of the ID would be

/subscriptions/{subscription}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/disks/{disk}

@weidongxu-microsoft weidongxu-microsoft added the Mgmt Issues that refer to the management plane label Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-response-expected Mgmt Issues that refer to the management plane
Projects
None yet
Development

No branches or pull requests

3 participants