Dockerized NextCloud migration: 404 page not found

I am trying to migrate a Dockerized NextCloud installation. Therefore, I have created a new Docker installation on the new server, started up my docker-compose.yml file, and set both instances of NextCloud into maintenance mode. The DNS entry is already pointing to the new server. Then I have copied the volumes used by NextCloud to the new server (apps, data, config, root) and restarted NextCloud on the new server with docker-compose down, docker-compose up -d. However, I receive an error message

404 page not found

when opening the site. Normally, a message should appear that NextCloud is in maintenance mode. Any idea how to resolve the error?

hello @NextSchm welcome to the forum :handshake:

you are missing the required support template. Please fill this form out and edit into your post.

This will give us the technical info and logs needed to help you in case the machine in question in spitting out errors! Since you’ve provided zero technical details it is impossible to help you as-is. Thanks.

Please use the search - lot of issues have been discussed already.

Server migration is described in detail in

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/migrating.html

Hello wwe, thank you for your answer.

OK, here I am providing more details on my Dockerized installation:

Nextcloud version: I have pulled nextcloud:25-apache
Operating system and version: Ubuntu 22.04)

Here is an output of the docker logs of my database container:

docker logs 7db19aa496f6
2023-02-22 08:20:31+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
2023-02-22 08:20:32+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-02-22 08:20:32+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2023-02-22T08:20:32.620170Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-02-22T08:20:32.621938Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-02-22T08:20:32.629975Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-02-22T08:20:32.962131Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-02-22T08:20:33.277055Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-02-22T08:20:33.277085Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-02-22T08:20:33.277872Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2023-02-22T08:20:33.311277Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.32'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
2023-02-22T08:20:33.311967Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
root@srv-lab-t-428:/home/schm# docker logs 1c2c48e6c2dd
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
[Wed Feb 22 09:20:33.668376 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.1.15 configured -- resuming normal operations
[Wed Feb 22 09:20:33.668484 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Wed Feb 22 09:29:07.477642 2023] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
[Wed Feb 22 09:29:22.499330 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.1.15 configured -- resuming normal operations
[Wed Feb 22 09:29:22.499383 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

… and this is the output of the docker logs of my NextCloud container:

[Wed Feb 22 09:29:22.499330 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.1.15 configured -- resuming normal operations
[Wed Feb 22 09:29:22.499383 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
root@srv-lab-t-428:/home/schm# docker logs 1c2c48e6c2dd
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
[Wed Feb 22 09:20:33.668376 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.1.15 configured -- resuming normal operations
[Wed Feb 22 09:20:33.668484 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Wed Feb 22 09:29:07.477642 2023] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.5. Set the 'ServerName' directive globally to suppress this message
[Wed Feb 22 09:29:22.499330 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.1.15 configured -- resuming normal operations
[Wed Feb 22 09:29:22.499383 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

I am running NextCloud behind the reverse proxy traefik.

In the meantime I have removed all containers and volumes of the dockerized NextCloud installation and restarted my docker-compose.yml file using docker-compose up -d without migration of the data from the old installation. The docker logs of the newly created NextCloud container reads:

Nextcloud was successfully installed
Setting trusted domains…
System config value trusted_domains => 1 set to string MYDOMAINNAME
Initializing finished
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.5. Set the 'ServerName' directive globally to suppress this message
[Wed Feb 22 11:39:13.166800 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.1.15 configured -- resuming normal operations
[Wed Feb 22 11:39:13.166950 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

However, I still cannot access the site, I am still receiving the error “404 page not found”

The problem was that I have used a wrong version specification of traefik, that is, the traefik syntax to specify the traefik labels that I have used in the docker-compose file was according to traefik vs2 but I have pulled a newer version of traefik. So the middleware of traefik was not correctly created and requests from port 443 was not sent to nextcloud.

1 Like