Thread: Cannot start the PostgreSQL service

Cannot start the PostgreSQL service

From
David Unsworth
Date:
Hello.  Sorry if I have sent this to too may mail boxes.  I hope one of them is correct.  Please forward this on if not.
 
This was working until recently.  In Services I right clicked on properties and I think I changed the METHOD in pg_hba.conf from md5 to trust.
I think after making this change the problems started.
 
In Services I cannot start the PostgreSQL Server 8.4 due to Error:1069 The service did not start due to a logon failure.
 
I have tried to set up pg_hba.conf correctly.  Currently it is set to the following -
 
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
host    all         all         192.168.1.1/5432      trust
# IPv6 local connections:
host    all         all         ::1/128               trust
 
I have tried to set up pgpass.conf correctly as this was empty.  Currently set to the following -
 
127.0.0.1:5432:*:postgres:dbpass
 
The errors remain.  Also I have been getting the error "could not connect to Server: Connection refused" detailed below -
 
http://www.pgadmin.org/docs/1.14/connect-error.html
 
I wanted to reload the configuration (before attempting to start the Service again ) and I got the error "Reload command returned an error (1)".
 
I am not sure what to try next.  I have some databases I do not want to lose if I can avoid it. 
 
Any ideas?
 
Thanks, Dave.
 
 
 


 

Re: Cannot start the PostgreSQL service

From
Andreas Kretschmer
Date:
David Unsworth <dunswort@hotmail.com> wrote:

>
> This was working until recently.  In Services I right clicked on properties and
> I think I changed the METHOD in pg_hba.conf from md5 to trust.
> I think after making this change the problems started.
>
> In Services I cannot start the PostgreSQL Server 8.4 due to Error:1069 The
> service did not start due to a logon failure.

Server start has nothing to do with pg_hba.conf. And: 8.4 is out of
support.

Is this a Windows-System? I'm guessing you have problems with
anti-virus-software and/or firewall-software and/or wrong
system-user-permissions to start the service.

pg_hba.conf is for client-access, not for startup!


Maybe this here can help you:
http://www.postgresql.org/message-id/F4C27E77F7A33E4CA98C19A9DC6722A2062AD78B@EXCHANGE.corp.perceptron.com
and
http://www.postgresql.org/message-id/4C2940FC.6000108@enterprisedb.com




Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


Re: [ADMIN] Cannot start the PostgreSQL service

From
John Scalia
Date:
The settings in you pg_hba.conf aren't really correct. The second line won't work at all. The max value after the "/" is 32. This is not for the port number. You might wish to search setting a CIDR value, but if you want to allow:

Just 192.168.1.1 then

host          all         all         192.168.1.1/32         trust

If you want all the systems in 192.168.1.x then

host           all        all         192.168.1.0/24        trust

If you want all the systems in 192.168.x.x then

host           all       all          192.168.0.0/16       trust

Hope this helps,
Jay

Sent from my iPad

On Jan 30, 2016, at 10:24 AM, David Unsworth <dunswort@hotmail.com> wrote:

Hello.  Sorry if I have sent this to too may mail boxes.  I hope one of them is correct.  Please forward this on if not.
 
This was working until recently.  In Services I right clicked on properties and I think I changed the METHOD in pg_hba.conf from md5 to trust.
I think after making this change the problems started.
 
In Services I cannot start the PostgreSQL Server 8.4 due to Error:1069 The service did not start due to a logon failure.
 
I have tried to set up pg_hba.conf correctly.  Currently it is set to the following -
 
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
host    all         all         192.168.1.1/5432      trust
# IPv6 local connections:
host    all         all         ::1/128               trust
 
I have tried to set up pgpass.conf correctly as this was empty.  Currently set to the following -
 
127.0.0.1:5432:*:postgres:dbpass
 
The errors remain.  Also I have been getting the error "could not connect to Server: Connection refused" detailed below -
 
http://www.pgadmin.org/docs/1.14/connect-error.html
 
I wanted to reload the configuration (before attempting to start the Service again ) and I got the error "Reload command returned an error (1)".
 
I am not sure what to try next.  I have some databases I do not want to lose if I can avoid it. 
 
Any ideas?
 
Thanks, Dave.
 
 
 


 

Re: Cannot start the PostgreSQL service

From
Adrian Klaver
Date:
On 01/30/2016 08:24 AM, David Unsworth wrote:
> Hello.  Sorry if I have sent this to too may mail boxes.  I hope one of
> them is correct.  Please forward this on if not.

For future reference, sending to --general would be sufficient.

>
> This was working until recently.  In Services I right clicked on
> properties and I think I changed the METHOD in pg_hba.conf from md5 to
> trust.
> I think after making this change the problems started.
>
> In Services I cannot start the PostgreSQL Server 8.4 due to Error:1069
> The service did not start due to a logon failure.

Assuming this is a Windows machine, what version of the OS?

How did you install Postgres on this machine?

What user are you starting the service as?

What if anything happened/changed between the time it was working and
the time it stopped working?

What is in the Postgres log prior to it shutting down?

What is in the system(Windows) logs when you try to start the service?

