After tested, I found LogAnalytics.Solutions API failed to unmarshal response body and threw below error message when it failed to create solution.
Request body:
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourcegroups/acctestRG-01test2/providers/Microsoft.OperationsManagement/solutions/Containers(acctest-test012)
{
"location": "westeurope",
"plan": {
"name": "Containers(acctest-test012)",
"publisher": "Microsoft",
"promotionCode": "",
"product": "OMSGallery/AzureSQLAnalytics"
},
"properties": {
"workspaceResourceId": "/subscriptions/xx-xx-xx-xx/resourcegroups/acctestrg-01test2/providers/microsoft.operationalinsights/workspaces/acctest-test012"
}
}
Error message:
pollingTrackerBase#updateRawBody: failed to unmarshal response body: StatusCode=0 -- Original Error: invalid character 'F' looking for beginning of value
@neil-yechenwei Is it a client issue? which client you used.
@ruowan 锛寉es. I think so. We鈥檙e using azure go sdk as client.
https://github.com/Azure/azure-sdk-for-go/tree/master/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement
@ArcturusZhang Could you pls take a took at this go SDK issue?
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzMonEssential.
This seems like something is wrong in the async polling response, @neil-yechenwei could you please provide some log when the error was raised?
@ArcturusZhang , after checked, I think the real error message is For first party solution, the solution name has to be convention of solutionType(workspaceName), and the product has to be OMSGallery/solutionType. For example, product OMSGallery/ChangeTracking, solution name ChangeTracking(myworkspace) and seems the response with error message is failed to be unmarshalled in function pt.initializeState().


Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzmonLogA.
@neil-yechenwei the error was thrown here
go-autorest is expecting the error message to be a JSON string, but instead, the service returns the error message as a string literal
For first party solution, the solution name has to be convention of solutionType(workspaceName), and the product has to be OMSGallery/solutionType. For example, product OMSGallery/ChangeTracking, solution name ChangeTracking(myworkspace)
which is not a legal JSON string (legal JSON string should start with curly brace), therefore you will get the error message of invalid character 'F' looking for beginning of value complaining the first character is F.
This should be a service issue, in convention we are expecting that everything returned from the service should be a JSON string rather than plain string.
And particular in this case, this should be a shortage of the current swagger - it cannot describe the format of async errors.
Most helpful comment
@neil-yechenwei the error was thrown here
go-autorestis expecting the error message to be a JSON string, but instead, the service returns the error message as a string literalwhich is not a legal JSON string (legal JSON string should start with curly brace), therefore you will get the error message of
invalid character 'F' looking for beginning of valuecomplaining the first character isF.This should be a service issue, in convention we are expecting that everything returned from the service should be a JSON string rather than plain string.
And particular in this case, this should be a shortage of the current swagger - it cannot describe the format of async errors.