0

I'm handling a strange problem with one installation of PostgreSQL 10.4. One of the databases instances of PostgreSQL have stopped working after 7 months without issues. When this guy saw that the database wasn't respoding, tried to restart the database and de OS but it did'nt work.

So, I started to view the logs and found nothing, only the shutdown statements no postgresql_20190208.log

2019-02-08 16:24:07.749 -02 [12878] LOG:  could not receive data from client: Connection reset by peer
2019-02-08 16:30:59.421 -02 [27180] LOG:  received fast shutdown request
2019-02-08 16:30:59.422 -02 [27180] LOG:  aborting any active transactions
2019-02-08 16:30:59.422 -02 [44204] FATAL:  terminating connection due to administrator command
2019-02-08 16:30:59.422 -02 [13796] FATAL:  terminating autovacuum process due to administrator command
2019-02-08 16:30:59.422 -02 [95589] FATAL:  terminating connection due to administrator command

OK, when I have checked the startup.log I found:

2019-02-08 16:31:00.861 -02 [13815] FATAL:  could not access file "": No such file or directory
2019-02-08 16:31:00.861 -02 [13815] LOG:  database system is shut down

I have never seen this before. I would expect that the message shows me the file with problem or something that exposes some data corrupt, but and empty file address doesn't help that much.

So, I tried to startup the database by myself

postgres -D datadir/ -d 5 ;
2019-02-08 22:39:19.010 -02 [45971] DEBUG:  postgres: PostmasterMain: initial environment dump:
[some envirounment variables]
2019-02-08 22:39:19.011 -02 [45971] DEBUG:  registering background worker "logical replication launcher"
2019-02-08 22:39:19.011 -02 [45971] DEBUG: find_in_dynamic_libpath: trying "/banco/PostgreSQL/10/lib/postgresql/"
2019-02-08 22:39:19.011 -02 [45971] DEBUG: find_in_dynamic_libpath: trying "/banco/PostgreSQL/10/lib/postgresql/.so"
2019-02-08 22:39:19.011 -02 [45971] FATAL:  could not access file "": No such file or directory
2019-02-08 22:39:19.011 -02 [45971] DEBUG:  shmem_exit(1): 0 before_shmem_exit callbacks to make
2019-02-08 22:39:19.011 -02 [45971] DEBUG:  shmem_exit(1): 0 on_shmem_exit callbacks to make
2019-02-08 22:39:19.011 -02 [45971] DEBUG:  proc_exit(1): 1 callbacks to make
2019-⁠02-⁠08 22:39:19.011 -⁠02 [45971] LOG:  database system is shut down
2019-⁠02-⁠08 22:39:19.011 -⁠02 [45971] DEBUG:  exit(1)
2019-02-08 22:39:19.011 -02 [45971] DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2019-02-08 22:39:19.011 -02 [45971] DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2019-02-08 22:39:19.011 -02 [45971] DEBUG:  proc_exit(-1): 0 callbacks to make

After seen that I have thought: May be the postgresql installation have corrupted. So, I have done a backup of data folder and run initdb command to test and it have worked.

Some of you have seen that happen? I'm trying another strategy that reinstall the entire postgres and just copy the data folder to see if it work. If it doesn't, I'll restore the yesterday backup

Have you guys know what may be the cause of it ?

2
  • Have you checked /var/lig/audit.lig or disabling selinux if it exists?
    – davidgo
    Commented Feb 9, 2019 at 10:36
  • The first thing I have checked and se linux was disabled.
    – user1695
    Commented Feb 10, 2019 at 16:30

1 Answer 1

0

These lines stands out:

2019-02-08 22:39:19.011 -02 [45971] DEBUG: find_in_dynamic_libpath: trying "/banco/PostgreSQL/10/lib/postgresql/"
2019-02-08 22:39:19.011 -02 [45971] DEBUG: find_in_dynamic_libpath: trying "/banco/PostgreSQL/10/lib/postgresql/.so"
2019-02-08 22:39:19.011 -02 [45971] FATAL:  could not access file "": No such file or directory

It says that postgresql.conf is asking to load a shared library with an empty file name. This could happen with a declaration like this, for instance:

shared_preload_libraries = '""'

Testing this declaration on my self-compiled instance:

2019-02-09 18:42:13 CET  DEBUG:  registering background worker "logical replication launcher"
2019-02-09 18:42:13 CET  DEBUG:  find_in_dynamic_libpath: trying "/usr/local/pgsql/lib/"
2019-02-09 18:42:13 CET  DEBUG:  find_in_dynamic_libpath: trying "/usr/local/pgsql/lib/.so"
2019-02-09 18:42:13 CET  FATAL:  could not access file "": Aucun fichier ou dossier de ce type
2019-02-09 18:42:13 CET  DEBUG:  shmem_exit(1): 0 before_shmem_exit callbacks to make
2019-02-09 18:42:13 CET  DEBUG:  shmem_exit(1): 0 on_shmem_exit callbacks to make
2019-02-09 18:42:13 CET  DEBUG:  proc_exit(1): 1 callbacks to make
2019-02-09 18:42:13 CET  LOG:  database system is shut down
2019-02-09 18:42:13 CET  DEBUG:  exit(1)

Same outcome as yours except your $libdir appears to be /banco/PostgreSQL/10/lib/postgresql/.

3
  • I read your answser and stopped everything to check my postresql.conf and The line is commented. I don't know how to check The value of $libdir. May it define in some where?
    – user1695
    Commented Feb 10, 2019 at 16:28
  • @user1695: the parameter may be in another file. ALTER SYSTEM writes into postgresql.auto.conf and include and include_dir might also point to other files. Commented Feb 11, 2019 at 15:17
  • Hi guy, You are right. I found that line and, after removed, i could recover the data. Thank you!
    – user1695
    Commented Feb 11, 2019 at 20:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .