Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from Nextcloud 17 to 18 #18997

Closed
mat-l opened this issue Jan 19, 2020 · 16 comments
Closed

Update from Nextcloud 17 to 18 #18997

mat-l opened this issue Jan 19, 2020 · 16 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info

Comments

@mat-l
Copy link

mat-l commented Jan 19, 2020

Steps to reproduce

Expected behaviour

Update to 18

Actual behaviour

Update failed with error

Server configuration

Operating system:
Raspian
Web server:
Apache
Database:
MariaDB
PHP version:
7.4
Nextcloud version: (see Nextcloud admin page)
17.x
Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT `o`.`id` FROM `oc_flow_operations` `o` LEFT JOIN `oc_flow_operations_scope` `s` ON `o`.`id` = `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 Detaillierte Protokollmeldungen

Update vorbereiten

Log-Level auf "debug" gesetzt

Wartungsmodus eingeschaltet

Reparaturschritt: Repair MySQL collation

Reparaturinformation: All tables already have the correct collation -> nothing to do

Reparaturschritt: Repair SQLite autoincrement

Reparaturschritt: Copy data from accounts table when migrating from ownCloud

Reparaturschritt: Drop account terms table when migrating from ownCloud

Das Datenbankschema wird aktualisiert

Datenbank aktualisiert

Reparaturschritt: Migrate old user config

[1 / 0]: Migrate old user config

[2 / 0]: Migrate old user config

[2 / 2]: Migrate old user config

"accessibility" aktualisiert auf 1.4.0

"federatedfilesharing" aktualisiert auf 1.8.0

"files_pdfviewer" aktualisiert auf 1.7.0

"files_rightclick" aktualisiert auf 0.15.2

"files_videoplayer" aktualisiert auf 1.7.0

"logreader" aktualisiert auf 2.3.0

"password_policy" aktualisiert auf 1.8.0

"privacy" aktualisiert auf 1.2.0

"provisioning_api" aktualisiert auf 1.8.0

"recommendations" aktualisiert auf 0.6.0

"serverinfo" aktualisiert auf 1.8.0

"support" aktualisiert auf 1.1.0

"survey_client" aktualisiert auf 1.6.0

"text" aktualisiert auf 2.0.0

Reparaturschritt: Add background job to check for backup codes

"twofactor_backupcodes" aktualisiert auf 1.7.0

"updatenotification" aktualisiert auf 1.8.0

"federation" aktualisiert auf 1.8.0

"lookup_server_connector" aktualisiert auf 1.6.0

Reparaturschritt: Update OAuth token expiration times

"oauth2" aktualisiert auf 1.6.0

"files" aktualisiert auf 1.13.1

"activity" aktualisiert auf 2.11.0

"cloud_federation_api" aktualisiert auf 1.1.0

Reparaturschritt: Fix component of birthday calendars

Reparaturinformation: 1 birthday calendars updated.

Reparaturschritt: Regenerating birthday calendars to use new icons and fix old birthday events without year

Reparaturinformation: Adding background jobs to regenerate birthday calendar

Reparaturschritt: Fix broken values of calendar objects

[0 / 0]: Fix broken values of calendar objects

Reparaturschritt: Registering building of calendar search index as background job

Reparaturinformation: Add background job

Reparaturschritt: Registering background jobs to update cache for webcal calendars

Reparaturinformation: Added 0 background jobs to update webcal calendars

Reparaturschritt: Registering building of calendar reminder index as background job

Reparaturinformation: Add background job

Reparaturschritt: Clean up orphan event and contact data

Reparaturinformation: 0 events without a calendar have been cleaned up

Reparaturinformation: 0 properties without an events have been cleaned up

Reparaturinformation: 0 changes without a calendar have been cleaned up

Reparaturinformation: 0 cached events without a calendar subscription have been cleaned up

Reparaturinformation: 0 changes without a calendar subscription have been cleaned up

Reparaturinformation: 0 contacts without an addressbook have been cleaned up

Reparaturinformation: 0 properties without a contact have been cleaned up

Reparaturinformation: 0 changes without an addressbook have been cleaned up

Reparaturschritt: Remove activity entries of private events

Reparaturinformation: Removed 0 activity entries

"dav" aktualisiert auf 1.14.0

Reparaturschritt: Fix the share type of guest shares when migrating from ownCloud

Reparaturschritt: Copy the share password into the dedicated column

Reparaturschritt: Set existing shares as accepted

"files_sharing" aktualisiert auf 1.10.1

"files_trashbin" aktualisiert auf 1.8.0

"files_versions" aktualisiert auf 1.11.0

"sharebymail" aktualisiert auf 1.8.0

Reparaturschritt: Populating added database structures for workflows

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT o.id FROM oc_flow_operations o LEFT JOIN oc_flow_operations_scope s ON o.id = 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

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@mat-l mat-l added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 19, 2020
@tiny-pangolin
Copy link

tiny-pangolin commented Jan 20, 2020

I am having the same issue running the following stack

Operating system:
Ubuntu: 18.04.3
Web server:
Nginx
Database:
Postgres
PHP version:
7.3.13
Nextcloud version: (see Nextcloud admin page)
17.0.2

Error log:

Detailed logs

Preparing update

Set log level to debug

Turned on maintenance mode

Repair step: Repair MySQL collation

Repair info: Not a mysql database -> 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

Updating database schema

Updated database

Repair step: Populating added database structures for workflows

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT "o"."id" FROM "oc_flow_operations" "o" LEFT JOIN "oc_flow_operations_scope" "s" ON "o"."id" = "s"."operation_id" WHERE "s"."operation_id" IS NULL': SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "oc_flow_operations_scope" does not exist LINE 1: ... "o"."id" FROM "oc_flow_operations" "o" LEFT JOIN "oc_flow_o... ^

@RealOrangeOne
Copy link

I've hit the same issue, and because I didn't notice the weirdness for a while, broke my install.

Seems my install broke when doing the upgrade, installed a bad version of the settings app, and can't enable it from occ.

Might just be easier to do a full reinstall, which is annoying. Never had any upgrade issues before.

@suchAdemon
Copy link

suchAdemon commented Jan 20, 2020

Hello,
simmilar issue on my server
Operating system:
Debian:
Web server:
Apache 2.4
Database:
Postgres 12
PHP version:
7.3.11
Nextcloud version:
17.0.2

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT "o"."id" FROM "oc_flow_operations" "o" LEFT JOIN "oc_flow_operations_scope" "s" ON "o"."id" = "s"."operation_id" WHERE "s"."operation_id" IS NULL': SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "oc_flow_operations_scope" does not exist LINE 1: ... "o"."id" FROM "oc_flow_operations" "o" LEFT JOIN "oc_flow_o... ^

@kesselb
Copy link
Contributor

kesselb commented Jan 20, 2020

#18265 (comment)

@yasuoiwakura
Copy link

Same problem,
updated from NC16.0.0.9 to NC17 - no problem

then NC17 to NC18 using ./occ upgrade:

...
...
Updating <accessibility> ...
Migrate old user config

 Done
   12/12 [============================] 100%
Updated <accessibility> to 1.4.0
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.8.0
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 1.7.0
Updating <files_rightclick> ...
Updated <files_rightclick> to 0.15.2
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.8.0
Updating <text> ...
Updated <text> to 2.0.0
Updating <twofactor_backupcodes> ...
Updated <twofactor_backupcodes> to 1.7.0
Updating <viewer> ...
Updated <viewer> to 1.2.0
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 1.6.0
Updating <oauth2> ...
Updated <oauth2> to 1.6.0
Updating <files> ...
Updated <files> to 1.13.1
Updating <activity> ...
Updated <activity> to 2.11.0
Updating <cloud_federation_api> ...
Updated <cloud_federation_api> to 1.1.0
Updating <dav> ...
Fix broken values of calendar objects
 Done
    0/0 [>---------------------------]   0%
Updated <dav> to 1.14.0
Updating <files_sharing> ...
Updated <files_sharing> to 1.10.1
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.8.0
Updating <files_versions> ...
Updated <files_versions> to 1.11.0
Updating <sharebymail> ...
Updated <sharebymail> to 1.8.0
Updating <workflowengine> ...
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT `o`.`id` FROM `oc_flow_operations` `o` LEFT JOIN `oc_flow_operations_scope` `s` ON `o`.`id` = `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
Update failed
Maintenance mode is kept active
Reset log level

