PHP-Error in Server-Log and temporarily server-downtime 2 or 3 times a day

Sorry to hear you’re facing problems :slight_frown:

If you’re urgently looking for support to keep your business running, consider checking out our paid support options.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the following as you can (you can cut and paste this into your topic):


Nextcloud version (eg, 10.0.2): 11.0.2
Operating system and version (eg, Ubuntu 16.04): Ubuntu-Server 16.04 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.18
PHP version (eg, 5.6): 7.0.15
Is this the first time you’ve seen this error?: No, it is not the first time, it happened a few times this week…

Can you reliably replicate it? (If so, please outline steps): No, I am not able to replicate it, it is a temporarily error, that happens a few times a day.

The issue you are facing:
My Nextcloud is not available during a few minutes, when this error appears. This happens a few times a day.

The output of your Nextcloud log in Admin > Logging:

Error PHP PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php#43

Error PHP Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known at /var/www/nextcloud/lib/private/DB/Connection.php#60

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

<?php $CONFIG = array ( 'instanceid' => 'xxxxx', 'passwordsalt' => 'xxxxxxx', 'secret' => 'xxxxxxxxxx', 'trusted_domains' => array ( 0 => 'xxxxxx', 1 => 'xxxxxxx', 2 => 'xxxxxxxx', 3 => 'xxxxxxxxxx', ), 'datadirectory' => '/backup/data', 'overwrite.cli.url' => 'https://xxxxxxxxxxxx/owncloud', 'dbtype' => 'mysql', 'version' => '11.0.2.7', 'dbname' => 'xxxxxxxxxx', 'dbhost' => 'xxxxxxxxxxxx', 'dbtableprefix' => 'oc_', 'dbuser' => 'owncloud', 'dbpassword' => 'xxxxxxxxxxxx', 'logtimezone' => 'UTC', 'installed' => true, 'loglevel' => 2, 'mail_smtpmode' => 'smtp', 'mail_from_address' => 'xxxxxxxxx', 'mail_domain' => 'xxxxxxxxxx', 'mail_smtphost' => '192.168.110.7', 'mail_smtpport' => '25', 'theme' => '', 'maintenance' => false, 'memcache.local' => '\\OC\\Memcache\\APCu', ); The output of your Apache/nginx/system log in `/var/log/____`: [Fri Apr 21 00:15:42.944333 2017] [ssl:warn] [pid 1675] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name [Fri Apr 21 00:15:42.944522 2017] [mpm_prefork:notice] [pid 1675] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations [Fri Apr 21 00:15:42.944532 2017] [core:notice] [pid 1675] AH00094: Command line: '/usr/sbin/apache2' [Fri Apr 21 00:25:38.238844 2017] [mpm_prefork:notice] [pid 1675] AH00169: caught SIGTERM, shutting down [Fri Apr 21 00:30:04.516191 2017] [ssl:warn] [pid 1706] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name [Fri Apr 21 00:30:05.251826 2017] [ssl:warn] [pid 1711] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name [Fri Apr 21 00:30:05.256067 2017] [mpm_prefork:notice] [pid 1711] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations [Fri Apr 21 00:30:05.256093 2017] [core:notice] [pid 1711] AH00094: Command line: '/usr/sbin/apache2' --- Remember, this information may be requested if it isn't supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

From reading the output it looks to me that it has difficulty to connect to the database. Are you using a hostname or an IP address? It might have problems (on those moments) to resolve the database hostname.

Hello StephanW,

thank you very much for your reply,

I am using the hostname of the database-server. I will try to use the IP-Address directly, so the server has not to resolve the hostname.

Do you have any idea, how I should repair the second error?
Error PHP PDO::_construct(): phpnetwork_getaddresses: getaddrinfo failed: Name or service not known at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php#43

Thank you in advance

Most likely that is linked to the same issue that is has problems resolving the name, to get the actual address information.

Thank you very much, StephanW, I think, entering the IP-Address solved my problem, because this kind of logs didn’t appear since my entry on current day in the morning.

Do I am allowed to ask another short question or do I have to open a new topic to do this?

This problem doesn’t have influence on the runlevel of my nextcloud-server, but it would be fine to solve it: In my log this error-entry appears a few times a day:

Error PHP Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:806 Stack trace: #0 /var/www/nextcloud/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath(’/xxxxx/files/!..’) #1 /var/www/nextcloud/lib/private/Files/View.php(1156): OC\Files\View->unlockFile(’/!xxxxx…’, 1) #2 [internal function]: OC\Files\View->OC\Files{closure}() #3 /var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown at /var/www/nextcloud/lib/private/Files/Filesystem.php#806

What could be the reason for this log, I just don’t have a clue…

Thank you very much for your help…

That looks to me a script error. Not sure what that would cause. I would create a new case, and maybe even a Git issue for this.