Nextcloud fails to start after upgrading to Ubuntu 20.04 LTS

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 19.0.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.1): 7.4

The issue you are facing:
After upgrading Ubuntu Server from 18.04 to 20.04 in systemd-nspawn container I am not able to start Nextcloud with the following error message:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Database has been migrated in a following way:

sudo systemctl stop postgresql@10-main
sudo systemctl stop postgresql@12-main
sudo -u postgres pg_dropcluster 12 main
sudo -u postgres pg_upgradecluster 10 main
sudo -u postgres pg_dropcluster 10 main
sudo systemctl start postgresql@12-main

The output of your Nextcloud log in /var/www/nextcloud/data/:

sudo cat nextcloud.log 
{"reqId":"S7B6f8IFMTbp9rGQ9kyN","level":3,"time":"2018-04-27T19:30:33+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"\/nextcloud\/index.php","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\DBALException\",\"Message\":\"Failed to connect to the database: An exception occured in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused\\n\\tIs the server running on host \\\"nc.local\\\" (127.0.1.1) and accepting\\n\\tTCP\\\/IP connections on port 5432?\\ncould not connect to server: Connection refused\\n\\tIs the server running on host \\\"nc.local\\\" (192.168.122.9) and accepting\\n\\tTCP\\\/IP connections on port 5432?\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(429): OC\\\\DB\\\\Connection->connect()\\n#1 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(389): Doctrine\\\\DBAL\\\\Connection->getDatabasePlatformVersion()\\n#2 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(328): Doctrine\\\\DBAL\\\\Connection->detectDatabasePlatform()\\n#3 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(623): Doctrine\\\\DBAL\\\\Connection->getDatabasePlatform()\\n#4 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/Connection.php(151): Doctrine\\\\DBAL\\\\Connection->setTransactionIsolation(2)\\n#5 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DriverManager.php(172): OC\\\\DB\\\\Connection->__construct(Array, Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOPgSql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Configuration), Object(Doctrine\\\\Common\\\\EventManager))\\n#6 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/ConnectionFactory.php(152): Doctrine\\\\DBAL\\\\DriverManager::getConnection(Array, Object(Doctrine\\\\DBAL\\\\Configuration), Object(Doctrine\\\\Common\\\\EventManager))\\n#7 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Setup\\\/AbstractDatabase.php(139): OC\\\\DB\\\\ConnectionFactory->getConnection('pgsql', Array)\\n#8 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Setup\\\/PostgreSQL.php(44): OC\\\\Setup\\\\AbstractDatabase->connect(Array)\\n#9 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Setup.php(340): OC\\\\Setup\\\\PostgreSQL->setupDatabase('admin')\\n#10 \\\/var\\\/www\\\/nextcloud\\\/core\\\/Controller\\\/SetupController.php(66): OC\\\\Setup->install(Array)\\n#11 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/base.php(945): OC\\\\Core\\\\Controller\\\\SetupController->run(Array)\\n#12 \\\/var\\\/www\\\/nextcloud\\\/index.php(37): OC::handleRequest()\\n#13 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/Connection.php\",\"Line\":64}","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko\/20100101 Firefox\/59.0","version":"13.0.1.1"}
{"reqId":"S7B6f8IFMTbp9rGQ9kyN","level":2,"time":"2018-04-27T19:30:33+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"\/nextcloud\/index.php","message":"Error trying to connect as \"postgres\", assuming database is setup and tables need to be created","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko\/20100101 Firefox\/59.0","version":"13.0.1.1"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

/var/www/nextcloud/config$ sudo !!
sudo cat config.php
[sudo] пароль до master: 
<?php
$CONFIG = array (
  'instanceid' => 'somepin',
  'passwordsalt' => 'somepin',
  'secret' => 'somepin',
  'trusted_domains' => 
  array (
    0 => 'nc.ucl.com.ua',
  ),
  'datadirectory' => '/srv/data',
  'overwrite.cli.url' => 'https://nc.ucl.com.ua',
  'dbtype' => 'pgsql',
  'version' => '19.0.0.12',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'somepin',
  'installed' => true,
  'maintenance' => false,
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '10.17.16.29',
  'mail_smtpport' => '25',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'next.cloud@ucl.com.ua',
  'mail_smtppassword' => 'somepin',
  'mail_from_address' => 'noreply',
  'mail_domain' => 'ucl.com.ua',
  'updater.secret' => 'somepin',
);

The output of your Apache/nginx/system log in /var/log/____:

/var/log/apache2$ cat error.log
[Fri Jun 26 06:25:03.433945 2020] [mpm_worker:notice] [pid 188:tid 140694192860096] AH00292: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1 configured -- resuming normal operations
[Fri Jun 26 06:25:03.433979 2020] [core:notice] [pid 188:tid 140694192860096] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jun 26 07:09:19.480406 2020] [access_compat:error] [pid 1593597:tid 140693599123200] [client 95.67.36.140:32522] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Fri Jun 26 08:27:18.745646 2020] [access_compat:error] [pid 1593597:tid 140693582337792] [client 185.191.178.84:49418] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Fri Jun 26 09:13:30.419406 2020] [access_compat:error] [pid 1593597:tid 140693754300160] [client 10.17.16.61:56364] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Fri Jun 26 18:34:48.158224 2020] [access_compat:error] [pid 1593597:tid 140693288756992] [client 95.67.36.140:1672] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Sat Jun 27 01:19:53.746332 2020] [mpm_worker:notice] [pid 188:tid 140694192860096] AH00295: caught SIGTERM, shutting down
[Sat Jun 27 22:46:00.988688 2020] [mpm_worker:notice] [pid 224:tid 140595580869568] AH00292: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1 configured -- resuming normal operations
[Sat Jun 27 22:46:00.988830 2020] [core:notice] [pid 224:tid 140595580869568] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jun 27 22:46:01.045916 2020] [proxy:error] [pid 226:tid 140594470971136] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.sock (*) failed
[Sat Jun 27 22:46:01.045970 2020] [proxy_fcgi:error] [pid 226:tid 140594470971136] [client 62.80.184.245:61128] AH01079: failed to make connection to backend: httpd-UDS
[Sat Jun 27 23:05:40.919289 2020] [proxy:error] [pid 228:tid 140595243144960] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.sock (*) failed
[Sat Jun 27 23:05:40.919333 2020] [proxy_fcgi:error] [pid 228:tid 140595243144960] [client 109.86.87.67:36320] AH01079: failed to make connection to backend: httpd-UDS
[Sat Jun 27 23:11:41.324520 2020] [mpm_worker:notice] [pid 224:tid 140595580869568] AH00295: caught SIGTERM, shutting down
[Sat Jun 27 23:14:27.161772 2020] [mpm_worker:notice] [pid 175:tid 139929604946880] AH00292: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1 configured -- resuming normal operations
[Sat Jun 27 23:14:27.161896 2020] [core:notice] [pid 175:tid 139929604946880] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jun 27 23:48:32.882035 2020] [mpm_worker:notice] [pid 175:tid 139929604946880] AH00295: caught SIGTERM, shutting down
[Sat Jun 27 23:48:33.000184 2020] [mpm_worker:notice] [pid 4245:tid 140085113760832] AH00292: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1 configured -- resuming normal operations
[Sat Jun 27 23:48:33.000330 2020] [core:notice] [pid 4245:tid 140085113760832] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 00:08:50.180514 2020] [mpm_worker:notice] [pid 4245:tid 140085113760832] AH00295: caught SIGTERM, shutting down
[Sun Jun 28 01:05:32.452855 2020] [http2:warn] [pid 65856] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sun Jun 28 01:05:32.488448 2020] [mpm_prefork:notice] [pid 65856] AH00163: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 01:05:32.488491 2020] [core:notice] [pid 65856] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 01:08:02.328075 2020] [mpm_prefork:notice] [pid 65856] AH00171: Graceful restart requested, doing restart
[Sun Jun 28 01:08:02.402037 2020] [http2:warn] [pid 65856] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sun Jun 28 01:08:02.430289 2020] [mpm_prefork:notice] [pid 65856] AH00163: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 01:08:02.430319 2020] [core:notice] [pid 65856] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 01:13:35.202652 2020] [mpm_prefork:notice] [pid 65856] AH00169: caught SIGTERM, shutting down
[Sun Jun 28 01:13:45.439358 2020] [http2:warn] [pid 177] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sun Jun 28 01:13:45.475748 2020] [mpm_prefork:notice] [pid 177] AH00163: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 01:13:45.475789 2020] [core:notice] [pid 177] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 01:14:27.316554 2020] [mpm_prefork:notice] [pid 177] AH00169: caught SIGTERM, shutting down
[Sun Jun 28 01:16:12.159847 2020] [http2:warn] [pid 177] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sun Jun 28 01:16:12.195106 2020] [mpm_prefork:notice] [pid 177] AH00163: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 01:16:12.195150 2020] [core:notice] [pid 177] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 01:32:51.892413 2020] [mpm_prefork:notice] [pid 177] AH00169: caught SIGTERM, shutting down
[Sun Jun 28 01:32:52.020793 2020] [mpm_worker:notice] [pid 1084:tid 140006491343936] AH00292: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 01:32:52.020934 2020] [core:notice] [pid 1084:tid 140006491343936] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 02:04:12.915819 2020] [mpm_worker:notice] [pid 1084:tid 140006491343936] AH00295: caught SIGTERM, shutting down
[Sun Jun 28 02:04:13.034614 2020] [mpm_worker:notice] [pid 2936:tid 140195239836736] AH00292: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 02:04:13.034753 2020] [core:notice] [pid 2936:tid 140195239836736] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 02:05:01.915573 2020] [mpm_worker:notice] [pid 2936:tid 140195239836736] AH00295: caught SIGTERM, shutting down
[Sun Jun 28 02:05:02.032008 2020] [mpm_worker:notice] [pid 3102:tid 140719443049536] AH00292: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 02:05:02.032147 2020] [core:notice] [pid 3102:tid 140719443049536] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 02:05:47.528073 2020] [mpm_worker:notice] [pid 3102:tid 140719443049536] AH00295: caught SIGTERM, shutting down
[Sun Jun 28 02:05:52.497445 2020] [mpm_worker:notice] [pid 155:tid 140005143460928] AH00292: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 02:05:52.497542 2020] [core:notice] [pid 155:tid 140005143460928] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 28 02:07:51.558095 2020] [mpm_worker:notice] [pid 155:tid 140005143460928] AH00295: caught SIGTERM, shutting down
[Sun Jun 28 02:07:51.677945 2020] [mpm_worker:notice] [pid 687:tid 140329450802240] AH00292: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jun 28 02:07:51.678110 2020] [core:notice] [pid 687:tid 140329450802240] AH00094: Command line: '/usr/sbin/apache2'
$ sudo apache2ctl -M
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 fcgid_module (shared)
 filter_module (shared)
 headers_module (shared)
 http2_module (shared)
 mime_module (shared)
 mpm_worker_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_fcgi_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 socache_shmcb_module (shared)
 ssl_module (shared)
 status_module (shared)