Description: Ubuntu 18.04.3 LTS
ii php 1:7.2+60ubuntu1 all server-side, HTML-embedded scripting language (default)
ii apache2 2.4.29-1ubuntu4.11 amd64 Apache HTTP Server
ii mysql-server 5.7.28-0ubuntu0.18.04.4 all MySQL database server (metapackage depending on the latest version)

@nilsjha
Copy link

nilsjha commented Jan 31, 2020

Can confirm identical issue when upgrading from 17 to 18 on Debian 10; (mariadb-server-10.3, PHP 7.3.11-1~deb10u1, nginx/1.14.2, redis-server 5:5.0.3-4+deb10u1). Restored fine to 17 from backup luckily

@echo-devnull
Copy link

Chiming in, also just had this with a fresh download:

Upgrading from 17.03 to 18:

Updating <dav> ...
Fix broken values of calendar objects
 Done
    0/0 [>---------------------------]   0%
Updated <dav> to 1.14.0
Updating <files_external> ...
Updated <files_external> to 1.9.0
Updating <files_sharing> ...
Updated <files_sharing> to 1.10.1
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.8.0
Updating <files_versions> ...
Updated <files_versions> to 1.11.0
Updating <sharebymail> ...
Updated <sharebymail> to 1.8.0
Updating <workflowengine> ...
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT `o`.`id` FROM `oc_flow_operations` `o` LEFT JOIN `oc_flow_operations_scope` `s` ON `o`.`id` = `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
Update failed
Maintenance mode is kept active
Reset log level

@kesselb
Copy link
Contributor

kesselb commented Feb 1, 2020

Let me guess. You downloaded nextcloud 18, extracted the update into nextcloud 17 folder and run upgrade? If so please have a look at my previous comment.

@echo-devnull
Copy link

Let me guess. You downloaded nextcloud 18, extracted the update into nextcloud 17 folder and run upgrade? If so please have a look at my previous comment.

No, I moved the old Nextcloud 17 folder to nextcloud.17 and extracted the 18 zip file. Then I copied the apps folder back into the now extracted version 18 nextcloud folder per instructions https://docs.nextcloud.com/server/18/admin_manual/maintenance/manual_upgrade.html Step 9.

After that the upgrade failed.

So I'm guessing one of the apps is at fault here?

@kesselb
Copy link
Contributor

kesselb commented Feb 1, 2020

Step 9 says to compare the folders and copy the apps not present. Please check the other thread for possible solutions.

@echo-devnull
Copy link

Step 9 says to compare the folders and copy the apps not present. Please check the other thread for possible solutions.

Agreed, so I redid the installation this time without copying any of the older apps. (Figured I'd just reinstall them from the web interface)

Installation still hit a few snags like:

You may use your browser or the occ upgrade command to do the upgrade                                                                                                                                                                                          
Set log level to debug                                                                                                                                                                                                                                         
Updating database schema                                                                                                                                                                                                                                       
Doctrine\DBAL\Schema\SchemaException: The table with name 'nextcloud.oc_direct_edit' already exists.                                                                                                                                                           
Update failed                                                                                                                                                                                                                                                  
Maintenance mode is kept active                                                                                                                                                                                                                                
Reset log level                                                                                                                                                                                                                                                
abc@e68101dea7d2:/config/www/nextcloud$ php occ upgrade                                                                                                                                                                                                        
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                                                                                                                                                                                          
Set log level to debug                                                                                                                                                                                                                                         
Updating database schema                                                                                                                                                                                                                                       
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_direct_edit (id BIGINT AUTO_INCREMENT NOT NULL, editor_id VARCHAR(64) NOT NULL, token VARCHAR(64) NOT NULL, file_id BIGINT NOT NULL, user_id VARCHAR(64) DEFAUL
T NULL, share_id BIGINT DEFAULT NULL, timestamp BIGINT UNSIGNED NOT NULL, accessed TINYINT(1) DEFAULT '0' NOT NULL, INDEX IDX_4D5AFECA5F37A13B (token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ENGINE = InnoDB ROW_FORMAT = compres
sed':                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                               
SQLSTATE[HY000]: General error: 1813 Tablespace for table '`nextcloud`.`oc_direct_edit`' exists. Please DISCARD the tablespace before IMPORT                                                                                                                   
Update failed                                                                                                                                                                                                                                                  
Maintenance mode is kept active                                                                                                                                                                                                                                
Reset log level              

But I just had to delete those and remove the mysql files.
Installation after that went fine, installed the apps back from thew webinterfrace and done!

@borekon
Copy link

borekon commented Feb 4, 2020

#18265 (comment)

That did the trick for me

@virusuk
Copy link

virusuk commented Feb 5, 2020

Ubuntu_
sudo -s
Go to nextcloud folder typical
cd / var / www
Move existing Nextcloud instance
mv nextcloud nextcloud17
download new nextcloud rep
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
unzip new release
tar -xjf latest.tar.bz2 -C / var / www && chown -R www-data: www-data / var / www / && rm -f latest.tar.bz2
copy your config files
sudo -u www-data cp nextcloud17 / config / config.php nextcloud / config /
update database
sudo -u www-data php / var / www / nextcloud / occ upgrade
optimize DB
sudo -u www-data php / var / www / nextcloud / occ db: add-missing-indices
sudo -u www-data php / var / www / nextcloud / occ db: convert-filecache-bigint

all working like a charm.
PS. you can delete nextcloud17 folder. Note do not keep your data in nextcloud folder

@kesselb
Copy link
Contributor

kesselb commented Feb 9, 2020

Everyone able to upgrade? Okay with you to close this one?

@kesselb kesselb closed this as completed Feb 9, 2020
@yasuoiwakura
Copy link

did exactly as you told

update database
sudo -u www-data php / var / www / nextcloud / occ upgrade
at this point i get:

   13/13 [============================] 100%
Checking for update of app sharerenamer in appstore
Checked for update of app "sharerenamer" in appstore
Checking for update of app sharingpath in appstore
Checked for update of app "sharingpath" in appstore
Checking for update of app socialsharing_email in appstore
Checked for update of app "socialsharing_email" in appstore
Checking for update of app spreed in appstore
Checked for update of app "spreed" in appstore
Repair error: Repair step 'OCA\Talk\Migration\FixNamespaceInDatabaseTables' is unknown
Repair error: Repair step 'OCA\Talk\Migration\CreateHelpCommand' is unknown
Repair error: Repair step 'OCA\Talk\Migration\ClearResourceAccessCache' is unknown
Repair error: Repair step 'OCA\Talk\Migration\CreateHelpCommand' is unknown
Checking for update of app talk_simple_poll in appstore
Checked for update of app "talk_simple_poll" in appstore
Checking for update of app terms_of_service in appstore
Checked for update of app "terms_of_service" in appstore
Create notifications for users that already logged in
 Done
   13/13 [============================] 100%

Does the repair error matter in any way? if not just close the topic.
upgraded from 17.0.3

@fmni2
Copy link

fmni2 commented Jun 4, 2020

No I have this message on the update
Doctrine\DBAL\Schema\SchemaException: The table with name 'db_nextcloud.oc_direct_edit' already exists.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info
Projects
None yet
Development

No branches or pull requests