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

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.