Thread: BUG #16261: Not able to start Postgres
The following bug has been logged on the website: Bug reference: 16261 Logged by: Abhishree Nagesh Email address: abhishreehn@crgroup.co.in PostgreSQL version: 9.6.11 Operating system: linux Description: Jira the atlassian application is connected to Postgressql. After restarting the server we're unable to start postgresql service. But the application is up but gives the error page as unable to connect to datatbase. FOllowing is the error we are facing. Kindly look into that hence its production. [root@ip-172-22-36-169 ~]# systemctl status postgresql-9.6.service ● postgresql-9.6.service - SYSV: PostgreSQL database server. Loaded: loaded (/etc/rc.d/init.d/postgresql-9.6; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2020-02-17 10:01:51 UTC; 18s ago Docs: man:systemd-sysv-generator(8) Process: 750 ExecStart=/etc/rc.d/init.d/postgresql-9.6 start (code=exited, status=1/FAILURE) Feb 17 10:01:49 ip-172-22-36-169.ap-south-1.compute.internal systemd[1]: Starting SYSV: PostgreSQL database server.... Feb 17 10:01:51 ip-172-22-36-169.ap-south-1.compute.internal postgresql-9.6[750]: Starting postgresql-9.6 service: [FAILED] Feb 17 10:01:51 ip-172-22-36-169.ap-south-1.compute.internal systemd[1]: postgresql-9.6.service: control process exited, code=exited status=1 Feb 17 10:01:51 ip-172-22-36-169.ap-south-1.compute.internal systemd[1]: Failed to start SYSV: PostgreSQL database server.. Feb 17 10:01:51 ip-172-22-36-169.ap-south-1.compute.internal systemd[1]: Unit postgresql-9.6.service entered failed state. Feb 17 10:01:51 ip-172-22-36-169.ap-south-1.compute.internal systemd[1]: postgresql-9.6.service failed. [root@ip-172-22-36-169 ~]#
> On 17 Feb 2020, at 12:23, PG Bug reporting form <noreply@postgresql.org> wrote: > FOllowing is the error we are facing. The log snippet provided doesn't seem to provide too many clues, could you paste the relevant section from the postgres logs? cheers ./daniel
> On 17 Feb 2020, at 13:29, Abhishree hn <abhishreehn@crgroup.co.in> wrote: > > Hi Daniel, > > please find the logs below. Please retain all addresses in your reply. > The files belonging to this database system will be owned by user "postgres". > This user must also own the server process. > > The database cluster will be initialized with locale "en_US.UTF-8". > The default database encoding has accordingly been set to "UTF8". > The default text search configuration will be set to "english". > > Data page checksums are disabled. > > fixing permissions on existing directory /var/lib/pgsql/9.6/data ... ok > creating subdirectories ... ok > selecting default max_connections ... 100 > selecting default shared_buffers ... 128MB > selecting dynamic shared memory implementation ... posix > creating configuration files ... ok > running bootstrap script ... ok > performing post-bootstrap initialization ... ok > syncing data to disk ... ok > > Success. You can now start the database server using: > > /usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/9.6/data -l logfile start > > < 2018-11-02 19:13:03.637 UTC > LOG: redirecting log output to logging collector process > < 2018-11-02 19:13:03.637 UTC > HINT: Future log output will appear in directory "pg_log". > < 2018-11-02 19:31:50.580 UTC > LOG: redirecting log output to logging collector process > < 2018-11-02 19:31:50.580 UTC > HINT: Future log output will appear in directory "pg_log". > < 2018-11-02 19:35:07.110 UTC > LOG: redirecting log output to logging collector process > < 2018-11-02 19:35:07.110 UTC > HINT: Future log output will appear in directory "pg_log". > < 2018-12-04 10:59:50.478 UTC > FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such fileor directory > < 2018-12-04 10:59:50.478 UTC > LOG: database system is shut down This log entry might be related to the database not starting. Does that directory exist and if so, is it writeable by the process? cheers ./daniel
> On 17 Feb 2020, at 14:17, Abhishree hn <abhishreehn@crgroup.co.in> wrote: > > Hi Daniel, > > There is no such directory exist. That's quite likely a contributing factor to the problems you're facing. Either reconfigure to use an alternative directory or make sure this one exists and is writeable. > On Mon, Feb 17, 2020 at 6:46 PM Daniel Gustafsson <daniel@yesql.se> wrote: > > On 17 Feb 2020, at 14:10, Abhishree hn <abhishreehn@crgroup.co.in> wrote: > > > > Hi , > > Yes, We are not able to start the database. > > can you please tell me which directory exitance you are talking about? > > The logs you posted show it in full detail: /var/run/postgresql/.s.PGSQL.5432.lock