docker icon indicating copy to clipboard operation
docker copied to clipboard

Started a brand-new docker image; get error when trying to access it

Open amca01 opened this issue 2 years ago • 2 comments

Because I completely wrecked my Nextcloud/Docker by stupidly trying to upgrade beyond a single version difference (I should have known better) I thought I'd completely remove Nextcloud from my system and start afresh, Which I did, with the apache version 23.0.0, and using traefik as my reverse proxy. This worked well for me in the past.

But now, when I attempt to access Nextcloud remotely, I do at least get a Nextcloud screen, but unfortunately just one which tells me that "The server was unable to complete your request.", and that "More details can be found in the server log.", and I should contact the network administrator. Well, that's me (this is all running on a VPS). Although I've been running this VPS for years, I normally just start up a few things I need and forget about them. So my network-admin abilities are very meagre.

But does this error mean I have to enter the Docker container and ferret about in the apache server log? I imagine that would be the only server of which Nextcloud is aware, so to speak. I have in fact tried to do that, entering the running docker container as root and checking out the /var/log/apache2 directory. But my attempts to view any of error.log or access.log (with any of cat, more, tail) produce nothing: just blankness, which I have to Ctrl-C out from. So if the files are there, I can't find a way of looking at them

Anyway, I've followed all the instructions, and included the values for the mysql passwords, and I've reached an impasse.

I'm mighty confused here. When I set up my initial Nextcloud/Docker container some years ago it just sort of worked. I know my description above is vague, but might anybody have a pointer about what I should look for and where?

amca01 avatar Dec 05 '21 06:12 amca01

Same here, but I am using postgres. I attached logs of both docker containers (app + postgres).

