Upgrade from 0.5 to 0.51 error

Nextcloud is throwing the following error:

Repair error: Repair step ‘OCA\Talk\Migration\FixNamespaceInDatabaseTables’ is unknown
PHP Fatal error: Cannot declare class OCA\Talk\Migration\Version8000Date20200331144101, because the name is already in use in /usr/local/lib/owncloud/apps/spreed/lib/Migration/Version8000Date20200331144101.php on line 54

If I run the install script again, I get the following error when it comes to upgrading Nextcloud:

Error: near line 1: duplicate column name: entity

I have been using Talk for quite sometime in Miab. Any suggestions?

Same here… no solution…

I removed NextCloud Talk

sudo -u www-data php /usr/local/lib/owncloud/occ app:remove spreed

Ran the updater again. The only error this time is this:

Upgrading Nextcloud — backing up existing installation, configuration, and database to directory to /home/user-data/owncloud-backup/2020-11-15-17:08:15…
Error: near line 1: duplicate column name: entity

I guess it has to do with this:
echo "ALTER TABLE oc_flow_operations ADD COLUMN entity VARCHAR;" | sqlite3 $STORAGE_ROOT/owncloud/owncloud.db

good guess. where did you find that (which scrpt)?
did you try to comment it out and then run the script again?

The script is here
I haven’t attempted it yet. Would rather wait for official confirmation

Ok. I edited the script by commenting out the offending line, re-ran it after taking NextCloud out of maintenance mode and re-ran the full update script again. All good so far

1 Like

YES. Thank you, that did the trick.
Problem solved.

I also experienced the problem of the existing table. I commented the line out as mentioned, rebooted the server and reran the upgrade script. I don’t get any error, but the script seems to hang as it remains quiet after informing me that it is upgrading Nextcloud to version 18.0.10.

I can cancel the script and reboot the server, but always the same. No error whatsoever and Nexcloud is stil at version 17.0.6.2.

Luckily everything keeps working so my mail server remains functional.

Let’s hope this will be fixed soon.

Did you take NextCloud out of maintenance mode?

Not sure how to do that but after rebooting, it is available again. I now ran the setup script with nexcloud setup commented out to make sure all the rest is updated properly. I guess that I can run the nextcloud update script alone ?

Yeah I also just tried to update and mine was hanging on the Nextcloud update just as @heinsaris mentioned… I finally cancelled the script and now when I run it again I get a “duplicate column name: entity” error.

My Roundcube webmail portal gave me a 502 Bad Gateway error, but email did get through (since I needed it to verify my account to post this message!)

A reboot has the system running again, with Nextcloud at the old version as well.

I got the same error, manually cloned the repository and removed the nextcloud.sh script (zeroed the file, it needs to exist) and ran the update to get MIAB running again. Rebooting didn’t work for me.

If your NextCloud update failed during upgrade, then this is what I did to get the upgrade to complete:

  1. In /user-name/mailinabox/setup is the nextcloud.sh script. You need to comment out the line
    echo "ALTER TABLE oc_flow_operations ADD COLUMN entity VARCHAR;" | sqlite3 $STORAGE_ROOT/owncloud/owncloud.db by adding a # in front of it
  2. Edit /usr/local/lib/owncloud/config/config.php and change the last line to
    'maintenance' => false,
  3. Re-run curl -s https://mailinabox.email/setup.sh | sudo -E bash

It should complete without error

1 Like

the script seemed to hang on my machine too. in the end it just took very very long…

Sometimes the NextCloud servers are overloaded and it can hang

are you sure? if you run * Re-run curl -s https://mailinabox.email/setup.sh | sudo -E bash
i think you will overwrite the comments.

No. The script has already downloaded everything previously

ok. thanks.
i just did that:
nano /home/MYUSER/mailinabox/setup/nextcloud.sh
(comment out the line with #)
cd /home/MYUSER/mailinabox
sudo setup/start.sh

all good

2 Likes

Ah ok, I just commented out source setup/nextcloud.sh in my local copy of start.sh in ~/mailinabox/setup and reran the script locally with sudo setup/start.sh from ~/mailinabox (since the scripts expect to launch from a path below where they are located) everything else updated but not nextcloud.

Doing it your way and just running the nextcloud.sh script and it all worked just fine, though I didn’t have a maintenance entry in my config.php for owncloud so didn’t have to touch it at all and it worked.

Thanks for the detailed explanation

1 Like

I ran setup/nextcloud.sh and let it run. It indeed took a very long time to complete, but I now am at version 20.0.1.1.

So all fine for me now.

Thank you all for your help. And thanks to everyone who has contributed to MIAB. I have been a happy user since May 2015. I run a dozen of domains on a $10 DO droplet. I started with Ubuntu14.04 and upgraded to 18.04 two years ago. Most of the time I have been able to upgrade without any issue. And the few times that I had issues, this blog has been a very successful source to fix the problem.

1 Like