Migrating existing NC -> AIO

Hi there,

I’m trying to get a family instance of Next Cloud moved off of an old Nethserver node onto a clean AIO install. There’s two complications – the existing Next Cloud is still in use and sitting on IP and holding the domain.

Both should be easy to surmount – I can reverse proxy to the replacement server on a temporary domain and then change the domain as described here once the existing server is decommissioned.

However, I’m running into frustrations with the reverse proxy – and yes, I’ve worked through all of the reverse proxy steps multiple times. Clearly I’m missing something, but I can’t figure out what. Here’s what’s happening:

Clean setup of Nextcloud-AIO with reverse proxy:

sudo docker run --init --sig-proxy=false --name nextcloud-aio-mastercontainer --restart always --publish 8080:8080 --env APACHE_PORT=11000 --env APACHE_IP_BINDING=0.0.0.0 --env NEXTCLOUD_DATADIR="/home/cloudData" --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config --volume /var/run/docker.sock:/var/run/docker.sock:ro nextcloud/all-in-one:latest

Visit the AIO container interface on 8080. All is well.

Enter domain for validation.

NOTICE: PHP message: The response of the connection attempt to "<MYURL>" was: 
NOTICE: PHP message: Expected was: <CODE>
NOTICE: PHP message: The error message was: Connection timed out after 10002 milliseconds
NOTICE: PHP message: Please follow https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#6-how-to-debug-things in order to debug things!

Visit the domain in a browser to confirm I receive the same . I do!

Check on the host: curl <MYURL> to confirm the host also receives the code. It does!

So if I receive the code and the host receives the code, why is the master container timing out?

Here’s a more complete log:

$ sudo docker logs -f nextcloud-aio-mastercontainer
Trying to fix docker.sock permissions internally...
Creating docker group internally with id 994
Initial startup of Nextcloud All-in-One complete!
You should be able to open the Nextcloud AIO Interface now on port 8080 of this server!
E.g. https://internal.ip.of.this.server:8080
⚠️ Important: do always use an ip-address if you access this port and not a domain as HSTS might block access to it later!

If your server has port 80 and 8443 open and you point a domain to your server, you can get a valid certificate automatically by opening the Nextcloud AIO Interface via:
https://your-domain-that-points-to-this-server.tld:8443
[Sat Jul 27 10:29:28.986708 2024] [mpm_event:notice] [pid 137:tid 137] AH00489: Apache/2.4.61 (Unix) OpenSSL/3.3.1 configured -- resuming normal operations
[Sat Jul 27 10:29:28.986747 2024] [core:notice] [pid 137:tid 137] AH00094: Command line: 'httpd -D FOREGROUND'
[27-Jul-2024 10:29:28] NOTICE: fpm is running, pid 146
[27-Jul-2024 10:29:28] NOTICE: ready to handle connections
{"level":"info","ts":1722076169.0029786,"msg":"using config from file","file":"/Caddyfile"}
{"level":"info","ts":1722076169.0042472,"msg":"adapted config to JSON","adapter":"caddyfile"}
NOTICE: PHP message: The response of the connection attempt to "https://cloud2.coxbros.us:443" was: 
NOTICE: PHP message: Expected was: 0c0f0f3b7f9fdd59a127ed8631ebcbda8cf3401b0d69d416
NOTICE: PHP message: The error message was: Connection timed out after 10002 milliseconds
NOTICE: PHP message: Please follow https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#6-how-to-debug-things in order to debug things!
NOTICE: PHP message: The response of the connection attempt to "<MYURL>" was:
NOTICE: PHP message: Expected was: <CODE>
NOTICE: PHP message: The error message was: Connection timed out after 10002 milliseconds
NOTICE: PHP message: Please follow https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#6-how-to-debug-things in order to debug things!
1 Like

Hi, can you do so?

Hi @szaimen thanks for the reply.

As stated above, yes, I’ve been through those steps multiple times to no avail. But I can be more specific if that helps:

  1. I’ve done everything here except mimic your proxy configs – since on NS7 I don’t know what the underlying proxy platform is nor do I know where the config files live. However, I have confirmed in troubleshooting that the proxy is providing exactly what AIO is looking for as you can see above both in a browser and via curl on the AIO host.
  2. Done – once again visible in what I’ve posted above.
  3. Done – also visible above
  4. Done
  5. See #1
  6. Done – see logs above
  7. Done – see logs above
  8. Not applicable
  9. Not applicable
  10. Done – visible in troubleshooting above
  11. No IPv6
  12. Done, again and again, as stated above
  13. I’ve tried this also. I can get past validation and the containers start, but the webserver remains stuck at the code step.

Thank you. What’s next?

What code step?

1 Like

When I visit the domain in a browser or via curl, the webserver responds with a 48 digit alpha numberic string – which I am describing as a code.

In the logs, it’s clear that master-container is seeking this code from the server but not getting it – though the logs show the exact same alpha-numberic code.

If I skip validation, the container management interface (on 8080) will show everything is good. The container logs all look good, but when I try to go to the nextcloud interface on 443 I’m still presented with that 48 digit code. Black text on a white screen. Nothing else.

The logs are shown above.

Before you ask – yes, I’ve cleared cookies and refreshed the browser. :slight_smile:

So after skipping did you follow the further steps of starting the containers and stuff? What do you see in the aio interface after doing so?

Thanks for sticking with me!

I’m not currently in that configuration, since I just did a clean start and am back at validation. However, here’s a screen shot from a couple of days ago after I’d skipped validation:

Do you have any idea why the master container would say it isn’t able to get the alphanumeric code and is timing out when both the host machine and my computer (on the other side of the world) both receive the alphanumberic code? Is there a way to test the result inside the master container?

What happens then if you click the button Open your Nextcloud at that state?

It opens the white page with the black alpha numeric code, same as it does now. The same code which is shown in the log file now.

Hm, this is weird. Can you post the output of sudo docker inspect nextcloud-aio-apache here?

1 Like

that container isn’t running right now, since I’m still sitting at verification. I don’t have time to make the switch tonight, but tomorrow afternoon, I’ll move things back to the “skip verification” state and send you that result.

:rofl: Oh, madness.

Ran this:

sudo docker run --init --sig-proxy=false --name nextcloud-aio-mastercontainer --restart always --publish 8080:8080 --env APACHE_PORT=11000 --env APACHE_IP_BINDING=0.0.0.0 --env NEXTCLOUD_DATADIR="/home/cloudData" --env SKIP_DOMAIN_VALIDATION=true --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config --volume /var/run/docker.sock:/var/run/docker.sock:ro nextcloud/all-in-one:latest

Did the initial setup. Just like last time, it took forever for the containers to start. Unlike last time, this time Nextcloud works. I’ve no idea what’s different. But hooray! It’s working.

Next question, once I complete my migration, are there any special steps to get rid of the reverse-proxy? Can I just restart the containers without --env APACHE_PORT=11000 --env APACHE_IP_BINDING=0.0.0.0 and adding --publish 80:80 and --publish 443:443?

So you want to migrate to the tls proxy that is built into AIO? In that case, you need to adjust the apache port to the following: --env APACHE_PORT=443. The rest can stay as it is.

1 Like

Thank you @szaimen. I really appreciate all your help.

When I’m ready to do that, do I remove all the containers but not the volumes? How do I change the AIO setup without losing everything? Thanks!

Stop the containers, recreate the mastercontainer with the adjusted docker run command and start the containers again via the aio interface. As long as you dont remove the volumes, everything should be kept

Perfect! Thank you!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.