$ docker logs nextcloud_app
Configuring Redis as session handler
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.64.4. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.64.4. Set the 'ServerName' directive globally to suppress this message
[Sat Dec 11 08:55:00.412691 2021] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.51 (Debian) PHP/8.0.13 configured -- resuming normal operations
[Sat Dec 11 08:55:00.412731 2021] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Sat Dec 11 08:57:55.387534 2021] [php:notice] [pid 41] [client 91.169.219.78:0] {"reqId":"oUBigMXF4U5bqLX3Pm13","level":3,"time":"2021-12-11T08:57:55+00:00","remoteAddr":"91.169.219.78","user":"--","app":"index","method":"GET","url":"/","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL:  password authentication failed for user \\"oc_admin6\\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15","version":"22.2.3.0","exception":{"Exception":"OC\\\\DB\\\\Exceptions\\\\DbalException","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL:  password authentication failed for user \\"oc_admin6\\"","Code":7,"Trace":[{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":59,"function":"wrap","class":"OC\\\\DB\\\\Exceptions\\\\DbalException","type":"::","args":[{"__class__":"Doctrine\\\\DBAL\\\\Exception"}]},{"file":"/var/www/html/lib/private/legacy/OC_DB.php","line":55,"function":"prepare","class":"OC\\\\DB\\\\ConnectionAdapter","type":"->","args":["SHOW SERVER_VERSION",null,null]},{"file":"/var/www/html/lib/private/legacy/OC_DB.php","line":128,"function":"prepare","class":"OC_DB","type":"::","args":["SHOW SERVER_VERSION",null,null]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":971,"function":"executeAudited","class":"OC_DB","type":"::","args":[{"sql":"SHOW SERVER_VERSION","limit":null,"offset":null}]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":951,"function":"checkDatabaseVersion","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":656,"function":"checkServer","class":"OC_Util","type":"::","args":[{"__class__":"OC\\\\SystemConfig"}]},{"file":"/var/www/html/lib/base.php","line":1089,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/index.php","line":34,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/DB/Exceptions/DbalException.php","Line":71,"Previous":{"Exception":"Doctrine\\\\DBAL\\\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL:  password authentication failed for user \\"oc_admin6\\"","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1519,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->","args":[]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Statement.php","line":73,"function":"getWrappedConnection","class":"Doctrine\\\\DBAL\\\\Connection","type":"->","args":[]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1016,"function":"__construct","class":"Doctrine\\\\DBAL\\\\Statement","type":"->","args":["SHOW SERVER_VERSION",{"__class__":"OC\\\\DB\\\\Connection"}]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":214,"function":"prepare","class":"Doctrine\\\\DBAL\\\\Connection","type":"->","args":["SHOW SERVER_VERSION"]},{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":56,"function":"prepare","class":"OC\\\\DB\\\\Connection","type":"->","args":["SHOW SERVER_VERSION",null,null]},{"file":"/var/www/html/lib/private/legacy/OC_DB.php","line":55,"function":"prepare","class":"OC\\\\DB\\\\ConnectionAdapter","type":"->","args":["SHOW SERVER_VERSION",null,null]},{"file":"/var/www/html/lib/private/legacy/OC_DB.php","line":128,"function":"prepare","class":"OC_DB","type":"::","args":["SHOW SERVER_VERSION",null,null]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":971,"function":"executeAudited","class":"OC_DB","type":"::","args":[{"sql":"SHOW SERVER_VERSION","limit":null,"offset":null}]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":951,"function":"checkDatabaseVersion","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":656,"function":"checkServer","class":"OC_Util","type":"::","args":[{"__class__":"OC\\\\SystemConfig"}]},{"file":"/var/www/html/lib/base.php","line":1089,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/index.php","line":34,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/DB/Connection.php","Line":87},"CustomMessage":"--"}}
91.169.219.78 - - [11/Dec/2021:08:57:55 +0000] "GET / HTTP/1.1" 500 3735 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"
91.169.219.78 - - [11/Dec/2021:08:57:55 +0000] "GET /core/css/guest.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 6135 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"
91.169.219.78 - - [11/Dec/2021:08:57:55 +0000] "GET /core/js/dist/main.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 480473 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"
91.169.219.78 - - [11/Dec/2021:08:57:55 +0000] "GET /core/img/background.png?v=2 HTTP/1.1" 200 10099 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"
91.169.219.78 - - [11/Dec/2021:08:57:55 +0000] "GET /core/img/logo/logo.svg?v=1 HTTP/1.1" 200 801 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"
91.169.219.78 - - [11/Dec/2021:08:57:56 +0000] "GET /core/img/favicon.ico HTTP/1.1" 200 3754 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"
91.169.219.78 - - [11/Dec/2021:08:57:56 +0000] "GET /core/img/favicon-touch.png HTTP/1.1" 200 7273 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"
$ docker logs nextcloud_db
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2021-12-11 08:54:56.972 UTC [30] WARNING:  no usable system locales were found
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Success. You can now start the database server using:
    pg_ctl -D /var/lib/postgresql/data -l logfile start
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
waiting for server to start....2021-12-11 08:55:00.287 UTC [36] LOG:  starting PostgreSQL 13.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2021-12-11 08:55:00.315 UTC [36] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-12-11 08:55:00.468 UTC [37] LOG:  database system was shut down at 2021-12-11 08:54:57 UTC
2021-12-11 08:55:00.511 UTC [36] LOG:  database system is ready to accept connections
 done
server started
CREATE DATABASE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
waiting for server to shut down....2021-12-11 08:55:01.874 UTC [36] LOG:  received fast shutdown request
2021-12-11 08:55:01.956 UTC [36] LOG:  aborting any active transactions
2021-12-11 08:55:01.957 UTC [36] LOG:  background worker "logical replication launcher" (PID 43) exited with exit code 1
2021-12-11 08:55:01.957 UTC [38] LOG:  shutting down
.2021-12-11 08:55:02.890 UTC [36] LOG:  database system is shut down
 done
server stopped
PostgreSQL init process complete; ready for start up.
2021-12-11 08:55:03.137 UTC [1] LOG:  starting PostgreSQL 13.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2021-12-11 08:55:03.138 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-12-11 08:55:03.138 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2021-12-11 08:55:03.406 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-12-11 08:55:03.567 UTC [50] LOG:  database system was shut down at 2021-12-11 08:55:02 UTC
2021-12-11 08:55:03.660 UTC [1] LOG:  database system is ready to accept connections
2021-12-11 08:57:55.384 UTC [59] FATAL:  password authentication failed for user "oc_admin6"
2021-12-11 08:57:55.384 UTC [59] DETAIL:  Role "oc_admin6" does not exist.
	Connection matched pg_hba.conf line 99: "host all all all md5"

GRBurst avatar Dec 11 '21 09:12 GRBurst

Since you mentioned traefik I assume you need to add tweak some settings for the proxy: https://github.com/nextcloud/docker#using-the-apache-image-behind-a-reverse-proxy-and-auto-configure-server-host-and-protocol

Please check the Nexcloud documentation for more details.

J0WI avatar Feb 02 '22 22:02 J0WI