Nextcloud update 22>23 failing

Hello,

I’m trying to update Nextcloud via the terminal to understand why it does not work. All goes well, but then I run into this issue:

$ snap refresh nextcloud
error: cannot perform the following tasks:
- Run post-refresh hook of "nextcloud" snap if present (run hook "post-refresh": 
-----
Traceback (most recent call last):
  File "/snap/nextcloud/current/python/usr/local/lib/python3.8/site-packages/syncloudlib/application/connection.py", line 21, in api_post
    raise Exception('unable to connect to {0} with error code: {1}'.format(socket, response.status_code))
Exception: unable to connect to http+unix://%2Fvar%2Fsnap%2Fplatform%2Fcommon%2Fapi.socket with error code: 500

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/snap/nextcloud/597/meta/hooks/post-refresh", line 7, in <module>
    Installer().post_refresh()
  File "/snap/nextcloud/597/hooks/installer.py", line 92, in post_refresh
    self.install_config()
  File "/snap/nextcloud/597/hooks/installer.py", line 56, in install_config
    storage.init_storage(APP_NAME, USER_NAME)
  File "/snap/nextcloud/current/python/usr/local/lib/python3.8/site-packages/syncloudlib/application/storage.py", line 5, in init_storage
    return api_post('/app/init_storage', data={"app_name": app, "user_name": user})
  File "/snap/nextcloud/current/python/usr/local/lib/python3.8/site-packages/syncloudlib/application/connection.py", line 23, in api_post
    raise Exception('unable to connect to {0}'.format(socket), e)
Exception: ('unable to connect to http+unix://%2Fvar%2Fsnap%2Fplatform%2Fcommon%2Fapi.socket', Exception('unable to connect to http+unix://%2Fvar%2Fsnap%2Fplatform%2Fcommon%2Fapi.socket with error code: 500'))
-----)

The Nextcloud app is running fine - just the upgrade fails. Any ideas on how to resolve this?

Currently you cannot skip major updates, please use this simple instruction to upgrade to 23 then to latest 24:

Thanks, Boris, for that - that is probably part of the problem. However, when I follow the instruction for upgrade to 23, I get the same error message as in my original post… :frowning:

Oh sorry did not look close at the error message, is main device webui running, can you open Settings?

Can you run these commands and post the output?

systemctl status snap.platform.nginx-api
systemctl status snap.platform.uwsgi-api

Yes, I can open Settings in the web UI.

First command output:

$ systemctl status snap.platform.nginx-api
● snap.platform.nginx-api.service - Service for snap application platform.nginx-api
   Loaded: loaded (/etc/systemd/system/snap.platform.nginx-api.service; enabled)
   Active: active (running) since Thu 1970-01-01 00:00:16 UTC; 52 years 6 months ago
 Main PID: 679 (nginx)
   CGroup: /system.slice/snap.platform.nginx-api.service
           ├─679 nginx: master process /snap/platform/1473/nginx/sbin/nginx -...
           ├─680 nginx: worker process
           ├─681 nginx: worker process
           ├─682 nginx: worker process
           └─683 nginx: worker process

Jul 19 21:23:20 odroid-c2 nginx[680]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:23:42 odroid-c2 nginx[682]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:23:42 odroid-c2 nginx[682]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:24:03 odroid-c2 nginx[681]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:35:29 odroid-c2 nginx[680]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:35:29 odroid-c2 nginx[680]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:35:50 odroid-c2 nginx[680]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:35:50 odroid-c2 nginx[681]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 19 21:35:52 odroid-c2 nginx[682]: odroid-c2 nginx: unix: - - [19/Jul/20...0"
Jul 20 19:10:55 odroid-c2 nginx[681]: odroid-c2 nginx: unix: - - [20/Jul/20...0"
Jul 20 19:10:55 odroid-c2 nginx[680]: odroid-c2 nginx: unix: - - [20/Jul/20...0"
Jul 20 19:11:20 odroid-c2 nginx[683]: odroid-c2 nginx: unix: - - [20/Jul/20...0"
Jul 20 19:11:20 odroid-c2 nginx[683]: odroid-c2 nginx: unix: - - [20/Jul/20...0"
Jul 20 19:11:41 odroid-c2 nginx[682]: odroid-c2 nginx: unix: - - [20/Jul/20...0"

Second command output:

$ systemctl status snap.platform.uwsgi-api
● snap.platform.uwsgi-api.service - Service for snap application platform.uwsgi-api
   Loaded: loaded (/etc/systemd/system/snap.platform.uwsgi-api.service; enabled)
   Active: active (running) since Tue 2022-07-19 21:13:39 UTC; 23h ago
 Main PID: 417 (ld-2.28.so)
   Status: "uWSGI is ready"
   CGroup: /system.slice/snap.platform.uwsgi-api.service
           ├─417 /snap/platform/1473/python/lib/arm-linux-gnueabihf/ld-2.28....
           ├─858 /snap/platform/1473/python/lib/arm-linux-gnueabihf/ld-2.28....
           ├─859 /snap/platform/1473/python/lib/arm-linux-gnueabihf/ld-2.28....
           ├─861 /snap/platform/1473/python/lib/arm-linux-gnueabihf/ld-2.28....
           └─864 /snap/platform/1473/python/lib/arm-linux-gnueabihf/ld-2.28....

Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: chownrecursive(path, user)
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: File "/snap/platform/curr...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: return check_output('chow...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: File "/snap/platform/curr...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: return run(*popenargs, st...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: File "/snap/platform/curr...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: raise CalledProcessError(...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: subprocess.CalledProcessE...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: -------------------------...
Jul 20 19:11:41 odroid-c2 platform.uwsgi-api[417]: [pid: 859|app: 0|req: 4/1..

what about:

df -h

Also can you run install again and then:

journalctl -u snap.platform.backend

I have no idea what has changed, but trying the update again for the request, following the instructions as per the wiki for 22 > 23 > 24 worked. :face_with_raised_eyebrow:

All sorted, thank you for your help!