After upgrade: no column with name 'parent' on table 'oc_share_external'

After upgrading to v20 of Nextcloud (currently I am running v20.0.5) I realized that the automatic check is producing an error without any further note on how to resolve it.

In the log file I find one error:

{“reqId”:“P4U8SCSiL5E5xkOxLzQL”,“level”:3,“time”:“2021-01-15T11:55:28+00:00”,“remoteAddr”:“10.100.21.114”,“user”:“thomas”,“app”:“index”,“method”:“GET”,“url”:"/nextcloud/index.php/settings/ajax/checksetup",“message”:{“Exception”:“Doctrine\DBAL\Schema\SchemaException”,“Message”:“There is no column with name ‘parent’ on table ‘oc_share_external’.”,“Code”:30,“Trace”:[{“file”:"/media/dpool/nextcloud/www/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php",“line”:662,“function”:“columnDoesNotExist”,“class”:“Doctrine\DBAL\Schema\SchemaException”,“type”:"::"},{“file”:"/media/dpool/nextcloud/www/apps/settings/lib/Controller/CheckSetupController.php",“line”:660,“function”:“getColumn”,“class”:“Doctrine\DBAL\Schema\Table”,“type”:"->"},{“file”:"/media/dpool/nextcloud/www/apps/settings/lib/Controller/CheckSetupController.php",“line”:753,“function”:“hasBigIntConversionPendingColumns”,“class”:“OCA\Settings\Controller\CheckSetupController”,“type”:"->"},{“file”:"/media/dpool/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php",“line”:169,“function”:“check”,“class”:“OCA\Settings\Controller\CheckSetupController”,“type”:"->"},{“file”:"/media/dpool/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php",“line”:100,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/media/dpool/nextcloud/www/lib/private/AppFramework/App.php",“line”:152,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/media/dpool/nextcloud/www/lib/private/Route/Router.php",“line”:309,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/media/dpool/nextcloud/www/lib/base.php",“line”:1008,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/media/dpool/nextcloud/www/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/media/dpool/nextcloud/www/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php",“Line”:85,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0”,“version”:“20.0.5.2”}

Can you please support me to create this one missing field?

Info: I do not use or need the sharing possibilities

Same problem here!
I think since update NC19 -> NC20.
No need for external sharing. App was deactivated. Activated it now - no change!
Running 20.0.5

Bump. Our install is experiencing the same issues and users are seeing maintenance pages on the back of these errors.
We’ve restarted our server and disabled maintenance mode to no effect.
We’re on 20.0.4
Thank you

Does anyone have an update for this please?

Same problem here… I am using the Nextcloud snap package, and after the automatic upgrade from 19 to 20, it became literally useless, as the snap has gone into a restart loop now when the pre start script fails.

It fails during execution of:
$ cat /snap/nextcloud/25276/fixes/existing-install/maintenance/1_convert-filecache-bigint.sh
'-----------------------------------------------------------
'#!/bin/sh -e

'# Unfortunately convert-filecache-bigint requires that Nextcloud be in maintenance
'# mode, and can take some time.
'occ -n db:convert-filecache-bigint
'-----------------------------------------------------------

The error is reproducible by running the occ commnd manually:

$ nextcloud.occ -n db:convert-filecache-bigint

In SchemaException.php line 85:
There is no column with name ‘parent’ on table ‘oc_share_external’.
db:convert-filecache-bigint

I have checked the DB and the affected table is described as:

±----------------±--------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±----------------±--------------±-----±----±--------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| remote | varchar(512) | NO | | NULL | |
| remote_id | int(11) | NO | | -1 | |
| share_token | varchar(64) | NO | | NULL | |
| password | varchar(64) | YES | | NULL | |
| name | varchar(64) | NO | | NULL | |
| owner | varchar(64) | NO | | NULL | |
| user | varchar(64) | NO | MUL | NULL | |
| mountpoint | varchar(4000) | NO | | NULL | |
| mountpoint_hash | varchar(32) | NO | | NULL | |
| accepted | int(11) | NO | | 0 | |
±----------------±--------------±-----±----±--------±---------------+

I was searching for the DB schema description, but couldn’t find it yet.
Don’t want to create the column just as a matter of luck, likely with a wrong format for it to come back in future and say Hello again, even if it might be working as of now.

If anyone has an idea of where to possibly find the DB schema description, please let us know.
Or has one a working 20.0.4 instance to check the table description for us?
I can’t afford the time right now to do a fresh install in lab just to check what the table is supposed to look like.

Just as a FYI: the hope that the update to 20.0.6 would change anything was wrong.
I will now try to move my installation to a fresh, new instance … we’ll see if I can make this work :wink:

I have fixed it now. Had to do a fresh installation on a new VM just to see how the table is supposed to look like as I still couldn’t find any schema description. Quite annoying…

But my old installation is working again. You don’t have to migrate to a fresh instance.

Here what the table looks like on a fresh 20.0.4 installation:

±----------------±--------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±----------------±--------------±-----±----±--------±---------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| parent | bigint(20) | YES | | -1 | |
| share_type | int(11) | YES | | NULL | |
| remote | varchar(512) | NO | | NULL | |
| remote_id | varchar(255) | YES | | | |
| share_token | varchar(64) | NO | | NULL | |
| password | varchar(64) | YES | | NULL | |
| name | varchar(64) | NO | | NULL | |
| owner | varchar(64) | NO | | NULL | |
| user | varchar(64) | NO | MUL | NULL | |
| mountpoint | varchar(4000) | NO | | NULL | |
| mountpoint_hash | varchar(32) | NO | | NULL | |
| accepted | int(11) | NO | | 0 | |
±----------------±--------------±-----±----±--------±---------------+

They’ve done - or have not done, depending from where you actually look at it :wink: - 3 changes to that table.

2 new columns: parent, share_type
1 modified column: remote_id (type, null, default)

You just have to create these two new columns and modify the existing one and your nextcloud will be working fine again.

I have a mysql server running in the snap package, so what I have done is:

  1. connect to the DB server, in my case (using the snap): nextcloud.mysql-client
  2. change into the nextcloud DB: use nextcloud;
  3. create the “parent” column: alter table oc_share_external add parent bigint(20) NULL default -1 after id;
  4. create the “share_type” column: alter table oc_share_external add share_type int(11) NULL default NULL after parent;
  5. modify the “remote_id” column: alter table oc_share_external modify column remote_id varchar(255) NULL default '';

That’s it…

1 Like

Thanks Ste, I needed to wait a little longer for our NextCloud snap package to update but now it’s on 20.0.6 those mysql commands have fixed our woes!
You’re a hero, thanks again.

1 Like

Thanks for your feedback @anonymousbadger!
Happy that this resolved it for you as well :slight_smile:

1 Like