Closed jeremymeng closed 3 years ago
Although this test always passed
Shared Access Signature (SAS) generation Node.js only generateFileSASQueryParameters should work for file with access policy
It ran after all the failing tests (right after generateFileSASQueryParameters should work for file
in the same file.
https://dev.azure.com/azure-sdk/internal/_test/analytics?definitionId=159&contextType=build These tests succeeded except that three run in the last two weeks. Since it has been 12 days, can't find the verbose service log for more info.
According to @jiacfan, we once find an issue on SAS validation due to clock skew where the start time is not started yet. But we have no proof on what actually happened this time without the verbose log.
Need to repro.
Another one
RestError: <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:2fb711e5-301a-0077-3433-ec989a000000
Time:2020-02-25T23:28:05.8770849Z</Message><AuthenticationErrorDetail>SAS identifier cannot be found for specified signed identifier</AuthenticationErrorDetail></Error>
at new RestError (/home/vsts/work/1/s/sdk/core/core-http/lib/restError.ts:27:5)
at /home/vsts/work/1/s/sdk/core/core-http/lib/policies/deserializationPolicy.ts:176:21
at process._tickCallback (internal/process/next_tick.js:68:7)
I wonder if this could be a race condition between the calls to setAccessPolicy()
and listFilesAndDirectories()
, where the service has accepted the SAS policy but it hasn't been fully propagated yet, so there is a small delay where the SAS policy cannot be used yet.
If so, I think the best fix would be to do one of the following after calling setAccessPolicy()
:
listFilesAndDirectories()
in a retry loop, and only retry for this specific error message.This still may be a bug in the service, depending on the expected behavior. Is the service supposed to guarantee a SAS policy can be used as soon as it is set?
According to the documentation:
When you establish a stored access policy on a container, table, queue, or share, it may take up to 30 seconds to take effect. During this interval, requests against a shared access signature that is associated with the stored access policy may fail with status code 403 (Forbidden), until the access policy becomes active.
So I think the best fix here is to wrap the call which uses the stored access policy in a retry loop, and retry say once every second up to 30 seconds, but only retry on HTTP 403.
Partially fixed by #7600. Still need to do Data Lake.
Closing as we now have issues being logged for every new live test failure. This should cover any of the failures discussed in this issue
Only happening in all three windows build in the most recent run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=241573&view=ms.vss-test-web.build-test-results-tab
failures like