Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to install Postgres 9.3 on Ubuntu 14.04 and I am getting an irksome error on startup. Here's what I'm seeing:

$ sudo service postgresql restart
* Restarting PostgreSQL 9.3 database server
* Error: could not exec /usr/lib/postgresql/9.3/bin/pg_ctl /usr/lib/postgresql/9.3/bin/pg_ctl start -D /var/lib/postgresql/9.3/main -l /var/log/postgresql/postgresql-9.3-main.log -s -o  -c config_file="/etc/postgresql/9.3/main/postgresql.conf" : [fail]

So I checked the log file with this output:

 2015-01-05 21:50:05 EST LOG:  database system was shut down at 2015-01-05 21:50:03 EST
 2015-01-05 21:50:05 EST LOG:  database system is ready to accept connections
 2015-01-05 21:50:05 EST LOG:  autovacuum launcher started
 2015-01-05 21:50:06 EST LOG:  incomplete startup packet
 2015-01-05 21:51:22 EST ERROR:  syntax error at or near "exit" at character 1
 2015-01-05 21:51:22 EST STATEMENT:  exit;

"Incomplete startup packet" seems to be the culprit but I am having trouble finding info out there on what might be going on, so I thought I would ask. Thanks in advance.

share|improve this question
    
perhaps there is a syntax error in your config file? -c config_file="/etc/postgresql/9.3/main/postgresql.conf" – Craig Efrein Jan 6 '15 at 9:05
1  
If a client connects but doesn't send the proper protocol handshake you'll get this message. All sorts of possible causes - Attempted SSL connections to servers that don't support SSL being one of the most common. It's harmless and may be ignored; it's only logged at ERROR level because it results in a backend exit. – Craig Ringer Jan 6 '15 at 9:06
up vote 8 down vote accepted

There are 3 different items in this question:

  • Incomplete startup packet occuring at server start is inconsequential, you may ignore it. Read Incomplete startup packet help needed (in pgsql-general mailing-list) for more.

  • syntax error at or near "exit" at character 1 means that a client issued exit as if it was an SQL statement.

  • The could not exec error when issuing service postgresql restart looks like a serious installation problem but it's contradicted by the log entry database system is ready to accept connections meaning that the server started up just fine.

share|improve this answer
    
Your response "looks like a serious installation problem" prompted me to do some more research on how to entirely delete Postgres and reinstall. I found this article which was helpful in removing every trace of Postgres prior to reinstall and worked great. – andrewniesen Jan 6 '15 at 13:45
    
one of the possible causes of "Incomplete startup packet" is when a TCP connection is made to the postgresql port 5432, and the immediately closed. This can happen when a monitoring program is configured to check the port, but not to run a SQL command. – Tom H May 1 at 1:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.