Thread: Postgres service won't start, doesn't log any errors
Hello all,
I have a windows postgres 9.0.1 installation which doesn't start, and also doesn't log any information. The only evidence that an attempt was made is in the event log with the following pair of messages :
1. Waiting for server startup...
2. Timed out waiting for server startup
I've tried to run postgres.exe from the command line to glean more information, but it starts and stops without any output as well. I have uninstalled the server, moved the previous data directory, and reinstalled to no avail as well.
I'm wondering what debugging steps I might be able to take now to track down the source of the problem? Thanks beforehand for any assistance.
Joe Carr wrote on 18.10.2010 23:11: > Hello all, I have a windows postgres 9.0.1 installation which doesn't > start, and also doesn't log any information. The only evidence that > an attempt was made is in the event log with the following pair of > messages : > > 1. Waiting for server startup... 2. Timed out waiting for server > startup > > I've tried to run postgres.exe from the command line to glean more > information, but it starts and stops without any output as well. Did you try using pg_ctl instead (e.g. copy the commandline from the service definition)? In most of the cases it's a permission issue with the data directory. Did you verify the postgres user (the one under whichthe service is started) has full access to the data directory? Regards Thomas
I would go with the permissions issue. Not all postgres startup problems are logged in pg_log. Go check the Application log: right click on Computer -> Manage -> Events -> Application and look for any errors with PG as a source. It may be connected to the fact that somehow postgres user doesn't have permission to write postmaster.pid file either to delete the old one or creating new one. At least this is the main issue I came accross in our clients' DBs. If the postmaster.pid file is created check forr errors like "bogus data in postmaster.pid" as this is another thing that may be the case. 2010/10/18 Thomas Kellerer <spam_eater@gmx.net>: > Joe Carr wrote on 18.10.2010 23:11: >> >> Hello all, I have a windows postgres 9.0.1 installation which doesn't >> start, and also doesn't log any information. The only evidence that >> an attempt was made is in the event log with the following pair of >> messages : >> >> 1. Waiting for server startup... 2. Timed out waiting for server >> startup >> >> I've tried to run postgres.exe from the command line to glean more >> information, but it starts and stops without any output as well. > > Did you try using pg_ctl instead (e.g. copy the commandline from the service > definition)? > > In most of the cases it's a permission issue with the data directory. Did > you verify the postgres user (the one under which the service is started) > has full access to the data directory? > > Regards > Thomas > > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > -- Łukasz Brodziak II MU Bioinformatyka
Hi Thomas,
Thanks for your reply. pg_ctrl has given me some more information, but I'm not quite there yet.
I have verified that the postgres user has "full control" access to the data directory.
When I take the commandline from the service definition and execute it, I get the following:
C:\Program Files\PostgreSQL\9.0\bin>"C:/Program Files/PostgreSQL/9.0/bin/pg_ctl.exe" runservice -N "postgresql-9.0" -D "C:/Program Files/PostgreSQL/9.0/data" -w
pg_ctl: could not start service "postgresql-9.0": error code 1063
from the forum post (http://archives.postgresql.org/pgsql-general/2007-05/msg00281.php), the runservice command alledgedly can only be executed from the service control manager. So, if I replace "runservice" with "start", the server starts without issue :
C:\Program Files\PostgreSQL\9.0\bin>"C:/Program Files/PostgreSQL/9.0/bin/pg_ctl.exe" start -N "postgresql-9.0" -D "C:/Program Files/PostgreSQL/9.0/data" -w
waiting for server to start.... done
server started
and this will work whether I'm logged in as "postgres" or under my user account. Additionally, the \data\pg_log directory is being filled with logging information, indicating (I believe), that permissions are set correctly.
But, the service will not start from the service control manager, or pgAdmin3 (which I imagine attempts to start the service in the same manner).
So, I think it's very close at this point. Thanks again beforehand!
On Mon, Oct 18, 2010 at 5:23 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
Joe Carr wrote on 18.10.2010 23:11:Did you try using pg_ctl instead (e.g. copy the commandline from the service definition)?Hello all, I have a windows postgres 9.0.1 installation which doesn't
start, and also doesn't log any information. The only evidence that
an attempt was made is in the event log with the following pair of
messages :
1. Waiting for server startup... 2. Timed out waiting for server
startup
I've tried to run postgres.exe from the command line to glean more
information, but it starts and stops without any output as well.
In most of the cases it's a permission issue with the data directory. Did you verify the postgres user (the one under which the service is started) has full access to the data directory?
Regards
Thomas
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
I'm having the same problem - and have checked the application log and yes the problem seems to be that postgres user doesn't have permission to write postmaster.pid file. What is the solution to this? Regards Tracey
"Tracey Osborne" <tracey@osborne.net.nz> writes: > I'm having the same problem - and have checked the application log and yes > the problem seems to be that postgres user doesn't have permission to write > postmaster.pid file. What is the solution to this? Did you run initdb as the postgres user? Seems like you might have run it as root, or some other user identity. regards, tom lane
Joe, I'm seeing the exact same thing when I do a fresh installation of Postgres 9.0 on either a 2008 installation or a 2003 installation. In both cases I ensure the entire directory structure is owned by postgres and I've even made postgres a member of the local Administrators group with the same result. Have you had any more luck resolving this issue? Thanks in advance, Roger Joe Carr wrote: > > Hi Thomas, > Thanks for your reply. pg_ctrl has given me some more information, but I'm > not quite there yet. > > I have verified that the postgres user has "full control" access to the > data > directory. > > When I take the commandline from the service definition and execute it, I > get the following: > > C:\Program Files\PostgreSQL\9.0\bin>"C:/Program > Files/PostgreSQL/9.0/bin/pg_ctl.exe" runservice -N "postgresql-9.0" -D > "C:/Program Files/PostgreSQL/9.0/data" -w > > pg_ctl: could not start service "postgresql-9.0": error code 1063 > > from the forum post ( > http://archives.postgresql.org/pgsql-general/2007-05/msg00281.php), the > runservice command alledgedly can only be executed from the service > control > manager. So, if I replace "runservice" with "start", the server starts > without issue : > > C:\Program Files\PostgreSQL\9.0\bin>"C:/Program > Files/PostgreSQL/9.0/bin/pg_ctl.exe" start -N "postgresql-9.0" -D > "C:/Program Files/PostgreSQL/9.0/data" -w > waiting for server to start.... done > server started > > and this will work whether I'm logged in as "postgres" or under my user > account. Additionally, the \data\pg_log directory is being filled with > logging information, indicating (I believe), that permissions are set > correctly. > > But, the service will not start from the service control manager, or > pgAdmin3 (which I imagine attempts to start the service in the same > manner). > > So, I think it's very close at this point. Thanks again beforehand! > > > On Mon, Oct 18, 2010 at 5:23 PM, Thomas Kellerer <spam_eater@gmx.net> > wrote: > >> Joe Carr wrote on 18.10.2010 23:11: >> >> Hello all, I have a windows postgres 9.0.1 installation which doesn't >>> start, and also doesn't log any information. The only evidence that >>> an attempt was made is in the event log with the following pair of >>> messages : >>> >>> 1. Waiting for server startup... 2. Timed out waiting for server >>> startup >>> >>> I've tried to run postgres.exe from the command line to glean more >>> information, but it starts and stops without any output as well. >>> >> >> Did you try using pg_ctl instead (e.g. copy the commandline from the >> service definition)? >> >> In most of the cases it's a permission issue with the data directory. Did >> you verify the postgres user (the one under which the service is started) >> has full access to the data directory? >> >> Regards >> Thomas >> >> >> -- >> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-admin >> > > -- View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3285074.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
Joe Carr wrote on 19.10.2010 00:55: > Hi Thomas, Thanks for your reply. pg_ctrl has given me some more > information, but I'm not quite there yet. > > I have verified that the postgres user has "full control" access to > the data directory. > > When I take the commandline from the service definition and execute > it, I get the following: > > C:\Program Files\PostgreSQL\9.0\bin>"C:/Program > Files/PostgreSQL/9.0/bin/pg_ctl.exe" runservice -N "postgresql-9.0" > -D "C:/Program Files/PostgreSQL/9.0/data" -w > > pg_ctl: could not start service "postgresql-9.0": error code 1063 > > So, if I replace "runservice" with "start", the server starts without issue : > > and this will work whether I'm logged in as "postgres" or under my > user account. Additionally, the \data\pg_log directory is being > filled with logging information, indicating (I believe), that > permissions are set correctly. > > But, the service will not start from the service control manager, or > pgAdmin3 (which I imagine attempts to start the service in the same > manner). > > So, I think it's very close at this point. Thanks again beforehand! Are you sure the service is started under the postgres account? Is the password given there correct? Regards Thomas
Not sure if this helps, but the Services dialogue I get now is: "The postgresql-9.0 - PostGreSQL Server 9.0 service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service." In my case it starts, then stops. There is data in the data directory, so I can only assume that the database is initialized... Also, the password is correct for the service. largish image incoming... sorry... http://postgresql.1045698.n5.nabble.com/file/n3286033/pgadmin.jpg -- View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3286033.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
100-eti <100-eti@csc-scc.gc.ca> wrote: > Not sure if this helps, but the Services dialogue I get now is: > > "The postgresql-9.0 - PostGreSQL Server 9.0 service on Local > Computer started and then stopped. Some services stop > automatically if they have no work to do, for example, the > Performance Logs and Alerts service." > > In my case it starts, then stops. There is data in the data > directory, so I can only assume that the database is > initialized... Also, the password is correct for the service. There is probably a log file somewhere which will tell you what the problem is. If the log information is being thrown away, you may need to try starting PostgreSQL from a command line and specifying the log file. Without information from the log, we would only be guessing. -Kevin
That's the problem though... I've searched through all the PostgreSQL directories, and there are no logs that indicate anything. Next step is to try this on CentOS as it seems the Windows implementation is broken or at least I can't seem to get it going (yet). -- View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3286312.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
Mr./Ms. 100-eti,
----- Original Message -----
From: "100-eti" <100-eti@csc-scc.gc.ca>
To: pgsql-admin@postgresql.org
Sent: Tuesday, November 30, 2010 11:29:17 AM
Subject: Re: [ADMIN] Postgres service won't start, doesn't log any errors
That's the problem though... I've searched through all the PostgreSQL
directories, and there are no logs that indicate anything.
Next step is to try this on CentOS as it seems the Windows implementation is
broken or at least I can't seem to get it going (yet).
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3286312.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Might there be a 'server.log' written to by default in your cluster directory?
Experience says that these things often down to permissions problems...
Lou
----- Original Message -----
From: "100-eti" <100-eti@csc-scc.gc.ca>
To: pgsql-admin@postgresql.org
Sent: Tuesday, November 30, 2010 11:29:17 AM
Subject: Re: [ADMIN] Postgres service won't start, doesn't log any errors
That's the problem though... I've searched through all the PostgreSQL
directories, and there are no logs that indicate anything.
Next step is to try this on CentOS as it seems the Windows implementation is
broken or at least I can't seem to get it going (yet).
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3286312.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
We definitely had a permissions problem. Once that was fixed, per the documentation, it started right up. You may be able to log access problems in Windows too, to help you locate the problem. Good luck, Ken On Tue, Nov 30, 2010 at 04:33:08PM +0000, Lou Picciano wrote: > Mr./Ms. 100-eti, > > > Might there be a 'server.log' written to by default in your cluster directory? > > > Experience says that these things often down to permissions problems... > > > Lou > > ----- Original Message ----- > From: "100-eti" <100-eti@csc-scc.gc.ca> > To: pgsql-admin@postgresql.org > Sent: Tuesday, November 30, 2010 11:29:17 AM > Subject: Re: [ADMIN] Postgres service won't start, doesn't log any errors > > > That's the problem though... I've searched through all the PostgreSQL > directories, and there are no logs that indicate anything. > > Next step is to try this on CentOS as it seems the Windows implementation is > broken or at least I can't seem to get it going (yet). > -- > View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3286312.html > Sent from the PostgreSQL - admin mailing list archive at Nabble.com. > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin
100-eti <100-eti@csc-scc.gc.ca> wrote: > I've searched through all the PostgreSQL directories, and there > are no logs that indicate anything. Have you checked the event viewer for application entries? > Next step is to try this on CentOS as it seems the Windows > implementation is broken or at least I can't seem to get it going > (yet). Did you try starting with pg_ctl with a -l switch? -Kevin
There was no server log anywhere, there were no entries in the Event Viewer (under Application, Security or System) and I ensured the entire directory structure is set to Full Control for the user (and the user is in the local Administrators group)... Nothing other than the service its trying to start, and then it times out. When I used 'pg_ctl start -D ..\Data -U postgres -l ..\Data\pg_log\pglog.log' I get a log file opened, and the "server starting" message in the CMD window, but nothing written to the window, and no active connection in the pgAdmin III window. When I perform a pg_ctl stop it shows "server stopped" but again nothing in the logs... When I do the pg_ctl start ..... I can see the postamster.pid file created, and it gets deleted when I do a pg_ctl stop, but I am still unable to connect to the database using pgAdmin: it never gets created when I start the service in the Service MMC. This is a proof of concept/capability research check only, so I don't care about the platform for the database at this point. If I can get it going on CentOS, that's fine... as long as I can connect to the database with OpenNMS to do my research, its all good. Thanks so far! Roger -- View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3286452.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
Got the CentOS version up and running, but I am going to use the windows version only for the admin client and connect across the network... The last message I got in the Windows install is Error initializing Cluster configuration... This might be a direct cause of the initial problem :-) Roger -- View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p3289586.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
I had the same problem. in my case, I changed the user account to the user who was logged on the local system at the time (which has administrator privileges). I did this by accessing the service properties, Logon tab, as shown: http://postgresql.1045698.n5.nabble.com/file/n4814207/img.png After that, I commanded the startup of the service, which started normally. Hug! -- View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-service-won-t-start-doesn-t-log-any-errors-tp3218164p4814207.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
On Tue, Nov 30, 2010 at 10:37 AM, 100-eti <100-eti@csc-scc.gc.ca> wrote: > > There was no server log anywhere, there were no entries in the Event Viewer > (under Application, Security or System) and I ensured the entire directory > structure is set to Full Control for the user (and the user is in the local > Administrators group)... Nothing other than the service its trying to > start, and then it times out. I think pg might refuse to start if it has the equivalent of root privileges.