# Nextcloud failed update 603 to 631

**URL:** <https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264>\
**Category:** Existing Apps\
**Tags:** nextcloud\
**Created:** [1 December 2022 02:56 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264 "2022-12-01T02:56:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [1 December 2022 02:56 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/1 "2022-12-01T02:56:34Z")

</div>

Here is the error from commandline snap refresh nextcloud

> 2022-11-30 21:49:00,260 - database - INFO - postgres executing: /snap/nextcloud/current/bin/initdb.sh /var/snap/nextcloud/current/database  
> initdb: invalid locale settings; check LANG and LC\_\* environment variables  
> 2022-11-30 21:49:01,066 - database - ERROR - postgres error: The files belonging to this database system will be owned by user “nextcloud”.  
> This user must also own the server process.  
> Traceback (most recent call last):  
> File “/snap/nextcloud/631/meta/hooks/post-refresh”, line 7, in   
> Installer().post\_refresh()  
> File “/snap/nextcloud/631/hooks/installer.py”, line 97, in post\_refresh  
> self.db.init()  
> File “/snap/nextcloud/631/hooks/postgres.py”, line 33, in init  
> self.run(‘{0}/bin/initdb.sh {1}’.format(self.app\_dir, self.database\_dir))  
> File “/snap/nextcloud/631/hooks/postgres.py”, line 55, in run  
> raise e  
> File “/snap/nextcloud/631/hooks/postgres.py”, line 51, in run  
> output = check\_output(cmd, shell=True).decode()  
> File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 415, in check\_output  
> return run(\*popenargs, stdout=PIPE, timeout=timeout, check=True,  
> File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 516, in run  
> raise CalledProcessError(retcode, process.args,  
> subprocess.CalledProcessError: Command ‘/snap/nextcloud/current/bin/initdb.sh /var/snap/nextcloud/current/database’ returned non-zero exit status 1.

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [1 December 2022 17:33 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/2 "2022-12-01T17:33:36Z")

</div>

Which command line is that?  
Are you trying to use this page to upgrade to v24 first?

> **[Nextcloud · syncloud/platform Wiki](https://github.com/syncloud/platform/wiki/Nextcloud)**
>
> Run popular services on your device with one click - Nextcloud · syncloud/platform Wiki

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [1 December 2022 17:42 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/3 "2022-12-01T17:42:21Z")

</div>

Sorry I guess you are running:

```auto
snap refresh nextcloud

```

If you are on Nextcloud 23 you cannot use that command and need to use the above wiki to upgrade to 24 first and then the last command to upgrade to latest (25)

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [2 December 2022 12:32 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/4 "2022-12-02T12:32:05Z")

</div>

SO I tried the wiki and get roughly the same error remember i am running a legacy syncloud if that helps

> root@syncloud:~/snap/nextcloud# rm nextcloud\_211101376\_amd64.snap  
> root@syncloud:~/snap/nextcloud# wget [apps.syncloud.org/apps/nextcloud\_621\_$](http://apps.syncloud.org/apps/nextcloud_621_$)(dpkg --print-architecture).snap  
> –2022-12-02 07:26:48-- [http://apps.syncloud.org/apps/nextcloud\_621\_amd64.snap](http://apps.syncloud.org/apps/nextcloud_621_amd64.snap)  
> Resolving [apps.syncloud.org](http://apps.syncloud.org) ([apps.syncloud.org](http://apps.syncloud.org))… 52.218.252.130, 52.218.208.219, 52.218.236.186, …  
> Connecting to [apps.syncloud.org](http://apps.syncloud.org) ([apps.syncloud.org](http://apps.syncloud.org))|52.218.252.130|:80… connected.  
> HTTP request sent, awaiting response… 200 OK  
> Length: 496369664 (473M) [binary/octet-stream]  
> Saving to: ‘nextcloud\_621\_amd64.snap’

nextcloud\_621\_amd64.snap 100%[=================================================\>] 473.38M 12.8MB/s in 38s

2022-12-02 07:27:26 (12.5 MB/s) - ‘nextcloud\_621\_amd64.snap’ saved [496369664/496369664]

root@syncloud:~/snap/nextcloud# snap install nextcloud\_621\_$(dpkg --print-architecture).snap --devmode  
error: cannot perform the following tasks:

- Run post-refresh hook of “nextcloud” snap if present (run hook “post-refresh”:

* * *

2022-12-02 07:30:04,577 - database - INFO - postgres executing: /snap/nextcloud/current/bin/initdb.sh /var/snap/nextcloud/current/database  
initdb: invalid locale settings; check LANG and LC\_\* environment variables  
2022-12-02 07:30:05,714 - database - ERROR - postgres error: The files belonging to this database system will be owned by user “nextcloud”.  
This user must also own the server process.  
Traceback (most recent call last):  
File “/snap/nextcloud/621/meta/hooks/post-refresh”, line 7, in   
Installer().post\_refresh()  
File “/snap/nextcloud/621/hooks/installer.py”, line 97, in post\_refresh  
self.db.init()  
File “/snap/nextcloud/621/hooks/postgres.py”, line 33, in init  
self.run(‘{0}/bin/initdb.sh {1}’.format(self.app\_dir, self.database\_dir))  
File “/snap/nextcloud/621/hooks/postgres.py”, line 55, in run  
raise e  
File “/snap/nextcloud/621/hooks/postgres.py”, line 51, in run  
output = check\_output(cmd, shell=True).decode()  
File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 415, in check\_output  
return run(\*popenargs, stdout=PIPE, timeout=timeout, check=True,  
File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 516, in run  
raise CalledProcessError(retcode, process.args,  
subprocess.CalledProcessError: Command ‘/snap/nextcloud/current/bin/initdb.sh /var/snap/nextcloud/current/database’ returned non-zero exit status 1.  
-----)  
root@syncloud:~/snap/nextcloud#

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [2 December 2022 12:42 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/5 "2022-12-02T12:42:06Z")

</div>

Submitting support log now too

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [2 December 2022 18:42 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/6 "2022-12-02T18:42:04Z")

</div>

Right you are still on jessie, we need to introduce OS upgrade option at some point.  
For now can you run this:

```auto
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"

```

and then

```auto
snap install nextcloud_621_$(dpkg --print-architecture).snap --devmode

```

but this may not help as probably the real reason is disk space, only 2G left on root:

```auto
/dev/dm-1 16G 13G 2.2G 86% /

```

What kind of device is this, I see amd64 but where is small boot partition is coming from as we do not do amd64 Syncloud devices with a separate boot disk.

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [16 December 2022 03:56 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/7 "2022-12-16T03:56:07Z")

</div>

So I had to take a break and tried again but no luck, however the version I am running is Nextcloud 24 it is confusing. But here is my underlying question, I am setting up a new device at the moment, and if it install 631 and say my instance is on 603 will the data get upgraded correctly?

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [16 December 2022 06:57 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/8 "2022-12-16T06:57:32Z")

</div>

If by data you mean Nextcloud files then yes, as you will have to copy them to the new device (or reattach external disk) anyway and run occ scan from the wiki.

The only problem would be if you want to migrate Nextcloud settings like contacts, calendar events … for them you need to do a backup and restore but it needs the same version on both devices do you want that?

It is possible to install the same Nextcloud version on the new device restore the backup and then upgrade.

---

<div class="post-metadata">

**Author:** ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)\
**Post date:** [16 December 2022 06:59 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/9 "2022-12-16T06:59:58Z")

</div>

It is always possible to install a specific version for example v603:

```auto
wget apps.syncloud.org/apps/nextcloud_603_$(dpkg --print-architecture).snap

snap install nextcloud_603_$(dpkg --print-architecture).snap --devmode

```

Then try restoring backup and then use the wiki to upgrade to the latest.

---

<div class="post-metadata">

**Author:** ![marxistvegan](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/marxistvegan/32/22_2.png) [@marxistvegan](https://syncloud.discourse.group/u/marxistvegan)\
**Post date:** [21 December 2022 02:47 UTC](https://syncloud.discourse.group/t/nextcloud-failed-update-603-to-631/264/10 "2022-12-21T02:47:01Z")

</div>

Ok so I resolved this in a rather unhelpful for others way if someone runs into this.

I built a new machine and had to re-add the apps separatey. Now on a uefi build that is no longer legacy of Jesse fully on Buster