/etc/apache2/mods-enabled$ ls -lh
загалом 172K
lrwxrwxrwx 1 root root 36 кві 25  2018 access_compat.load -> ../mods-available/access_compat.load
lrwxrwxrwx 1 root root 30 кві 27  2018 actions.conf -> ../mods-available/actions.conf
lrwxrwxrwx 1 root root 30 кві 27  2018 actions.load -> ../mods-available/actions.load
lrwxrwxrwx 1 root root 28 кві 25  2018 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root 28 кві 25  2018 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root 33 кві 25  2018 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root 33 кві 25  2018 authn_core.load -> ../mods-available/authn_core.load
lrwxrwxrwx 1 root root 33 кві 25  2018 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root 33 кві 25  2018 authz_core.load -> ../mods-available/authz_core.load
lrwxrwxrwx 1 root root 33 кві 25  2018 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root 33 кві 25  2018 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root 32 кві 25  2018 autoindex.conf -> ../mods-available/autoindex.conf
lrwxrwxrwx 1 root root 32 кві 25  2018 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root 30 кві 25  2018 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root 30 кві 25  2018 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root 26 кві 25  2018 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root 26 кві 25  2018 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root 26 кві 25  2018 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root 28 кві 25  2018 fcgid.conf -> ../mods-available/fcgid.conf
lrwxrwxrwx 1 root root 28 кві 25  2018 fcgid.load -> ../mods-available/fcgid.load
lrwxrwxrwx 1 root root 29 кві 25  2018 filter.load -> ../mods-available/filter.load
lrwxrwxrwx 1 root root 30 чер 19  2018 headers.load -> ../mods-available/headers.load
lrwxrwxrwx 1 root root 28 чер 28 02:03 http2.conf -> ../mods-available/http2.conf
lrwxrwxrwx 1 root root 28 лис 20  2019 http2.load -> ../mods-available/http2.load
lrwxrwxrwx 1 root root 27 кві 25  2018 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root 27 кві 25  2018 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root 33 чер 28 01:31 mpm_worker.conf -> ../mods-available/mpm_worker.conf
lrwxrwxrwx 1 root root 33 чер 28 01:31 mpm_worker.load -> ../mods-available/mpm_worker.load
lrwxrwxrwx 1 root root 34 кві 25  2018 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root 34 кві 25  2018 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root 28 кві 27  2018 proxy.conf -> ../mods-available/proxy.conf
lrwxrwxrwx 1 root root 33 кві 27  2018 proxy_fcgi.load -> ../mods-available/proxy_fcgi.load
lrwxrwxrwx 1 root root 28 кві 27  2018 proxy.load -> ../mods-available/proxy.load
lrwxrwxrwx 1 root root 33 лис 21  2019 reqtimeout.conf -> ../mods-available/reqtimeout.conf
lrwxrwxrwx 1 root root 33 лис 21  2019 reqtimeout.load -> ../mods-available/reqtimeout.load
lrwxrwxrwx 1 root root 30 чер 19  2018 rewrite.load -> ../mods-available/rewrite.load
lrwxrwxrwx 1 root root 31 кві 25  2018 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root 31 кві 25  2018 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root 36 чер 19  2018 socache_shmcb.load -> ../mods-available/socache_shmcb.load
lrwxrwxrwx 1 root root 26 чер 19  2018 ssl.conf -> ../mods-available/ssl.conf
lrwxrwxrwx 1 root root 26 чер 19  2018 ssl.load -> ../mods-available/ssl.load
lrwxrwxrwx 1 root root 29 кві 25  2018 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root 29 кві 25  2018 status.load -> ../mods-available/status.load

