The first error is in
echo "ALTER TABLE oc_flow_operations ADD COLUMN entity VARCHAR;" | sqlite3 $STORAGE_ROOT/owncloud/owncloud.db
Error: near line 1: duplicate column name: entity
OK, maybe I ran the setup twice, and you can only add a column so many times (*). So I commented out that line, and here’s what happened next:
`Upgrading to Nextcloud version 18.0.10
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000]  unable to open database file in /usr/local/lib/owncloud/lib/private/DB/Connection.php:68
#0 /usr/local/lib/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1040): OC\DB\Connection->connect()
[stack entries #1 through #47 omitted]`
The database file referenced in
setup/nextcloud.sh does exist, and
sqlite3 /home/user-data/owncloud/owncloud.db opens the database just fine (and btw, the
.schema command shows that the
ALTER TABLE worked and the new column is indeed in place). I’m not sure what db it’s trying to open that isn’t. Any suggestions on how to get past this?
Commenting out the
source nextcloud.sh line from
setup/start.sh allowed me to finish running the setup, reboot, and try again. I also did an
apt-get upgrade before all this.
(*) Maybe it’s worth adding a clause that if
sqlite3 $STORAGE_ROOT/owncloud/owncloud.db ".schema" | grep 'oc_flow_operations.*entity'
returns 0, skip the
ALTER TABLE step?