I’m running a Ubuntu 20.04 machine with nextlcoud snap (22.1.1) installed and an certificate from let’s encrypt.
Works perfectly well. However, update does not.
Executing:
sudo snap refresh nextcloud
2022-12-19T22:40:00Z INFO Waiting for "snap.nextcloud.mysql.service" to stop.
error: cannot perform the following tasks:
- Run post-refresh hook of "nextcloud" snap if present (run hook "post-refresh": Nextcloud doesn't support skipping major versions, you must upgrade to Nextcloud 23 first. Try 'sudo snap refresh nextcloud --channel=23')
Executing as suggested:
sudo snap refresh nextcloud --channel=23
2022-12-19T22:42:53Z INFO Waiting for "snap.nextcloud.mysql.service" to stop.
error: cannot perform the following tasks:
- Run configure hook of "nextcloud" snap if present (run hook "configure": error: error running snapctl: snap "nextcloud" option "ports" is not a map)
Syslog is the same in both cases:
Dec 19 22:43:11 server nextcloud.apache[427530]: error: error running snapctl: snap "nextcloud" option "ports" is not a map
Dec 19 22:43:11 server nextcloud.apache[427546]: error: error running snapctl: snap "nextcloud" option "ports" is not a map
Dec 19 22:43:11 server nextcloud.apache[427562]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Huh, no idea how you managed to get it into that state. Try this: sudo snap set nextcloud ports.http=80 ports.https=443. If that is successful, you should be able to update to v23 and beyond.
bil@server:~$ sudo snap set nextcloud ports.http=80 ports.https=443
error: cannot perform the following tasks:
- Run configure hook of "nextcloud" snap (snap "nextcloud" option "ports" is not a map)
This is snapd’s “database” for the settings you’re trying to update. In that json object, I assume you’ll find "ports": 443 or some such invalid thing. It needs to be an object instead of a scalar: "ports":{"http":80,"https":443}. Note that there will be two of them you need to update, one in nextcloud.ports, one in nextcloud.private.ports. Make them look identical.
Once you’re happy with it, save and exit that file. Then restart snapd:
First of all, I am sorry to barge in and hijacking the thread by going little off topic,
But I have a question here, just for better understanding. I need little explanation on this comment of yours
If I am running my Nextcloud Snap on nonstandard HTTP and HTTPS port, will it stop updating itself?
Just to elaborate, I have Nextcloud Snap running on nonstandard HTTP and HTTPS port with custom (my own domain) given SSL with a Sub domain.
Same machine is also having various other services and to make all accessible via Internet, I have Docker Nginx Reverse Proxy Manager running to manage port 80/443 and forward subdomains (traffic) to their respective services via different ports.
Just to be clear, I don’t have any problem, everything is running just fine but since you commented, I wonder, will this setup stop my Snap Nextcloud from updating itself?
Once again, apologies for hijacking the thread and asking something little off topic.
Oh heavens no, although I can see how you might misunderstand my comment. The issue here wasn’t that @bil’s config was using a non-standard port, but it was somehow completely invalid. ports needs to be an object containing a http and https key, specifying ports for each, not just a scalar value like @bil had. As long as your config has the http and https key and they are valid ports, you won’t run into any issues: the snap will continue to update as it always has.