Error With No Message From The Libpq
Sign in Pricing Blog Support Search GitHub This repository Watch 36 Star 519 Fork 134 psycopg/psycopg2 Code Issues 26 Pull requests 5 Projects 0 Pulse Graphs New issue (DatabaseError) error with no message from the libpq #281 Closed barrachri opened this Issue Jan 20, 2015 · 14 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 6 participants barrachri commented Jan 20, 2015 Hi guys, I get randomly this error: The stack is flask with sqlalchemy and postgres. Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engin/base.py", line 951, in _execute_context context) File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engin/default.py", line 436, in do_execute cursor.execute(statement, parameters) psycopg2.DatabaseError: error with no message from the libpq The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.4/dist-packages/flask/_compat.py", line 33, in reraise raise value File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1461, in dispatch_request return self.view_functionsrule.endpoint File "./main/views.py", line 63, in auth_login user = User.query.filter_by(username=username).first() File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/orm/query.py", line 2367, in first ret = list(self[0:1]) File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/orm/query.py", line 2228, in getitem return list(res) File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/orm/query.py", line 2438, in iter return self._execute_and_instances(context) File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/orm/query.py", line 2453, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/engine/base.py", line 729, in execute return meth(self, multiparams, params) File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection return connec
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, https://github.com/psycopg/psycopg2/issues/281 helping each other. Join them; it only takes a minute: Sign up PostgreSQL Database Server Unresponsive up vote 1 down vote favorite 1 How do you diagnose problems with PostgreSQL performance? I have a Django-based webapp using PostgreSQL as a database backend on Ubuntu 12, and under heavy load, the database seems to just disappear, causing the http://stackoverflow.com/questions/12229484/postgresql-database-server-unresponsive Django-interface to be unreachable and resulting in errors like: django.db.utils.DatabaseError: error with no message from the libpq django.db.utils.DatabaseError: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. What's odd is that the logs in /var/log/postgresql show nothing unusual. The only thing the log /var/log/postgresql/postgresql-9.1-main.log shows are lots of lines like: 2012-09-01 12:24:01 EDT LOG: unexpected EOF on client connection Running top shows that PostgreSQL doesn't seem to be consuming any CPU, even though service postgresql status indicates it's still running. Doing a 'service postgresql restart` temporarily fixes the problem, but the problem returns as soon as there's a lot of load on the database. I've checked the dmesg and syslog, but I don't see anything that would explain what's wrong. What other logs should I check? How do I determine what's wrong with my PostgreSQL server? Edit: My max_connections is set to 100. Although I am doing a lot of manual transactions. Reading up on Django's ORM behavior with Postgr
pgsql-announce pgsql-bugs pgsql-docs pgsql-general pgsql-interfaces pgsql-jobs pgsql-novice pgsql-performance pgsql-php https://www.postgresql.org/message-id/CAGDYbUP%2BsKuat3nGUjZ5sipXbQgi5UwKPTVj73JMufTCksLNwg@mail.gmail.com pgsql-sql pgsql-students Developer lists Regional lists Associations User groups Project lists Inactive lists IRC Local User Groups Featured Users International https://code.djangoproject.com/ticket/20161 Sites Propaganda Resources Weekly News Re: Postgresql connection Error From: Shreeyansh dba
Previous TicketNext Ticket → Opened 4 years ago Closed 4 years ago Last modified 3 years ago #20161 closed Uncategorized (invalid) save errors with multiproccesing Reported by: oddghost@… Owned by: nobody Component: Database layer (models, ORM) Version: 1.5 Severity: Normal Keywords: Cc: Triage Stage: Unreviewed Has patch: no Needs documentation: no Needs tests: no Patch needs improvement: no Easy pickings: no UI/UX: no Description i have an exception then trying to process big data multiproccesed return self.get_query_set().get(*args, **kwargs) File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/models/base.py", line 546, in save File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/models/query.py", line 382, in get force_update=force_update, update_fields=update_fields) File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/models/base.py", line 654, in save_base transaction.commit_unless_managed(using=using) File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/transaction.py", line 134, in commit_unless_managed num = len(clone) File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/models/query.py", line 90, in __len__ connection.commit_unless_managed() File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 221, in commit_unless_managed self._result_cache = list(self.iterator()) File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/models/query.py", line 301, in iterator for row in compiler.results_iter(): File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 775, in results_iter self._commit() File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 240, in _commit return self.connection.commit() DatabaseError: error with no message from the libpq for rows in self.execute_sql(MULTI): File "/opt/Envs/akkord/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 854, in