Reputation: 1
as the title suggests i'm using Autodesk API (C#) to upload objects in AWS buckets.
For some reason sometimes i obtain the following Exception:
System.AggregateException: One or more errors occurred. (Error calling UploadChunk: {"developerMessage":"ACM check failed, user or calling service does not have access to perform this operation","userMessage":"","errorCode":"AUTH-012","more info":"https://developer.api.autodesk.com/documentation/v1/errors/AUTH-012"})
---> Autodesk.Forge.Client.ApiException: Error calling UploadChunk: {"developerMessage":"ACM check failed, user or calling service does not have access to perform this operation","userMessage":"","errorCode":"AUTH-012","more info":"https://developer.api.autodesk.com/documentation/v1/errors/AUTH-012"}
at Autodesk.Forge.ObjectsApi.UploadChunkAsyncWithHttpInfo(String bucketKey, String objectName, Nullable`1 contentLength, String contentRange, String sessionId, Stream body, String contentDisposition, String ifMatch, String contentType)
at Autodesk.Forge.ObjectsApi.UploadChunkAsync(String bucketKey, String objectName, Nullable`1 contentLength, String contentRange, String sessionId, Stream body, String contentDisposition, String ifMatch, String contentType)
I tried to replicate the error but i get it only randomly. I also implemented a retry policy to call the API in case of that exception but the result doesn't change, even the next calls return the Exception.
I'm sure that credentials and info are correct, they are working with other uploads.
Is it possitble that the token auth is expired and i've to wait more than 2 seconds (actual timesleep set by me) to receive new token for AWS bucket through Autodesk API Objects?
Upvotes: 0
Views: 77
Reputation: 54605
The error your are getting AUTH-012: The Authorization header is missing or invalid.
to me indicates that most likely your token is expiring during use.
Does your application follow the "three-legged authentication/authorization" workflow described in the AutoDesk documentation, where it's also described when/how to refresh the token once expired
Btw you are using v1 of the API which has been deprecated since April 2024
Upvotes: 1