DB-Error @ Update from 19.0.9 to 20.0.8

I tried to update my Nextcloud instance from 19.0.9 to 20.0.8 and got the error:

Doctrine\DBAL\Schema\SchemaException: There is no column with name 'execution_duration' on table 'oc_jobs'.

In admin/overview there are no pending operations.

Any ideas? :slight_smile:

Nextcloud version: 19.0.9
Operating system and version: Ubuntu 20.04
Apache or nginx version: Apache
Installed with docker (tag 19 / tag 20)

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. docker pull nextcloud:20
  2. docker stop
  3. docker run nextcloud:20

The output of your Nextcloud log in Admin > Logging:
(no update-related entries)

You should run the following occ commands on your server:

./occ db:add-missing-indices ...
./occ db:add-missing-columns ...
./occ db:add-missing-primary-keys ...

I tried but without success:

# docker exec --user www-data <container> php occ db:add-missing-indices -vvv
Check indices of the share table.
Check indices of the filecache table.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Done.
# docker exec --user www-data <container> php occ db:add-missing-columns -vvv
Check columns of the comments table.
Done.

db:add-missing-primary-keys failed:
Command "db:add-missing-primary-keys" is not defined.

But still there is no column ‘execution_duration’ on table ‘oc_jobs’.

sqlite> .schema oc_jobs
CREATE TABLE oc_jobs (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, class VARCHAR(255) DEFAULT '' NOT NULL COLLATE BINARY, argument VARCHAR(4000) DEFAULT '' NOT NULL COLLATE BINARY, last_run INTEGER DEFAULT 0, last_checked INTEGER DEFAULT 0, reserved_at INTEGER DEFAULT 0);
CREATE INDEX job_class_index ON oc_jobs (class);

I’m personally using a MariaDB database instead of a SQlite one, but it should be possible to add the column manually:

MariaDB [nextcloud]> describeoc_jobs;
+--------------------+---------------------+------+-----+---------+----------------+
| Field              | Type                | Null | Key | Default | Extra          |
+--------------------+---------------------+------+-----+---------+----------------+
| id                 | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| class              | varchar(255)        | NO   | MUL |         |                |
| argument           | varchar(4000)       | NO   |     |         |                |
| last_run           | int(11)             | YES  |     | 0       |                |
| last_checked       | int(11)             | YES  |     | 0       |                |
| reserved_at        | int(11)             | YES  |     | 0       |                |
| execution_duration | int(11)             | YES  |     | 0       |                |
+--------------------+---------------------+------+-----+---------+----------------+
7 rows in set (0.001 sec)
1 Like