Repository navigation
Description
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- start occ upgrade
Expected behaviour
occ upgrade should be completed.
Actual behaviour
InvalidArgumentException: Column name oc_flow_operations.entity is NotNull, but has empty string or null as default.
Server configuration
Operating system:
Ubuntu Linux 20.04
Web server:
N/A (not used)
Database:
postgresql 11
PHP version:
7.4
Nextcloud version: (see Nextcloud admin page)
20.0.0
Updated from an older Nextcloud/ownCloud or fresh install:
Fresh install with manual DB upgrade 17.0.3.1
Where did you install Nextcloud from:
https://download.nextcloud.com/server/releases/nextcloud-20.0.0.zip
Signing status:
Signing status
Results ======= - core - INVALID_HASH - lib/private/DB/MigrationService.php REMARK ======= In order to proceed with the migration I had to PATCH the script above. It simply reverts the commit #5023084 (Sept. 7, 2020). I cannot reproduce the original list any more: It must have been empty though.List of activated apps:
App list
- accessibility: 1.6.0 - activity: 2.13.1 - cloud_federation_api: 1.3.0 - comments: 1.10.0 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.0 - federatedfilesharing: 1.10.1 - federation: 1.10.1 - files: 1.15.0 - files_pdfviewer: 2.0.1 - files_rightclick: 0.17.0 - files_sharing: 1.12.0 - files_trashbin: 1.10.1 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - nextcloud_announcements: 1.9.0 - notifications: 2.8.0 - oauth2: 1.8.0 - password_policy: 1.10.1 - photos: 1.2.0 - privacy: 1.4.0 - provisioning_api: 1.10.0 - recommendations: 0.8.0 - serverinfo: 1.10.0 - settings: 1.2.0 - sharebymail: 1.10.0 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - text: 3.1.0 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - updatenotification: 1.10.0 - user_status: 1.0.0 - viewer: 1.4.0 - weather_status: 1.0.0 - workflowengine: 2.2.0Nextcloud configuration:
Config report
{ "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "20.0.0.9", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "updater.secret": "***REMOVED SENSITIVE VALUE***", "maintenance": false, "theme": "", "loglevel": 2 } }Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no
Client configuration
Browser:
N/A
Operating system:
N/A
Activity
darian-heede commentedon Oct 7, 2020
I solved this issue. First off, my setup is probably different than @dbtech as I'm running nextcloud and the postgres database in docker containers. As the described issue lies within a table in the postgres database, the fix should work for every kind of setup though.
The error message implies that there is an issue with the default of column
entityin tableoc_flow_operations. It turns out the columnentitywas missing from the table entirely. Hence, I just added the column to the table. The following steps solved the issue:sudo docker exec -it <nextcloud-database> psql -U <database-user>This step is obviously specific to my type of setup but should be easily adapted for any other.
\c <database-name>SELECT entity FROM oc_flow_operations;If this command returns
ERROR: column "entity" does not existI hope this helps.
dbtech commentedon Oct 7, 2020
Sorry @darian-heede, you misunderstand the issue. The error occurs after the "entity" column has been added with a default value of the empty string, i.e >''<. This is part of the database migration. The lib/private/DB/MigrationService.php script will verify if the default value is not null and not empty. This cannot succeed and an exception is raised. The column definition and the verification logic contradict each other and at least one of them should be corrected.
kbuc commentedon Oct 8, 2020
I just got this error while upgrading from 17.0.10 to 18.0.10. Also with me, the column entity did not exist (but the error message was the same). Added it with:
alter table oc_flow_operations add column entity character varying(256) not null;then
occ updatefinished the job.dbtech commentedon Oct 8, 2020
Please be aware that the reported error is unrelated to any versions below 20.0.0. The error may occur only after Sep 7, 2020, due to the commit 5023084. For this reason I have strong doubts that @kbuc could have experienced the very same error in the versions 17 and 18.
kbuc commentedon Oct 8, 2020
@dbtech Yes, I experienced it today when updating from 17.0.9. It first updated to 17.0.10, then it wanted to update to 18.0.10 and this happened.
As it seems, 17.0.10 release has today's date, so it might contain the mentioned commit?
Cybso commentedon Oct 8, 2020
Confirmed for upgrading from 17.0.10 to 18.0.10. Adding the column manually resolved the issue.
dbtech commentedon Oct 8, 2020
FYI: today's version of 17.0.10 does NOT contain the offending commit. Actually it would be weird if it did. I assume that the release was extracted today with the correct tag. Of course, I do not doubt that there might be similar errors in earlier releases. The reported error is brand new.
Cybso commentedon Oct 8, 2020
@dbtech I did the updates a few hours ago. First from 17.0.2 to 17.0.10, which went fine, and then to 18.0.10, which produced that error.
dbtech commentedon Oct 8, 2020
OK, I see a long series of comments above. Two of them refer "this" or "that" error during a migration to release 17.0.10. What was the error message exactly?
Cybso commentedon Oct 8, 2020
I've closed the console window already, but I've googled for:
"InvalidArgumentException: Column name "oc_flow_operations"."entity" is NotNull, but has empty string or null as default"EDIT: Oh, and it was a migration FROM 17.0.10 to 18.0.10. The migration TO 17.0.10 was fine.
mtapoja commentedon Oct 8, 2020
Same here, adding the column seems to fix the issue and next manual upgrade succeeded.
38 remaining items
grisu48 commentedon Nov 14, 2020
Also affected by this bug but could fix it by adding the missing column manually as suggested:
CaptPicardFR commentedon Nov 16, 2020
ALTER TABLE oc_flow_operations ADD COLUMN entity VARCHAR; > error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
alter table oc_flow_operations add column entity character varying(256) not null; > OK !!!! MANY THANKS UPGRADE ok
Kinamo commentedon Nov 16, 2020
Works perfectly for MySQL / MariaDB!
Update Version2000Date20190808074233.php
ChadGnad commentedon Nov 22, 2020
This...this worked for me...it looks like someone removed the " and added ' ' but there was no space between. so I found <space ''> and did <space 'space'>
Gaertjen commentedon Dec 7, 2020
I'm sorry, I'm new here and do not understand very well, how you fixed it. I can't enter any commands? I just got the web interface to update the nextcloudsoftware, when I update to 18.0.11 it shows
InvalidArgumentException: Column name "nc_5047_flow_operations"."entity" is NotNull, but has empty string or null as default.
But I don't understand how to fix it. I'm really sorry, can anybody help me?
blizzz commentedon Dec 7, 2020
apply the changes from https://github.com/nextcloud/server/pull/24315/files and rerun the upgrade
Gaertjen commentedon Dec 13, 2020
thank you very much, I tried this but now it shows the following report. I am a bit confused
prepare Update
Log-Level Set to "debug"
Maintenance mode switched on
Repair steo: Repair MySQL collation
Repair information: All tables already have the correct collation -> nothing to do
Repair step: Repair SQLite autoincrement
Repair step: Copy data from accounts table when migrating from ownCloud
Repair step: Drop account terms table when migrating from ownCloud
The database schema is updated
Database updated
An error has occurred.
blizzz commentedon Dec 15, 2020
check the nextcloud.log
Gaertjen commentedon Dec 16, 2020
can you tell me what to check? if it's there?
blizzz commentedon Dec 16, 2020
An exception most likely.
Gaertjen commentedon Dec 17, 2020
I found it, but it's empty. there is also a "updater.log". can this file help? and thank you for your great patience <3
Gaertjen commentedon Dec 29, 2020
@blizzz do you have any ideas? or do you know how I can save the data in this situation?
blizzz commentedon Jan 4, 2021
it should not be empty. do you have the correct one? it should be in your data directory.