CloudExceptions are missing Message
See original GitHub issueRelated 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:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is fixed in 1.0.0.
The cause is in beta5, the default constructor of
RestClient.Builder
takesJacksonAdapter
which doesn’t handle the Azure specifics asAzureJacksonAdapter
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())
.I’ve got the same problem: no message and no hint on what is wrong.