You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documents won't open after upgrade to version 3.5.3 #917
Describe the bug
Documents won't open after upgrading to version 3.5.3.
To Reproduce
Steps to reproduce the behavior:
Upgrade to version 3.5.3
Try to create or open a document
It won't open
You will see in the log:
"/index.php/apps/richdocuments/indexTemplate?templateId=194402&fileName=Nuevo%20Documento.docx&dir=%2F&requesttoken=1hQrJbH4MLlQ3QvI2TqZDdXCScJ6ZYRUk7wSei2BnB4%3D%3AnHlGDvrNSvYnukqviG%2FVQ%2BOXO4xRMsUf%2FoRoLE%2FH6Cg%3D","message":{"Exception":"Doctrine\DBAL\Exception\InvalidFieldNameException","Message":"An exception occurred while executing 'INSERT INTO oc_richdocuments_wopi(fileid,owner_uid,editor_uid,version,canwrite,server_host,token,expiry,template_destination,hide_download,direct,is_remote_token,template_id) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)' with params [194402, "xubium", "xubium", 0, true, "https:\/\/\/", "hw8aTK2qJ8iFvG1ZVfcHUGK07NOs9P6N", 1587528003, 234882, false, false, false, 0]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'template_id' in 'field list'","Code":0,"Trace":
It seems that the migration contained in /lib/Migration/Version2060Date20200302131958.php is not correctly executed when upgrading. That migration adds the missing column:
I don't have the logs, but I will try to recreate the scenario from a backup and send you the information. By the way, thera are questions about this in the Nextcloud forum, it is not just me having the issue. I upgraded from 3.5.2 to 3.5.3.
Give me until today EOD to try to get you the logs.
Thanks for the support.
Hello,
I can't find errors in the logs, and I jus installed a fresh Nextcloud to test and the 3.5.3 version is working ok on the fresh install.
To solve this issue, would it be ok if I disable & delete the app, then delete oc_richdocuments_* tables from the database, and install again?
Thanks
The output of occ migrations:status richdocuments before executing occ migrations:migrate richdocuments is:
>> App: richdocuments
>> Version Table Name: oc_migrations
>> Migrations Namespace: OCA\Richdocuments\Migration
>> Migrations Directory: /mnt/www2/xubium/nextcloud/apps/richdocuments/lib/Migration
>> Previous Version: 2060Date20200302131958
>> Current Version: 2060Date20200302132145
>> Next Version: Already at latest migration step
>> Latest Version: 2060Date20200302132145
>> Executed Migrations: 2
>> Executed Unavailable Migrations: 2
>> Available Migrations: 2
>> New Migrations: 2
>> Pending Migrations: None
Then I executed occ migrations:migrate richdocuments, it didn't produce any output, it didn't fix the problem, and occ migrations:status richdocuments produces the exact same output.
So to fix this, I could uninstall the App, delete from the DB the tables oc_richdocuments_* and then install again, right?
Hm that is really odd, the only way I can see this could happen is if someone upgrades from 3.4.x to 3.5.3 directly as then the migration would not create the column.
In my case, I tried setting up collabora a few months ago but couldn't get it to work for unknown reasons. Now I am experiencing the same error as above.
It would work if I uninstall, delete from the DB the tables oc_richdocuments_* and then install the app, right?
Yes, but in addition you also need to clear the migrations for richdocuments, so it should be the following steps:
disable app
remove app folder
run the following sql statements:
drop table oc_richdocuments_direct;
drop table oc_richdocuments_wopi;
drop table oc_richdocuments_assets;
delete from oc_migrations where app='richdocuments';
reinstall the app
Reacted by iexos, Oracle_SOD, Jan Kosyk, BornToBeRoot, husisusi, Kaido, 4001982248998, Alexander Rusa, cain05, Pierre-Alain Bandinelli and 6 more
Reacted by Thea Tischbein
Reacted by umläute, BornToBeRoot, husisusi, Unai Tolosa Pontesta, Thorian93 and Édouard
So as you can see, it thinks it has run all migrations, but the column has not been created.
I unfortunately don't remember which exact Collabora Online app version I had before I upgraded.
Please let me know how to proceed in this situation. Should I add the missing column manually? EDIT: Nevermind @juliushaertl, now I saw your instructions at #917 (comment) . They worked fine 👍 But I believe you forgot the oc_richdocuments_member table, that should also be dropped right?
It would work if I uninstall, delete from the DB the tables oc_richdocuments_* and then install the app, right?
Yes, but in addition you also need to clear the migrations for richdocuments, so it should be the following steps:
disable app
remove app folder
run the following sql statements:
drop table oc_richdocuments_direct;
drop table oc_richdocuments_wopi;
drop table oc_richdocuments_assets;
delete from oc_migrations where app='richdocuments';
To add two small details to the instructions from @MollyBe (which are great!):
The database tables may or may not have the oc_ prefix in their name. In my case they didn't (the database is exclusive to Nextcloud, so no prefix needed), so the tables were named just richdocuments_direct, richdocuments_wopi et.c
Don't forget the oc_richdocuments_member table. This was left out in @juliushaertl's original instructions, but I believe it should be removed too.
Installing the app using the web ui as admin doesn't work (see the last section of this post). I disabled and uninstalled the app (which seems incomplete installed by the web ui) again and installed it using the occ cli:
This was much faster and doesn't produce any DB errors. Now I need to open /index.php/settings/admin/richdocuments and just click "save". My collabora url was already present there, but it shows a connection error which was gone after re-saving (seems caused by the reinstall). Now it works well again :)
Original Post
I tried the provided instructions of reinstalling the app. But at the end after installing the app, I got the following error:
An exception occurred while executing 'INSERT INTO oc_migrations (app,version) SELECT ?,? FROM oc_migrations WHERE app = ? AND version = ? HAVING COUNT(*) = 0' with params ["richdocuments", "2060Date20200302131958", "richdocuments", "2060Date20200302131958"]: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
In the logs are more details:
[settings] Error: Doctrine\DBAL\Exception\LockWaitTimeoutException: An exception occurred while executing 'INSERT INTO `oc_migrations` (`app`,`version`) SELECT ?,? FROM `oc_migrations` WHERE `app` = ? AND `version` = ? HAVING COUNT(*) = 0' with params ["richdocuments", "2060Date20200302131958", "richdocuments", "2060Date20200302131958"]:
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction at <<closure>>
0. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169
Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException("An exception oc ... n", Doctrine\DBAL\Dr ... ]})
1. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 145
Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "An exception oc ... n")
2. /var/www/html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1063
Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "INSERT INTO `oc ... 0", {1: "richdocumen ... "})
3. /var/www/html/lib/private/DB/Connection.php line 216
Doctrine\DBAL\Connection->executeUpdate("INSERT INTO `oc ... 0", ["richdocuments" ... "], [])
4. /var/www/html/lib/private/DB/Adapter.php line 120
OC\DB\Connection->executeUpdate("INSERT INTO `oc ... 0", ["richdocuments" ... "])
5. /var/www/html/lib/private/DB/Connection.php line 257
OC\DB\Adapter->insertIfNotExist("*PREFIX*migrations", {app: "richdocum ... "}, ["app","version"])
6. /var/www/html/lib/private/DB/MigrationService.php line 291
OC\DB\Connection->insertIfNotExist("*PREFIX*migrations", {app: "richdocum ... "})
7. /var/www/html/lib/private/DB/MigrationService.php line 493
OC\DB\MigrationService->markAsExecuted("2060Date20200302131958")
8. /var/www/html/lib/private/DB/MigrationService.php line 411
OC\DB\MigrationService->executeStep("2060Date20200302131958", false)
9. /var/www/html/lib/private/Installer.php line 146
OC\DB\MigrationService->migrate()
10. /var/www/html/settings/Controller/AppSettingsController.php line 447
OC\Installer->installApp("richdocuments")
11. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 170
OC\Settings\Controller\AppSettingsController->enableApps(["richdocuments"], [])
12. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 99
OC\AppFramework\Http\Dispatcher->executeController(OC\Settings\Cont ... {}, "enableApps")
13. /var/www/html/lib/private/AppFramework/App.php line 126
OC\AppFramework\Http\Dispatcher->dispatch(OC\Settings\Cont ... {}, "enableApps")
14. /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
OC\AppFramework\App::main("OC\\Settings\\C ... r", "enableApps", OC\AppFramework\ ... {}, {_route: "settin ... "})
15. <<closure>>
OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "settin ... "})
16. /var/www/html/lib/private/Route/Router.php line 297
undefinedundefinedcall_user_func(OC\AppFramework\ ... {}, {_route: "settin ... "})
17. /var/www/html/lib/base.php line 997
OC\Route\Router->match("/settings/apps/enable")
18. /var/www/html/index.php line 42
OC::handleRequest()
POST /index.php/settings/apps/enable
from 192.168.10.8 by admin-user at 2020-07-11T16:25:40+00:00
I had exactly the issue described here on a NC. Maybe collabora was installed in the past (maybe in 2017 or something) on the instance. I had to do exactly what was mentioned above:
disable app
remove app folder
run the following sql statements:
drop table oc_richdocuments_direct;
drop table oc_richdocuments_wopi;
drop table oc_richdocuments_assets;
delete from oc_migrations where app='richdocuments';
Activity
juliusknorr commentedon Apr 22, 2020
Do you still have logs from the app update? I cannot see why the migration would not run.
XUBIUM commentedon Apr 22, 2020
I don't have the logs, but I will try to recreate the scenario from a backup and send you the information. By the way, thera are questions about this in the Nextcloud forum, it is not just me having the issue. I upgraded from 3.5.2 to 3.5.3.
Give me until today EOD to try to get you the logs.
Thanks for the support.
XUBIUM commentedon Apr 23, 2020
Hello,
I can't find errors in the logs, and I jus installed a fresh Nextcloud to test and the 3.5.3 version is working ok on the fresh install.
To solve this issue, would it be ok if I disable & delete the app, then delete oc_richdocuments_* tables from the database, and install again?
Thanks
juliusknorr commentedon Apr 23, 2020
Running
occ migrations:migrate richdocumentsshould already do the trick to fix a installation where the migration has not been running.Could you maybe check the output of
occ migrations:status richdocumentsupfront?XUBIUM commentedon Apr 23, 2020
Hello,
The output of occ migrations:status richdocuments before executing occ migrations:migrate richdocuments is:
Then I executed occ migrations:migrate richdocuments, it didn't produce any output, it didn't fix the problem, and occ migrations:status richdocuments produces the exact same output.
So to fix this, I could uninstall the App, delete from the DB the tables oc_richdocuments_* and then install again, right?
Let me know if I can do more testing to help.
juliusknorr commentedon Apr 24, 2020
Hm that is really odd, the only way I can see this could happen is if someone upgrades from 3.4.x to 3.5.3 directly as then the migration would not create the column.
XUBIUM commentedon Apr 24, 2020
It would work if I uninstall, delete from the DB the tables oc_richdocuments_* and then install the app, right?
iexos commentedon Apr 24, 2020
Please see also the help topic at here:
https://help.nextcloud.com/t/error-when-starting-collabora-insert-into-oc-richdocuments-wopi/77451
In my case, I tried setting up collabora a few months ago but couldn't get it to work for unknown reasons. Now I am experiencing the same error as above.
juliusknorr commentedon Apr 24, 2020
Yes, but in addition you also need to clear the migrations for richdocuments, so it should be the following steps:
drop table oc_richdocuments_direct;
drop table oc_richdocuments_wopi;
drop table oc_richdocuments_assets;
delete from oc_migrations where app='richdocuments';
SimplyCorbett commentedon Apr 24, 2020
Can confirm, upgrading from 18.0.3 to 18.0.4 causes collabora to not open documents anymore.
estan commentedon Apr 24, 2020
I can confirm this problem, running Nextcloud 18.0.4, Collabora Online 3.5.3.
The log shows:
Here's
occ migrations:status richdocumentsand the MySQL table described:So as you can see, it thinks it has run all migrations, but the column has not been created.
I unfortunately don't remember which exact Collabora Online app version I had before I upgraded.
Please let me know how to proceed in this situation. Should I add the missing column manually? EDIT: Nevermind @juliushaertl, now I saw your instructions at #917 (comment) . They worked fine 👍 But I believe you forgot the
oc_richdocuments_membertable, that should also be dropped right?mhow2 commentedon Apr 28, 2020
Same problem here ! Please could you post the official and complete fix ?
oraclesod commentedon Apr 29, 2020
This resolved it for me, thank you
XUBIUM commentedon May 4, 2020
Hello,
I realize I never confirmed that the procedure also fixed the issue in my instance. Thanks Julius.
MollyBe commentedon May 10, 2020
@foormea
disable app:
remove app folder:
docker exec -it nextcloud /bin/bashrm -rf /data/appdata*/richdocumentsrun the following sql statements:
docker exec -it mariadb /bin/bashmariadb -pand then enter the password.mariadb use nextclouddrop table oc_richdocuments_direct;drop table oc_richdocuments_wopi;drop table oc_richdocuments_assets;delete from oc_migrations where app='richdocuments';Go back to your NextCloud App's page, and as admin reinstall the app - Collabora Online.
I can confirm this works.
estan commentedon May 10, 2020
To add two small details to the instructions from @MollyBe (which are great!):
The database tables may or may not have the
oc_prefix in their name. In my case they didn't (the database is exclusive to Nextcloud, so no prefix needed), so the tables were named justrichdocuments_direct,richdocuments_wopiet.cDon't forget the
oc_richdocuments_membertable. This was left out in @juliushaertl's original instructions, but I believe it should be removed too.mhow2 commentedon May 11, 2020
Thank you all ! I still have an innocent question : is the bug that triggers the current issue has been fixed ?
arusa commentedon Jul 2, 2020
This even happened to a completely fresh install of the richdocuments app on nextcloud 18.0.4
There must be something wrong with the migrations...
DMW007 commentedon Jul 11, 2020
Update: Was resolved using CLI
Installing the app using the web ui as admin doesn't work (see the last section of this post). I disabled and uninstalled the app (which seems incomplete installed by the web ui) again and installed it using the
occcli:This was much faster and doesn't produce any DB errors. Now I need to open /index.php/settings/admin/richdocuments and just click "save". My collabora url was already present there, but it shows a connection error which was gone after re-saving (seems caused by the reinstall). Now it works well again :)
Original Post
I tried the provided instructions of reinstalling the app. But at the end after installing the app, I got the following error:
In the logs are more details:
Nextcloud 17.0.7 is installed.
pierre-alain-b commentedon Sep 13, 2020
I had exactly the issue described here on a NC. Maybe collabora was installed in the past (maybe in 2017 or something) on the instance. I had to do exactly what was mentioned above:
Thanks @juliushaertl !