Skip to content Skip to sidebar Skip to footer

Azure Storage Error Using Python Sdk

I've download Azure SDK for python to my Ubuntu (Tool version 0.8.16). And i'm trying to run this code from azure.storage import BlobService blob_service = BlobService(account_nam

Solution 1:

As mentioned in the error:

Request date header too old: 'Tue, 24 Mar 2015 09:06:59 GMT'

You will get this error if difference between the date/time on your computer (in UTC) and date/time on Azure Storage Server is more than 15-20 minutes (your computer's date/time is behind that of Azure).

UPDATE

Essentially what happens is that when a request is sent to Azure Storage Service (e.g. create container) the SDK takes the local date/time of your computer, converts it into UTC and then sends it to Azure along with the request (as a request header either date or x-ms-date). Upon receiving the request, among other things Azure Storage service compares this date/time with its date/time and if the difference is more than 15-20 minutes (your clock is behind), Azure Storage service throws the error you're getting. This is done as a security measure so that in case somebody got hold of your request can't replay the request over and over again.

Solution 2:

I get similar errors due to clock skew after resuming WSL 2 (Windows Subsystem for Linux) sessions from sleep then using the Azure cli from the bash/zsh command line. This fixes the clock:

sudo hwclock -s -v

See: Fixing clock skew with WSL 2

Update: This bug seems to be fixed in WSL kernel version 5.10.16.3-microsoft-standard-WSL2. After upgrading, I haven't seen it. See: https://github.com/microsoft/WSL/issues/5014#issuecomment-605243281

Post a Comment for "Azure Storage Error Using Python Sdk"