Manual upgrade NC17 > NC18 before NC19 and then to NC20 - solved

Upgrade to Ubuntu 20.04, this forced an upgrade of NC17. I am trying to upgrade to NC18 >NC19 and the NC20.
The NC18 manual upgrade has the message below:
gc@nextccer [/var/www/nextcloud]# sudo -u www-data php occ upgrade -vvv
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2020-10-10T17:12:30+00:00 Set log level to debug
2020-10-10T17:12:30+00:00 Repair step: Repair MySQL collation
2020-10-10T17:12:30+00:00 Repair info: All tables already have the correct collation -> nothing to do
2020-10-10T17:12:30+00:00 Repair step: Repair SQLite autoincrement
2020-10-10T17:12:30+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2020-10-10T17:12:30+00:00 Repair step: Drop account terms table when migrating from ownCloud
2020-10-10T17:12:30+00:00 Updating database schema
2020-10-10T17:12:30+00:00 Updated database
2020-10-10T17:12:31+00:00 Updating …
2020-10-10T17:12:31+00:00 InvalidArgumentException: Column name “oc_flow_operations”.“entity” is NotNull, but has empty string or null as default.
2020-10-10T17:12:31+00:00 Update failed
2020-10-10T17:12:31+00:00 Maintenance mode is kept active
2020-10-10T17:12:31+00:00 Reset log level

I did not extract NC18 over /var/www/nextcloud , I renamed the old directory .
There is no apps/workflowengine/appinfo/database.xml file either.

Where can I look


I just tried

sudo -u www-data php occ maintenance:repair

and got

  • Add background job to check for backup codes
  • Populating added database structures for workflows

In AbstractMySQLDriver.php line 42:

An exception occurred while executing ‘SELECT FROM oc_flow_operations o LEFT JOIN oc_flow_operations_scope s O
N = s.operation_id WHERE s.operation_id IS NULL’:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_flow_operations_scope’ doesn’t exist

In PDOConnection.php line 90:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_flow_operations_scope’ doesn’t exist

In PDOConnection.php line 88:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_flow_operations_scope’ doesn’t exist

maintenance:repair [–include-expensive]

1 Like

Hi Gerard,

this is an issue which I had too while upgrading from NC17 to NC18. As mentioned here ( connect to your MySQL database and execute:

alter table oc_flow_operations add column entity character varying(256) not null;

That fixed it for me!

1 Like

Thanks, I needed to do the update via phpmyadmin (cli could not login to the the DB)
NC18 working , now time for the next upgrade to NC19

OK that went well ,upgrade to NC20 complete. 1 small issue with a USB mount but other wise painless.

Hey, Weird
I have the same problem and your suggestion looks promising.
Do you know how to log into the database when using SQLite?

Hi Anutosho
I did not use SQLite and have no knowledge on it. Sorry
What I did for phpMyadmin was to setup as ‘no password for localhost access’ as I am not a DB person.

Did you get anywhere? I’m also using SQLite and hoping to resolve this error.

Going to try following these instructions: