question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CloudExceptions are missing Message

See original GitHub issue

Related to #1519, many operations seem to throw empty CloudExceptions.

The reason for the Exception is written into log, but CloudException still has null as message.

For example:

try {
    azure.virtualMachineScaleSets()
        .define("test1")
    	.withRegion("iceland")
    	.withExistingResourceGroup(group)
    	.withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D1_V2)
    	.withExistingPrimaryNetworkSubnet(network, subnet)
    	.withoutPrimaryInternetFacingLoadBalancer()
    	.withoutPrimaryInternalLoadBalancer()
    	.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
    	.withRootUsername("secret")
    	.withRootPassword("itsNOTsecret12345")
    	.withoutOverProvisioning()
    	.withCapacity(1)
    	.create();
} catch (CloudException ce) {
    System.err.println(ce + ": " + ce.getMessage());
}

The message in the end is: com.microsoft.azure.CloudException: null

In the log entries, however I see a good description for the error:

[RxIoScheduler-2] INFO com.microsoft.azure.management.compute.VirtualMachineScaleSets createOrUpdate - 527-byte body:
{"error":{"code":"LocationNotAvailableForResourceType","message":"The provided location 'iceland' is not available for resource type 'Microsoft.Compute/virtualMachineScaleSets'. List of available regions for the resource type is 'eastus,eastus2,westus,centralus,northcentralus,southcentralus,northeurope,westeurope,eastasia,southeastasia,japaneast,japanwest,australiaeast,australiasoutheast,brazilsouth,southindia,centralindia,westindia,canadacentral,canadaeast,westus2,westcentralus,uksouth,ukwest,koreacentral,koreasouth'."}}

CloudException also contains field body (CloudError). The body should contain errorcode, message and details. In this case all of them were empty.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jianghaolucommented, Apr 13, 2017

This is fixed in 1.0.0.

The cause is in beta5, the default constructor of RestClient.Builder takes JacksonAdapter which doesn’t handle the Azure specifics as AzureJacksonAdapter does, including handling the error body response. (https://github.com/Azure/autorest-clientruntime-for-java/blob/v1.0.0-beta5/client-runtime/src/main/java/com/microsoft/rest/RestClient.java#L210)

1.0.0 is coming out latest next Monday. To work around, please create your own RestClient with .withSerializerAdapter(new AzureJacksonAdapter()).withResponseBuilderFactory(new AzureResponseBuilder.Factory()).

0reactions
TimoKramercommented, Apr 13, 2017

I’ve got the same problem: no message and no hint on what is wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gcloud.exceptions.Forbidden: 403 Missing or insufficient ...
I am a new to Google Cloud Platform.
Read more >
Handle message failures | Cloud Pub/Sub
Remember to attach a subscription to the dead letter topic because // messages published to a topic with no subscriptions are lost. return...
Read more >
Exception Message Missing When Raising ... - Oracle Support
Exceptions originating from a pipelined table functions loose the accompanying error message, under some circumstances. For instance, calling ...
Read more >
Errors and exceptions | Cloud-to-cloud | Google Home
This document lists the officially-supported errors and exceptions for smart home devices. Please use these given errors and exceptions codes in the intent ......
Read more >
403,message": "The request is missing a valid API key."
output:=> Fatal error: Uncaught Google\Cloud\Core\Exception\ServiceException: { "error": { "code": 403, "message": "The request is missing a valid API key.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found