Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango-compressor, heroku, s3: Request has expired
    primarykey
    data
    text
    <p>I am using django-compressor on heroku with amazon s3 serving static files and I keep running into the following error with the compressor generated links to static files. I am totally new to compressor and s3:</p> <pre><code>https://xxx.s3.amazonaws.com/static/CACHE/css/989a3bfc8147.css?Signature=tBJBLUAWoA2xjGlFOIu8r3SPI5k%3D&amp;Expires=1365267213&amp;AWSAccessKeyId=AKIAJCWU6JPFNTTJ77IQ &lt;Error&gt; &lt;Code&gt;AccessDenied&lt;/Code&gt; &lt;Message&gt;Request has expired&lt;/Message&gt; &lt;RequestId&gt;FE4625EF498A9588&lt;/RequestId&gt; &lt;Expires&gt;2013-04-06T16:53:33Z&lt;/Expires&gt; &lt;HostId&gt;Fbjlk4eigroefpAsW0a533NOHgfQBG+WFRTJ392v2k2/zuG8RraifYIppLyTueFu&lt;/HostId&gt; &lt;ServerTime&gt;2013-04-06T17:04:41Z&lt;/ServerTime&gt; &lt;/Error&gt; </code></pre> <p>I have two heroku servers configured, one for staging and one for production. They each have their own database and s3 bucket. They also share the same settings file, all unique settings are configured as environment vars. I have checked that the static files are in fact being pushed to their respective buckets.</p> <p>compressor &amp; s3 settings are as follows:</p> <pre><code>COMPRESS_ENABLED = True COMPRESS_STORAGE = STATICFILES_STORAGE COMPRESS_URL = STATIC_URL COMPRESS_ROOT = STATIC_ROOT COMPRESS_OFFLINE = False AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID') AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY') AWS_STORAGE_BUCKET_NAME = os.environ.get('AWS_STORAGE_BUCKET_NAME') </code></pre> <p>Each time I push an update to heroku on staging or production, I eventually run into the above issue. Sometimes it happens after an hour, sometimes a day, sometimes a week, and sometimes as soon as an update is pushed out. The odd thing is that, if I push the same update to both environments, one will work and I will get the error on the other or they will both work at first and one will expire in an hour and the other will expire in a week. </p> <p>I would really appreciate it if someone could explain what is going on. Obviously the Expires parameter is causing the problem, but why would the duration change with each push and what determines the amount of time? HOW DO YOU CHANGE THE EXPIRATION TIME? Please let me know if you need any more info.</p> <p>UPDATE: I temporarily solved the problem by setting AWS_QUERYSTRING_AUTH = False. There does not seem to be any way to set the EXPIRATION TIME in the query string, only using in the request header.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload