Cannot upgrade Nextcloud from 820 to latest (837)

Cannot upgrade to the latest Nextcloud from 820. I guess, either I am missing an update or an app causes the failure. If missing intermediate update which version is it and what would be the commands to get all versions installed and upgraded? If app is blocking the update how to find out which app need to disable?

Here is the output from the command line attempted upgrade:

root@syncloud:~# snap refresh nextcloud --channel=latest/stable --amend
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/837/meta/hooks/post-refresh”, line 7, in
Installer().post_refresh()
File “/snap/nextcloud/837/hooks/installer.py”, line 91, in post_refresh
self.install_config()
File “/snap/nextcloud/837/hooks/installer.py”, line 55, 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’))
-----)

Could you send logs from Settings - Support (and include support) please?
Looks like it was not able to talk to platform.

Thanks Boris! Just sent the logs.

Can you run snap refresh nextcloud from command line and send the output one more time please?

Here is the output:

root@syncloud:~# 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/837/meta/hooks/post-refresh”, line 7, in
Installer().post_refresh()
File “/snap/nextcloud/837/hooks/installer.py”, line 91, in post_refresh
self.install_config()
File “/snap/nextcloud/837/hooks/installer.py”, line 55, 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’))
-----)

What about systemctl status snap.platform.api

Here is the output:

root@syncloud:~# systemctl status snap.platform.api
● snap.platform.api.service - Service for snap application platform.api
Loaded: loaded (/etc/systemd/system/snap.platform.api.service; enabled)
Active: active (running) since Fri 2025-06-13 22:08:53 PDT; 2 days ago
Main PID: 390 (api)
CGroup: /system.slice/snap.platform.api.service
└─390 /snap/platform/2254/bin/api unix /var/snap/platform/common/api.socket

Jun 16 08:18:05 syncloud platform.api[390]: github.com/syncloud/platform/rest.(*Middleware).JsonHeader-fm.(*Middleware).JsonHeader.func1
Jun 16 08:18:05 syncloud platform.api[390]: /drone/src/backend/rest/middleware.go:73
Jun 16 08:18:05 syncloud platform.api[390]: net/http.HandlerFunc.ServeHTTP
Jun 16 08:18:05 syncloud platform.api[390]: /usr/local/go/src/net/http/server.go:2166
Jun 16 08:18:05 syncloud platform.api[390]: github.com/gorilla/mux.(*Router).ServeHTTP
Jun 16 08:18:05 syncloud platform.api[390]: /go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210
Jun 16 08:18:05 syncloud platform.api[390]: net/http.serverHandler.ServeHTTP
Jun 16 08:18:05 syncloud platform.api[390]: /usr/local/go/src/net/http/server.go:3137
Jun 16 08:18:05 syncloud platform.api[390]: net/http.(*conn).serve
Jun 16 08:18:05 syncloud platform.api[390]: /usr/local/go/src/net/http/server.go:2039

Can you send logs again from settings please

Logs on the way. ---- fill up to 20 chars :slight_smile: ----

1 Like

Sorry logs are moving quickly out of the scope, can you run nextcloud refresh and then send logs as soon as it fails

New logs on the way. Below is again the output from the command I run:

root@syncloud:~# 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/837/meta/hooks/post-refresh”, line 7, in
Installer().post_refresh()
File “/snap/nextcloud/837/hooks/installer.py”, line 91, in post_refresh
self.install_config()
File “/snap/nextcloud/837/hooks/installer.py”, line 55, 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’))
-----)

BTW, the “Run post-refresh hook of “nextcloud” snap if present” steps takes really long time before it fails. Also, if it is important, my Syncloud box is set for IP V6 only.

Ok I see the error now, looks like a disk error, I would suggest getting a new disk and copying your data.

Jun 16 10:43:45 syncloud kernel: end_request: I/O error, dev sdb, sector 3753904600
Jun 16 10:43:45 syncloud kernel: ata2: EH complete
Jun 16 10:43:45 syncloud platform.api[390]: info storage/storage.go:78 chown {"output": "chown: changing ownership of '/data/nextcloud/appdata_occ44ym13jd0/preview/0/e/b/a/3/c/f/617137/256-192.jpg': Input/output error

OK, I see. Thank you very much for finding the issue. Just to make sure the error is with sdb device, right? This must be the data device not the OS device, right?

The OS root ( / ) is on /dev/sda2
/dev/sdb1 is mount on /opt/disk/external – this should be the data disk

Is the /dev/sdb1 the problematic disk?

Thank you very much again.

Correct, OS disk is ok, external disk is not.

Boris, another question: Would it be recommended (or not recommended) to use NVME SSD disk as a storage device for the Syncloud (specifically as Nextcloud being the main function)? I am wondering if it would be wise to switch to NVME SSD when replacing the storage device or would be better to stick with regular HD (I usually use NAS type of HDs)?

I appreciate your insight and advice. Thank you!

Depends on how critical your data is, I use SSDs a lot. Ideally you use more than one with Syncloud disk mode. Also if you plan to disconnect power on SSD for more than two years you need a copy on HDD (I do that some times :)).

Created an issue for disk issue notifications: Device issues notification · Issue #4 · syncloud/platform · GitHub

Hi Boris, what do you mean by “copying your data” above? I am trying to replace this bad disk with another one. I tried to remove the disk from the Syncloud system and mount it on my work PC in order to image it onto the new disk. Though my Linux PC does not properly recognize the Synclod disk. It does not want to mount it and even ‘gparted’ tells me that that the disk space is unallocated.

When I have this disk in the Syncloud system seems to work fine (“fine” in sense the data is visible in Nextcloud). What is the reason for this behavior? More importantly how can I copy the data to the new HD? I was thinking to use ‘dd’ to copy the whole disk to the new one but seems my Linux PC does not see the Syncloud disk as a valid disk/partition.

How should I migrate the data from the old to the new HD?

Thanks a lot!

Strange that your Linux pc cannot see it properly.

Can you try one thing, run this command when attached to Syncloud device:

fdisk -l /dev/sdb

Then attach to you another pc and run the same command?

Another option is to copy files remotely from your Syncloud device using sftp protocol:

I use this approach to copy critical files to another HDD and keep it as a disconnected backup.

Hi Boris,

I managed to copy the directories and files over SFTP. Now how to get Syncloud to see (mount) the new disk? It does not mount and I do not see line in ‘fstab’ for the “external” disk. I tried from the Web UI to add it from Settings–>Storage but no luck yet. If I try “Disks” option I get following error:

"Previous change

cannot find existing uuid to use"

If I try “Partitions” option nothing happens either. BTW, previous (now bad disk) was using “Partitions” option.

Any advise? Thank you.