Nextcloud installation: Error while trying to create admin user on Synology Running DSM 6.2.3

Hello,

Trying to install NC 19.0.1 on DSM v6.2.3 and keep getting an error at the initial configuration page after entering all the correct info. Running Apache 2.4. MariaDB 10 and PHP 7.3 through web station on the Synology NAS DS411+ II and DS918+. The initial webpage comes up with no issues but fails every time with a connection refused error after inputting all the correct details. Any ideas from anyone with the same issueā€¦have tried on 2 different Synology devices with the exact same error.

Looks like the DB is refusing the connection but no idea how to correct despite using 127.0.0.1:3307. I can login to PHPmyadmin with root with no issues using password. I even went into nextcloud/config config.php and added ā€˜allow_local_remote_serversā€™ => true, and no change. Please see the error below after clicking OK and the log. Rookie here so please be gentle :slight_smile: Thanks for any help.

ā€œError while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refusedā€

ā€œreqIdā€:ā€œRKczOA0TWJt4Y9HMb8qgā€,ā€œlevelā€:3,ā€œtimeā€:ā€œ2020-07-18T10:38:11+00:00ā€,ā€œremoteAddrā€:ā€œ192.168.0.10ā€,ā€œuserā€:"ā€“",ā€œappā€:ā€œPHPā€,ā€œmethodā€:ā€œPOSTā€,ā€œurlā€:"/nextcloud/index.php",ā€œmessageā€:ā€œsession_start(): A session had already been started - ignoring at /volume1/web/nextcloud/lib/private/Session/Internal.php#209ā€,ā€œuserAgentā€:ā€œMozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0ā€,ā€œversionā€:ā€œ19.0.1.1ā€}
{ā€œreqIdā€:ā€œRKczOA0TWJt4Y9HMb8qgā€,ā€œlevelā€:2,ā€œtimeā€:ā€œ2020-07-18T10:38:11+00:00ā€,ā€œremoteAddrā€:ā€œ192.168.0.10ā€,ā€œuserā€:"ā€“",ā€œappā€:ā€œno app in contextā€,ā€œmethodā€:ā€œPOSTā€,ā€œurlā€:"/nextcloud/index.php",ā€œmessageā€:ā€œHost 192.168.0.32 was not connected to because it violates local access rulesā€,ā€œuserAgentā€:ā€œMozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0ā€,ā€œversionā€:ā€œ19.0.1.1ā€}
{ā€œreqIdā€:ā€œRKczOA0TWJt4Y9HMb8qgā€,ā€œlevelā€:2,ā€œtimeā€:ā€œ2020-07-18T10:38:11+00:00ā€,ā€œremoteAddrā€:ā€œ192.168.0.10ā€,ā€œuserā€:"ā€“",ā€œappā€:ā€œno app in contextā€,ā€œmethodā€:ā€œPOSTā€,ā€œurlā€:"/nextcloud/index.php",ā€œmessageā€:ā€œHost 192.168.0.32 was not connected to because it violates local access rulesā€,ā€œuserAgentā€:ā€œMozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0ā€,ā€œversionā€:ā€œ19.0.1.1ā€}
{ā€œreqIdā€:ā€œRKczOA0TWJt4Y9HMb8qgā€,ā€œlevelā€:3,ā€œtimeā€:ā€œ2020-07-18T10:38:11+00:00ā€,ā€œremoteAddrā€:ā€œ192.168.0.10ā€,ā€œuserā€:"ā€“",ā€œappā€:ā€œjsresourceloaderā€,ā€œmethodā€:ā€œPOSTā€,ā€œurlā€:"/nextcloud/index.php",ā€œmessageā€:ā€œCould not find resource js/setup.js to loadā€,ā€œuserAgentā€:ā€œMozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0ā€,ā€œversionā€:ā€œ19.0.1.1ā€}

SUCCESS

I found that it is indeed Synology settings that was causing the problem. In the Web Station app on the Synology, open the PHP settings for your preferred PHP version. There are extensions and look for mysqli.default_socket and use the value in that field. I ended up having to use the entry below to get by the install screen and the server now runs with MariaDB 10

localhost:/run/mysqld/mysqld10.sock

try this instead if the above doesnā€™t work

localhost:/run/mysqld/mysqld.sock

Go into your PHP settings for 7.3 and double check your mysqli.default_socket settingā€¦should be what Iā€™ve typed above if youā€™re on the latest dsm software and up to date on all the packages for php 7.3/web station and mariadb 10

1 Like

Thanks Matkinson !! I was struggling since days to fix an issue about installing NC on a Synology and your trick made the thing work !!!

No problem. Do the below as well to stop error 504 which is a timeout error. Got this from a 2nd level synology tech. Not even in their knowledgebaseā€¦go figure :slight_smile:)

Please check out the following code, This might help:

If virtual host http backend server is Nginx:
Add fastcgi_read_timeout 3600s; into /etc/nginx/fastcgi.conf (Replace 3600s with desired time; in seconds)

If virtual host HTTP backend server is Apache 2.2/Apache 2.4:
Modify /var/packages/WebStation/target/misc/VirtualHost-nginx.mustache, and find these 2 blocks:

{{#apache22}}
include proxy.conf;
proxy_read_timeout 3600s; <-- Add this line
location / {
proxy_pass http://{{listen}};
}
{{/apache22}}

{{#apache24}}
include proxy.conf;
proxy_read_timeout 3600s; <-- Add this line
location / {
proxy_pass http://{{listen}};
}
{{/apache24}}

Then, add proxy_read_timeout 3600s; after include proxy.conf; and restart WebStation (or reboot).

If the default HTTP backend server is Apache 2.4:
Add /usr/local/etc/apache24/sites-enabled/user.conf with the content below:

TimeOut 300
ProxyTimeout 300

Then, run reload pkg-apache24 to load the new setting. This change applies to both vhosts and default web server.

1 Like

Thanks for this thread! It helped me!

thanks so much,
the problem wad indeed the socket and the instructions manuals found on the net never mention this problem.

you made my day !