[BUG] Signature does not match when accepting a marketplace ordering agreement
See original GitHub issueDescribe the bug
Before using a marketplace Azure VM image, you need to accept its agreement terms. This can be done using the cli, which uses in background the API:
az vm image terms accept -p $publisher -f $offer --plan $sku
The Java SDK uses the same API, but end up with a failure.
Exception or Stack Trace
Exception in thread "main" com.microsoft.azure.management.marketplaceordering.v2015_06_01.ErrorResponseException: Status code 400, {"error":{"code":"BadRequest","message":"Signature does not match. Please request terms again and request acceptance."}}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.microsoft.rest.ServiceResponseBuilder.build(ServiceResponseBuilder.java:122)
at com.microsoft.azure.AzureResponseBuilder.build(AzureResponseBuilder.java:56)
at com.microsoft.azure.management.marketplaceordering.v2015_06_01.implementation.MarketplaceAgreementsInner.createDelegate(MarketplaceAgreementsInner.java:281)
at com.microsoft.azure.management.marketplaceordering.v2015_06_01.implementation.MarketplaceAgreementsInner.access$100(MarketplaceAgreementsInner.java:40)
at com.microsoft.azure.management.marketplaceordering.v2015_06_01.implementation.MarketplaceAgreementsInner$5.call(MarketplaceAgreementsInner.java:268)
at com.microsoft.azure.management.marketplaceordering.v2015_06_01.implementation.MarketplaceAgreementsInner$5.call(MarketplaceAgreementsInner.java:264)
at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
at retrofit2.adapter.rxjava.CallArbiter.deliverResponse(CallArbiter.java:120)
at retrofit2.adapter.rxjava.CallArbiter.emitResponse(CallArbiter.java:102)
at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:46)
at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:24)
at rx.Observable.unsafeSubscribe(Observable.java:10327)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:10327)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
at rx.Observable.unsafeSubscribe(Observable.java:10327)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
at rx.Observable.subscribe(Observable.java:10423)
at rx.Observable.subscribe(Observable.java:10390)
at rx.Observable.subscribe(Observable.java:10298)
at org.dryft.azure.Agreements$.acceptTerms(Agreements.scala:102)
at org.dryft.azure.Agreements$.$anonfun$main$2(Agreements.scala:128)
at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
To Reproduce
- Get an agreement from a (publisher, offer, plan) triplet
- Modify the accepted boolean of the returned agreement
- Update the agreement
Code Snippet
Simplified async pseudo-code:
val terms = client.marketplaceAgreements.getAsync(publisher, offer, sku)
client.marketplaceAgreements.createAsync(publisher, offer, sku, terms.inner.withAccepted(true))
Additional context
Similar issue on node sdk: https://github.com/Azure/azure-sdk-for-node/issues/2423
For some reason, the date is not formatted properly and skips some milliseconds. Milliseconds that changes the signature of the query and makes it fail.
Returned agreement after the first GET query:
{
"properties": {
"retrieveDatetime": "2019-11-07T12:19:46.796698Z",
"signature": "SOME_SIGNATURE",
"accepted": false
}
}
Updated agreement for the PUT query:
{
"properties": {
"retrieveDatetime": "2019-11-07T12:19:46.796Z",
"signature": "SAME_SIGNATURE",
"accepted": true
}
}
The 698
missing part just before the Z
of the retrieveDatetime
is the issue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Amazon API MWS SignatureDoesNotMatch - Stack Overflow
I am completely out of ideas at this point. I have triple checked that my secret key, access key, seller ID and marketplace...
Read more >Error Codes - Marketing API - Meta for Developers
Permission Error: Either the object you are trying to access is not visible to you or the action you are trying to take...
Read more >CDO Organizational Maintenance Web Form, Troubleshooting ...
12 is missing or if the signature does not match the Organization Senior Official listed on your application, we will not accept your...
Read more >Signature Version 2 signing process - AWS General Reference
Learn how to sign requests to some Amazon Web Services services with Signature Version 2.
Read more >Provide information about sign agreement. - Microsoft Learn
If an agreement sent for your signature has the wrong signature method, decline it via Adobe Sign and contact your Microsoft partner (Software ......
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
Any update on this? It’s been 6 months and this API is basically broken.
@notdryft This is caused by the DateTimeSerializer. We will need some time to figure out whether this should be fixed from server side or SDK side.
cc: @jianghaolu