Synapse – Server Errors by federation

thanks Aleks for your input

tail -n 100 /var/log/postgresql/postgresql-9.6-main.log does not give me anything

root@my:~# tail -n 100 /var/log/postgresql/postgresql-9.6-main.log                                                 
root@my:~#    

Any idea what I can try next? - THANKS

Hm sounds like that’s not the right file to check … Re-reading the previous posts, can you try to :

systemctl restart postgresql@9.6-main.service 
systemctl status  postgresql@9.6-main.service | cat

(notice the | cat at the end of the second command which is a trick to prevent systemctl from truncating the output where the precious info is hiding…)

ok that gives me:

root@my:~# systemctl restart postgresql@9.6-main.service                                                           
Job for postgresql@9.6-main.service failed because the control process exited with error code.                     
See "systemctl status postgresql@9.6-main.service" and "journalctl -xe" for details.                               
root@my:~# systemctl status  postgresql@9.6-main.service | cat                                                     
● postgresql@9.6-main.service - PostgreSQL Cluster 9.6-main                                                        
   Loaded: loaded (/lib/systemd/system/postgresql@.service; disabled; vendor preset: enabled)                      
   Active: failed (Result: exit-code) since Wed 2019-03-06 06:56:33 UTC; 26s ago                                   
  Process: 17352 ExecStart=postgresql@9.6-main --skip-systemctl-redirect 9.6-main start (code=exited, status=1/FAIL
URE)                                                                                                               
                                                                                                                   
Mar 06 06:56:02 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...                                  
Mar 06 06:56:33 my.domain.tdl postgresql@9.6-main[17352]: The PostgreSQL server failed to start. Please check the l
og output.                                                                                                         
Mar 06 06:56:33 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited status=1
Mar 06 06:56:33 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.                             
Mar 06 06:56:33 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.                  
Mar 06 06:56:33 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.             
root@my:~#

What can I do next? THANKS

that how it looks like:

