Cannot deploy AIO with existing npm

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • attempted AIO latest
  • Operating system and version (e.g., Ubuntu 24.04):
    • Rocky Linux 8.10 with SELinux enabled.
      4.18.0-553.137.1.el8_10.x86_64
  • Web server and version (e.g, Apache 2.4.25):
    • attempted AIO latest
  • Reverse proxy and version _(e.g. nginx 1.27.2)
  • PHP version (e.g, 8.3):
    • attempted AIO latest
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • attempting AIO latest deploy
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

[…]AIO working flawlessly since July 2024 with no updates. Today, after several failed updates from the AIO interface, including following the tips at Nextcloud AIO v10.1.1 - Apache Will Not Start - #19 by vawaver , I decided to start again, (but using my existing un-mofified nginx-proxy-manager), and import my already saved data.

So after deleting all nc related containers and images, I copied the compose file at all-in-one/compose.yaml at main · nextcloud/all-in-one · GitHub (Commit 0753c6c
) into a new portainer stack, and amended the following lines:

Line 15) # - “80:80” # Can be removed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See …
Line 17) # - “8443:8443” # Can be removed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See …
Line 18) security_opt: [“label:disable”] # Needed when using SELinux. See …
Line 19) environment: # This line is needed (has to be uncommented) when using any of the options below
Line 21) APACHE_PORT: 11000 # Needed when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else). See …
Line 22) APACHE_IP_BINDING: 127.0.0.1 # Should be set when running behind a web server or reverse proxy (like Apache, Nginx, Caddy, Cloudflare Tunnel and else) that is running on the same host. See …
Line 25) AIO_LOG_LEVEL: info # Allows to globally adjust the log level of the included AIO components. Supported values: debug, info, warn, error. See …

However when I try to deploy the stack, I get a portainer error message: ‘Failed to deploy a stack: validating /data/compose docker-compose.yml: services.nextcloud-aio-mastercontainer.environment must be a mapping.’

It appears to me (though, ‘evernoob’…) that the syntax is correct (at lines 21, 22 and 25?), and the file is virtually identical (using BeyondCompare) to my previous working stack.

And, topic notwithstanding, as I can’t even deploy the AIO stack, it’s too early to say that the existing npm stack (as said, unchanged) is an issue, is that right?

AHA.

Steps to replicate it (hint: details matter!):

  1. Remove all existing nc related containers and networks with Portainer.

  2. Retain previously working npm

  3. Attempt to deploy appropriately modified AIO stack.

Log entries

None - can’t yet deploy

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

None - can't yet deploy

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

attempting AIO latest

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

This error is not caused by NGINX Proxy Manager. Portainer is rejecting the Compose file before AIO is even deployed.

I would also avoid pasting the configuration directly into Portainer as a Stack. For a critical service, I prefer keeping the docker-compose.yml file directly on the host and deploying it with:

docker compose config
docker compose up -d

Portainer can still be used for monitoring, logs and container management, but it should not be the only place where the deployment configuration exists.

My complete working setup is documented here:

I have been using this setup for almost 3 years now, and it has been working reliably without issues.

For the current problem, fix the YAML structure first and validate it with docker compose config.

Thank you for the reply. The hardware is a low spec box dedicated to nextcloud (though I may add pihole), used only to sync calendar, contacts and pictures from a handful of android phones, and very light office use (additions to a spreadsheet). I’d prefer to keep things as simple as possible. Further, I’ve heard that proxmox on RHEL derivatives is quite challenging…

I always keep a copy of a stack once it’s up and working, and had just about figured out that, as you confirmed:

This error is not caused by NGINX Proxy Manager. Portainer is rejecting the Compose file before AIO is even deployed…
For the current problem, fix the YAML structure first and validate it with docker compose config.

However, I had assumed that “must be a mapping” referred to the lines with the, er, mappings.

Your suggestion of validation with docker compose config (I didn’t even know it existed) led me to the solution for (this) problem though, so thanks again.


[evernoob@nchost ~]$ docker compose config
yaml: line 3: did not find expected key

I had not modified line 3. A bit of googling led me to https://yamlchecker.com/, and it revealed indentation problems not reported by the portainer stack editor. Fixed those and stack deployment proceeded.

However, I now have exactly the same problem that caused the update to fail - Nextcloud Office is stuck on “starting”. I will start a new thread.

(Apologies if formatting is mangled, haven’t got the hang of the markdown yet.)