Script timed out before returning headers: wsgi.py on elastic beanstalk

后端 未结 6 1138
后悔当初
后悔当初 2020-12-14 07:45

I\'m trying to deploy a Django application to Elastic Beanstalk. When I visit the page it never loads. The logs say:

Script timed out before returning header         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-14 08:27

    Just my 2 cents on a similar issue I faced.

    I had a similar problem. It turned out to be that the script (which makes a DB insert/update/delete call) being executed from django application was waiting in a deadlock state for the lock on the table to be released. Once it was released, the code went through without this error. I never had to re-deploy my EB application.

    1. Make sure that you are not connected to the database through any other SQL client. If yes, query for any active locks. (In my case, I was connecting to redshift. Querying STV_LOCKS table lists the active locks).
    2. Check who is holding the locks. (In my case, it was my SQL client, connected to redshift, which executed a CUD operation, and since COMMIT was not issued, it was holding a pending write lock on the table).
    3. I issued a commit from my SQL client, and the lock was released. My EB code went through and there was no Script timed out error any more.

提交回复
热议问题