mailinabox
mailinabox copied to clipboard
Mailinabox upgrade fails on NextCloud 'Contacts'
Good afternoon,
When attempting to upgrade my mailinabox instance to v56, the upgrade fails when it attempts to install NextCloud's components.
The specific error is a 404 when fetching https://github.com/nextcloud-releases/contacts/releases/download/v3.4.1/contacts-v3.4.1.tar.gz
It looks like NextCloud's current release for that is at https://github.com/nextcloud-releases/contacts/releases/download/v4.0.7/contacts-v4.0.7.tar.gz
Could you adjust setup.sh to fix this?
Thank you!
It looks like you haven't upgraded in a while and as such you skipped Nextcloud versions. This is relevant because MIAB currently installs Nextcloud 20. If you're upgrading from 18->20, it will need to upgrade to NC 19 first (which installs 3.4.1
). When doing the final upgrade to NC 20, 4.0.7
is installed.
Then Nextcloud decided to move their repos for releases. This was relatively recent and they didn't carry over old versions, so here we are. The link was hardcoded so the script doesn't exactly account for old releases yet 😬
A workaround for now
-
Make a backup of your files - this process wasn't tested and if something goes wrong you have something to fall back on;
-
Force a re-setup to v55 (the version before the most recent), which will put you on NC 20:
curl -s https://raw.githubusercontent.com/mail-in-a-box/mailinabox/v55/setup/bootstrap.sh | sudo bash
- Run the setup again, this time the most recent script which will put you on v56:
curl -s https://mailinabox.email/setup.sh | sudo bash
I want to say that I apologize that I messed this up in the latest release (but also I blame Nextcloud for not making it clear where to download things from). I would like to get this fixed in a new release but I won't have time to work on it immediately.
It looks like the downloads for the older releases (e.g. nextcloud's contact v3.4.1) can be found here: https://github.com/nextcloud-releases/contacts/archive/refs/tags/v3.4.1.tar.gz
@aewens Isn't it better to use the solution provided by @ddavness above than to download directly?
@myfirstnameispaul My comment was more addressing what @JoshData was saying above about Nextcloud not making it clear where to download things from. It would seem that previously one could get the tarballs for the releases using the format:
https://github.com/nextcloud-releases/$SOFTWARE/releases/download/v$VERSION/contacts-v$VERSION.tar.gz
But after a certain point the older releases are no longer available there (e.g. contact v3.4.1), in which case you would instead need to use the format:
https://github.com/nextcloud-releases/$SOFTWARE/archive/refs/tags/v$VERSION.tar.gz
This was more intended as a potential strategy that can be used to fixsetup/nextcloud.sh
in the long-term, not as a suggestion for someone to try to manually download each of the tarballs for all previous releases. This will, unfortunately, also mean that the hashes for the commits will need to be changed in the script as well since the tags and releases use different hashes, but through my own testing I may soon have a PR that can fix this by manually updating all of them in the script.
A workaround for now
1. Make a backup of your files - this process wasn't tested and if something goes wrong you have something to fall back on; 2. Force a re-setup to v55 (the version before the most recent), which will put you on NC 20:
curl -s https://raw.githubusercontent.com/mail-in-a-box/mailinabox/v55/setup/bootstrap.sh | sudo bash
3. Run the setup again, this time the most recent script which will put you on v56:
curl -s https://mailinabox.email/setup.sh | sudo bash
I tried this and I got an error
"Error: near line 1: duplicate column name: entity"
Any suggestions? Is there an older version I need to go back to maybe? It's been a while since I did any updates.
@RamenJunkie You can try the changes in the PR listed right above your comment. That is what I used to get mine working.
For everyone also having this issue and trying to use the solution provided by @ddavness. I got the same error message as @RamenJunkie:
Updating system packages...
Installing system packages...
Initializing system random number generator...
Firewall is active and enabled on system startup
Installing nsd (DNS server)...
Installing Postfix (SMTP server)...
Installing Dovecot (IMAP server)...
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
sudo: unable to resolve host <my-host>: Resource temporarily unavailable
Installing Nextcloud (contacts/calendar)...
Upgrading Nextcloud --- backing up existing installation, configuration, and database to directory to /home/user-data/owncloud-backup/2022-04-20-09:49:10...
Error: near line 1: duplicate column name: entity
BUT the fix from @aewens worked. I applied it the following way:
- Execute
curl -s https://mailinabox.email/setup.sh | sudo bash
as usual. This will download the current nextcloud install script into the/root/mailinabox
-directory and it will fail with the messageFAILED: wget -O /tmp/contacts.tgz https://github.com/nextcloud-releases/contacts/releases/download/v3.4.1/contacts-v3.4.1.tar.gz
- Replace the newly downloaded file
/root/mailinabox/setup/nextcloud.sh
with the file from the PR #2105 of @aewens: https://github.com/mail-in-a-box/mailinabox/blob/e49f430dd49afeb9c582d985d73f1008be4f1bd6/setup/nextcloud.sh -
cd /root/mailinabox
-
./setup/start.sh
The update was completed and everything works again :)