[Django]-Django app under uwsgi failing to start when using postgresql database

7πŸ‘

βœ…

I finally figured out what my problem was. In my uwsgi.ini file I had

limit-as = 128

This switch limits the address space of uwsgi process to 128mb. I guess that was not enough for PostgreSQL driver. After removing the switch everything works like a charm.
Although it’s better to find a value that works instead of just removing the value altogether.

πŸ‘€gregor2004ua

1πŸ‘

Root exception is this:

django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: libgpg-error.so.0: failed to map segment from shared object: Cannot allocate memory

From what I found, it may be a 32/64-bit issue. For example, see this page:

https://serverfault.com/questions/329418/cannot-allocate-memory-error-for-psycopg2-and-libgcrypt-so-on-debian-6-64bit

You might want to use the file tool and check the architectures of your libs (specifically _psycopg.so and libgpg-error.so.0). Also compare with python -c "import platform; print platform.architecture()"

Leave a comment