“services”: {
“php7.0-fpm”: “running (enabled)”,
“fail2ban”: “running (enabled)”,
“yunohost-api”: “running (enabled)”,
“mysql”: “running (enabled)”,
“cryptpad”: “running (enabled)”,
“glances”: “running (enabled)”,
“pure-ftpd-ldap”: “running (enabled)”,
“rspamd”: “failed (enabled)”,
“shellinabox”: “running (enabled)”,
“coturn-synapse”: “running (enabled)”,
“avahi-daemon”: “running (enabled)”,
“dovecot”: “running (enabled)”,
“uwsgi”: “running (enabled)”,
“nslcd”: “running (enabled)”,
“nginx”: “running (enabled)”,
“ssh”: “running (enabled)”,
“redis-server”: “failed (enabled)”,
“pleroma”: “running (enabled)”,
“metronome”: “running (enabled)”,
“postfix”: “exited (enabled)”,
“yunohost-firewall”: “exited (enabled)”,
“dnsmasq”: “running (enabled)”,
“matrix-synapse”: “dead (enabled)”,
“slapd”: “running (enabled)”

Please - need help - what shell i do?

Hmm so what does this show ?

ls -thor /var/log/postgresql/
root@my:~# ls -thor /var/log/postgresql/                                                                                              
total 0                                                                                                                               
-rw-r----- 1 root 0 Mar  6 15:15 postgresql-9.6-main.log                                                                              
root@my:~#

Zblerg,

can you try to

systemctl restart postgresql@9.6-main

then “immediately” after

tail -n 100 /var/log/daemon.log

THANKS

here we go:

https://paste.yunohost.org/raw/xaceyesuke

Djeez I don’t understand why this is so complicated to find the actual log / message …

Does journalctl -u postgresql@9.6-main

gives something more detailed ?

root@my:~# journalctl -u postgresql@9.6-main                                                              
-- Logs begin at Thu 2019-03-07 07:26:06 UTC, end at Thu 2019-03-07 19:39:50 UTC. --                      
Mar 07 18:34:47 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...                         
Mar 07 18:35:18 my.domain.tdl postgresql@9.6-main[20117]: The PostgreSQL server failed to start. Please ch
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited
Mar 07 18:35:18 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.         
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.    
lines 1-7/7 (END)
root@my:~# systemctl restart postgresql@9.6-main                                                          
Job for postgresql@9.6-main.service failed because the control process exited with error code.            
See "systemctl status postgresql@9.6-main.service" and "journalctl -xe" for details.                      
root@my:~# journalctl -u postgresql@9.6-main                                                              
-- Logs begin at Thu 2019-03-07 07:26:06 UTC, end at Thu 2019-03-07 19:46:11 UTC. --                      
Mar 07 18:34:47 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...                         
Mar 07 18:35:18 my.domain.tdl postgresql@9.6-main[20117]: The PostgreSQL server failed to start. Please ch
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited
Mar 07 18:35:18 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.         
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.    
Mar 07 19:45:29 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...                         
Mar 07 19:46:00 my.domain.tdl postgresql@9.6-main[21072]: The PostgreSQL server failed to start. Please ch
Mar 07 19:46:00 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited
Mar 07 19:46:00 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.
Mar 07 19:46:00 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.         
Mar 07 19:46:00 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.    
lines 1-13/13 (END)

I´m totally lost…

Alex – do you have any idea what could go on?

I don’t want to stress your time to much … do you think it is better to do a reinstall?

Meeeh, I don’t understand why this is so complicated to find the appropriate log file … Yet it would be useful to know this for the future :confused: Also I don’t think reinstalling the app is gonna solve this …

Anyway … What about if you do :

systemctl restart postgresql@9.6-main  # Just to retrigger the error

then

ls -thor /var/log | tail -n 10

Thanks Aleks

root@my:~# systemctl restart postgresql@9.6-main  # Just to retrigger the error                                           
Job for postgresql@9.6-main.service failed because the control process exited with error code.                            
See "systemctl status postgresql@9.6-main.service" and "journalctl -xe" for details.                                      
root@my:~# ls -thor /var/log | tail -n 10                                                                                 
-rw-r----- 1 root 244K Mar  8 00:26 mail.warn                                                                             
-rw-r----- 1 root  13K Mar  8 00:29 mail.log                                                                              
-rw-r----- 1 root 861K Mar  8 00:29 mail.info                                                                             
-rw-r----- 1 root 8.5K Mar  8 00:32 debug                                                                                 
-rw-r----- 1 root  24K Mar  8 00:32 fail2ban.log                                                                          
-rw-rw-r-- 1 root 1.9K Mar  8 01:00 wtmp                                                                                  
-rw-rw-r-- 1 root  292 Mar  8 01:00 lastlog                                                                               
-rw-r----- 1 root 264K Mar  8 01:00 auth.log                                                                              
-rw-r----- 1 root  13M Mar  8 01:03 syslog                                                                                
-rw-r----- 1 root  13M Mar  8 01:03 daemon.log                                                                            
root@my:~#

Okay let’s do this another way …

What does this shows ?

/usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/postgresql.conf

1 Like
root@my:~# /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/po
stgresql.conf                                                                                                             
"root" execution of the PostgreSQL server is not permitted.                                                               
The server must be started under an unprivileged user ID to prevent                                                       
possible system security compromise.  See the documentation for                                                           
more information on how to properly start the server.                                                                     
root@my:~#             

You know i had trouble with root and admin privileges on my armbian/Yunohost/ cubietruck image based system during the the yunohost installation in the first place – did the last updates change anything in this diction dealing with PostgreSQL?

admin@my:~$ /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/p
ostgresql.conf                                                                                                            
LOG:  skipping missing configuration file "/var/lib/postgresql/9.6/main/postgresql.auto.conf"                             
2019-03-08 07:14:43.302 UTC [29577] FATAL:  data directory "/var/lib/postgresql/9.6/main" has wrong ownership             
2019-03-08 07:14:43.302 UTC [29577] HINT:  The server must be started by the user that owns the data directory.           
admin@my:~$

And what is the result of tail -n 20 /var/log/postgresql/postgresql-9.6-main.log ?

root@my:~# tail -n 20 /var/log/postgresql/postgresql-9.6-main.log                                          
root@my:~#