Score:0

Apache error running the pgadmin4

in flag

Suddenly my pgadmin4 web version crashed. After I tried sudo systemctl restart apache2.service I received following error:

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

So I checked for output of sudo journalctl -xe:

дец 15 14:59:53 stepski sudo[33694]:  stepski : TTY=pts/1 ; PWD=/home/stepski ; USER=root ; COMMAND=/usr/bin/systemctl restart apach>
дец 15 14:59:53 stepski sudo[33694]: pam_unix(sudo:session): session opened for user root by stepski(uid=0)
дец 15 14:59:53 stepski systemd[1]: Starting The Apache HTTP Server...
-- Subject: A start job for unit apache2.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit apache2.service has begun execution.
-- 
-- The job identifier is 4004.
дец 15 14:59:53 stepski apachectl[33700]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, u>
дец 15 14:59:53 stepski apachectl[33700]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for mai>
дец 15 14:59:53 stepski apachectl[33700]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for err>
дец 15 14:59:53 stepski apachectl[33700]: AH00014: Configuration check failed
дец 15 14:59:53 stepski apachectl[33697]: Action 'start' failed.
дец 15 14:59:53 stepski apachectl[33697]: The Apache error log may have more information.
дец 15 14:59:53 stepski systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit apache2.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
дец 15 14:59:53 stepski systemd[1]: apache2.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit apache2.service has entered the 'failed' state with result 'exit-code'.
дец 15 14:59:53 stepski systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: A start job for unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit apache2.service has finished with a failure.
-- 
-- The job identifier is 4004 and the job result is failed.
дец 15 14:59:53 stepski sudo[33694]: pam_unix(sudo:session): session closed for user root
дец 15 15:02:02 stepski sudo[33818]:  stepski : TTY=pts/1 ; PWD=/home/stepski ; USER=root ; COMMAND=/usr/bin/journalctl -xe
дец 15 15:02:02 stepski sudo[33818]: pam_unix(sudo:session): session opened for user root by stepski(uid=0)

Output of postgresql-14-main.log

cat /var/log/postgresql/postgresql-14-main.log

2021-12-15 10:20:12.615 CET [1027] LOG:  starting PostgreSQL 14.1 (Ubuntu 14.1-2.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
2021-12-15 10:20:12.615 CET [1027] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2021-12-15 10:20:12.616 CET [1027] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-12-15 10:20:12.622 CET [1032] LOG:  database system was shut down at 2021-12-15 00:04:08 CET
2021-12-15 10:20:12.629 CET [1027] LOG:  database system is ready to accept connections
2021-12-15 15:08:08.675 CET [32762] postgres@wine_rec LOG:  could not receive data from client: Connection reset by peer
2021-12-15 15:08:08.675 CET [32773] postgres@wines LOG:  could not receive data from client: Connection reset by peer
2021-12-15 15:08:08.675 CET [32731] postgres@postgres LOG:  could not receive data from client: Connection reset by peer

Can you spot a problem, and help me fix it? PC is running on Ubuntu 20.04 LTS

in flag
Could you [edit] your question to include some of the more recent lines in `/var/log/apache2/error.log`? It's in there that the specific error message(s) will be recorded
stepski011 avatar
in flag
@matigo there is no directory called apache 2 in log files, however I added the cat /var/log/postgresql/postgresql-14-main.log
in flag
That's what I get for asking questions late at night while doing some debugging of my own. Asked for the wrong log file ...
in flag
Have you restarted PostgreSQL? Generally a "could not receive data from client: Connection reset by peer" message means the client (pgadmin4, in this case) disconnected without closing the session. It may be trying to connect with the same session as before but, if that data has been released or corrupted, then any further attempts to connect may fail. Restarting the database engine will flush any caches and sessions, which may resolve your issue
stepski011 avatar
in flag
Good idea, but after sudo systemctl restart postgresql, the attempt for restarting apache2.service fails once again with same errors
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.