I am not a user of postgresql. Test with systencrtl the status and with “netstat -tulpen”.

Please check also localhost vs. 127.0.1.1 !!!

What exactly should I check with systemctl ?
‘systemctl list-units | grep fail’ shows nothing, so all units is started.

systemctl status postgresql

Is it up and running?
Check also ip and port with

netstat -tulpen

$ systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sun 2020-06-28 18:22:52 EEST; 3h 24min ago
    Process: 458 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 458 (code=exited, status=0/SUCCESS)

чер 28 18:22:52 nc systemd[1]: Starting PostgreSQL RDBMS...
чер 28 18:22:52 nc systemd[1]: Finished PostgreSQL RDBMS.
$ sudo netstat -tulpen
[sudo] пароль до master: 
Активні з’єднання з інтернетом (only servers)
Прото Надісл Отрим  Локальна адреса Віддалена адреса Стан       Користувацький вузол      PID/Program name    
tcp        0      0 127.0.0.1:6800          0.0.0.0:*               LISTEN      33         11395295   113/aria2c          
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      101        11396109   62/systemd-resolved 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          11388791   140/sshd: /usr/sbin 
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      110        11379377   104/postgres        
tcp6       0      0 :::80                   :::*                    LISTEN      0          11393481   983/apache2         
tcp6       0      0 127.0.0.1:9200          :::*                    LISTEN      112        11379497   114/java            
tcp6       0      0 ::1:9200                :::*                    LISTEN      112        11379496   114/java            
tcp6       0      0 ::1:6800                :::*                    LISTEN      33         11395297   113/aria2c          
tcp6       0      0 127.0.0.1:9300          :::*                    LISTEN      112        11396174   114/java            
tcp6       0      0 ::1:9300                :::*                    LISTEN      112        11396168   114/java            
tcp6       0      0 :::22                   :::*                    LISTEN      0          11388793   140/sshd: /usr/sbin 
tcp6       0      0 ::1:5432                :::*                    LISTEN      110        11379376   104/postgres        
tcp6       0      0 :::443                  :::*                    LISTEN      0          11393485   983/apache2         
udp        0      0 127.0.0.53:53           0.0.0.0:*                           101        11396108   62/systemd-resolved