>
> I have tried to set up pg_hba.conf correctly.  Currently it is set to
> the following -
>
> # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
> # IPv4 local connections:
> host    all         all         127.0.0.1/32          trust
> host    all         all         192.168.1.1/5432      trust
> # IPv6 local connections:
> host    all         all         ::1/128               trust
>
> I have tried to set up pgpass.conf correctly as this was empty.
> Currently set to the following -
>
> 127.0.0.1:5432:*:postgres:dbpass
>
> The errors remain.  Also I have been getting the error "could not
> connect to Server: Connection refused" detailed below -
>
> http://www.pgadmin.org/docs/1.14/connect-error.html
>
> I wanted to reload the configuration (before attempting to start the
> Service again ) and I got the error "Reload command returned an error (1)".
>
> I am not sure what to try next.  I have some databases I do not want to
> lose if I can avoid it.

I doubt you have lost the databases or will lose the databases. You are
just not able to start the server.

>
> Any ideas?
>
> Thanks, Dave.
>
>
>
>
>
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Cannot start the PostgreSQL service

From
Adrian Klaver
Date:
On 01/30/2016 11:01 AM, David Unsworth wrote:
Ccing list, so more eyes can see.

> Hello.  Thanks for the reply.  Here is some more info.
>
> Assuming this is a Windows machine, what version of the OS?
> Windows 7 Home Premium
>
> How did you install Postgres on this machine?
> With Hold'em Manager software many years ago.
>
> What user are you starting the service as?
> Administrator
>
> What if anything happened/changed between the time it was working and
> the time it stopped working?
> Editing pg_hba.conf, right clicking in Services, Properties editing log
> on details.  Service would not start when logging on the next day but
> was okay at the time.

So the was the machine rebooted between the time it worked and the time
it did not or did you just log out and back in?


>
> What is in the Postgres log prior to it shutting down?
> Checked pg_log folder.  Log file from 2012.  Nothing since the problem.

I got to believe there is a newer log file then that.

Is there more then one instance of Postgres on this machine?

>
> What is in the system(Windows) logs when you try to start the service?
> 2016-01-25 18:45:19 GMTFATAL:  the database system is starting up
> 2016-01-27 01:09:47 GMTFATAL:  role "SYSTEM" does not exist
> pg_ctl: PID file "C:/Program Files
> (x86)/PostgreSQL/8.4/data/postmaster.pid" does not exist

So there is an almost two day gap between FATAL errors. There is nothing
else between those messages or immediately prior to the first one?

>
> Previously reported errors -
>
> In Services I cannot start the PostgreSQL Server 8.4 due to Error:1069
> The service did not start due to a logon failure.
>
> I have been getting the error "could not connect to Server: Connection
> refused" detailed below -
>
> http://www.pgadmin.org/docs/1.14/connect-error.html
>
> When trying to reload the configuration (before attempting to start the
> Service again ) and I got the error "Reload command returned an error (1)".
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Cannot start the PostgreSQL service

From
"Igal @ Lucee.org"
Date:
On 1/30/2016 12:06 PM, Adrian Klaver wrote:
> On 01/30/2016 11:01 AM, David Unsworth wrote:
> Ccing list, so more eyes can see.
>
>>
>> Assuming this is a Windows machine, what version of the OS?
>> Windows 7 Home Premium

Did you check the Windows Event Viewer?  When a service fails to start
you should see the details there in the Application log errors.




Re: Cannot start the PostgreSQL service

From
"Igal @ Lucee.org"
Date:
On 1/30/2016 12:10 PM, Igal @ Lucee.org wrote:

Did you check the Windows Event Viewer?  When a service fails to start you should see the details there in the Application log errors.
Sorry, I just realized that you had this:

2016-01-25 18:45:19 GMTFATAL:  the database system is starting up
2016-01-27 01:09:47 GMTFATAL:  role "SYSTEM" does not exist
pg_ctl: PID file "C:/Program Files
(x86)/PostgreSQL/8.4/data/postmaster.pid" does not exist

So you are using PostgreSQL 8.4?  Not sure why you would do that on a development machine (assuming that you're not running production servers on Windows 7 Home)

Looks to me like the issue is that the service is running under the Local System account, which is not recognized by PostgreSQL, and that's why the log shows [role "SYSTEM" does not exist].  If you have installed using the installer then you should probably have a "postgres" account on the machine?  If so, set the service to Log On as that account.

Re: Cannot start the PostgreSQL service

From
Adrian Klaver
Date:
On 01/30/2016 12:33 PM, Igal @ Lucee.org wrote:
> On 1/30/2016 12:10 PM, Igal @ Lucee.org wrote:
>>
>> Did you check the Windows Event Viewer?  When a service fails to start
>> you should see the details there in the Application log errors.
> Sorry, I just realized that you had this:
>
>> 2016-01-25 18:45:19 GMTFATAL:  the database system is starting up
>> 2016-01-27 01:09:47 GMTFATAL: *role "SYSTEM" does not exist *
>> pg_ctl: PID file "C:/Program Files
>> (x86)/PostgreSQL/8.4/data/postmaster.pid" does not exist
>
> So you are using PostgreSQL 8.4?  Not sure why you would do that on a
> development machine (assuming that you're not running production servers
> on Windows 7 Home)

 From a previous post by the OP:

"How did you install Postgres on this machine?
With Hold'em Manager software many years ago.  "

>
> Looks to me like the issue is that the service is running under the
> Local System account, which is not recognized by PostgreSQL, and that's
> why the log shows [role "SYSTEM" does not exist].  If you have installed
> using the installer then you should probably have a "postgres" account
> on the machine?  If so, set the service to Log On as that account.
>


--
Adrian Klaver
adrian.klaver@aklaver.com