julien-nc / cospend-nc

💰 💲hared budget manager Nextcloud app
GNU Affero General Public License v3.0
213 stars 29 forks source link

Cannot install / run Cospend #252

Closed mmallejac closed 5 months ago

mmallejac commented 5 months ago

Hello !

We're trying to use Cospend on our Nextcloud version 27.1.5 In the past - around 2020 - we had already given it a try, but it wasn't ready enough for us.

Since it has been already installed in the past, the re-installation was not straightforward, I had to create table oc_cospend_categories(id, int); so that the install can go on.

But something else must be wrong, since this is what I get when creating a first new project: image

And in the nextcloud.log file:

{"reqId":"Efzx40Q1TECuIG13H6QL","level":0,"time":"2024-01-15T15:14:49+00:00","remoteAddr":"216.228.214.224","user":"--","app":"PHP","method":"POST","url":"/index.php/apps/cospend/projects","message":"Creation of dynamic property OCA\\Welcome\\AppInfo\\Application::$config is deprecated at /var/www/html/apps/welcome/lib/AppInfo/Application.php#30","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"27.1.5.1","data":{"app":"PHP"}} {"reqId":"Efzx40Q1TECuIG13H6QL","level":3,"time":"2024-01-15T15:14:49+00:00","remoteAddr":"216.228.214.224","user":"adm4next","app":"index","method":"POST","url":"/index.php/apps/cospend/projects","message":"Exception thrown: OC\\DB\\Exceptions\\DbalException","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"27.1.5.1","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'projectid' in 'field list'","Code":1054,"Trace":[{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":328,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::","args":[["Doctrine\\DBAL\\Exception\\InvalidFieldNameException"]]},{"file":"/var/www/html/apps/cospend/lib/Db/ProjectMapper.php","line":93,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/apps/cospend/lib/Service/ProjectService.php","line":417,"function":"createProject","class":"OCA\\Cospend\\Db\\ProjectMapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/cospend/lib/Controller/PageController.php","line":457,"function":"createProject","class":"OCA\\Cospend\\Service\\ProjectService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"webCreateProject","class":"OCA\\Cospend\\Controller\\PageController","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Cospend\\Controller\\PageController","webCreateProject",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["cospend.page.webCreateProject"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/cospend/projects"]},{"file":"/var/www/html/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/DB/Exceptions/DbalException.php","Line":71,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\InvalidFieldNameException","Message":"An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'projectid' in 'field list'","Code":1054,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1814,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1749,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],"INSERT INTOoc_cospend_categories(projectid,encoded_icon,color,name) VALUES(?, ?, ?, ?)",["*** sensitive parameters replaced ***","%F0%9F%9B%92","#ffaa00","*** sensitive parameters replaced ***"],[2,2,2,2]]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":295,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["INSERT INTOoc_cospend_categories(projectid,encoded_icon,color,name) VALUES(?, ?, ?, ?)",["*** sensitive parameters replaced ***","%F0%9F%9B%92","#ffaa00","*** sensitive parameters replaced ***"],[2,2,2,2]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["INSERT INTOoc_cospend_categories(projectid,encoded_icon,color,name) VALUES(:dcValue8, :dcValue9, :dcValue10, :dcValue11)",["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","","*** sensitive parameters replaced ***",1705331689,"*** sensitive parameters replaced ***","%F0%9F%9B%92","#ffaa00","*** sensitive parameters replaced ***"],[2,2,2,2,2,2,1,2,2,2,2]]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/apps/cospend/lib/Db/ProjectMapper.php","line":93,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/apps/cospend/lib/Service/ProjectService.php","line":417,"function":"createProject","class":"OCA\\Cospend\\Db\\ProjectMapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/cospend/lib/Controller/PageController.php","line":457,"function":"createProject","class":"OCA\\Cospend\\Service\\ProjectService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"webCreateProject","class":"OCA\\Cospend\\Controller\\PageController","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Cospend\\Controller\\PageController","webCreateProject",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["cospend.page.webCreateProject"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/cospend/projects"]},{"file":"/var/www/html/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":69,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'projectid' in 'field list'","Code":1054,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":103,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::","args":[["PDOException",["42S22",1054,"Unknown column 'projectid' in 'field list'"]]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1153,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":295,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["INSERT INTOoc_cospend_categories(projectid,encoded_icon,color,name) VALUES(?, ?, ?, ?)",["*** sensitive parameters replaced ***","%F0%9F%9B%92","#ffaa00","*** sensitive parameters replaced ***"],[2,2,2,2]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["INSERT INTOoc_cospend_categories(projectid,encoded_icon,color,name) VALUES(:dcValue8, :dcValue9, :dcValue10, :dcValue11)",["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","","*** sensitive parameters replaced ***",1705331689,"*** sensitive parameters replaced ***","%F0%9F%9B%92","#ffaa00","*** sensitive parameters replaced ***"],[2,2,2,2,2,2,1,2,2,2,2]]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/apps/cospend/lib/Db/ProjectMapper.php","line":93,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/apps/cospend/lib/Service/ProjectService.php","line":417,"function":"createProject","class":"OCA\\Cospend\\Db\\ProjectMapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/cospend/lib/Controller/PageController.php","line":457,"function":"createProject","class":"OCA\\Cospend\\Service\\ProjectService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"webCreateProject","class":"OCA\\Cospend\\Controller\\PageController","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Cospend\\Controller\\PageController","webCreateProject",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["cospend.page.webCreateProject"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/cospend/projects"]},{"file":"/var/www/html/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":30,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'projectid' in 'field list'","Code":"42S22","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":101,"function":"execute","class":"PDOStatement","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1153,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":295,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["INSERT INTOoc_cospend_categories(projectid,encoded_icon,color,name) VALUES(?, ?, ?, ?)",["*** sensitive parameters replaced ***","%F0%9F%9B%92","#ffaa00","*** sensitive parameters replaced ***"],[2,2,2,2]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["INSERT INTOoc_cospend_categories(projectid,encoded_icon,color,name) VALUES(:dcValue8, :dcValue9, :dcValue10, :dcValue11)",["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","","*** sensitive parameters replaced ***",1705331689,"*** sensitive parameters replaced ***","%F0%9F%9B%92","#ffaa00","*** sensitive parameters replaced ***"],[2,2,2,2,2,2,1,2,2,2,2]]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/apps/cospend/lib/Db/ProjectMapper.php","line":93,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/apps/cospend/lib/Service/ProjectService.php","line":417,"function":"createProject","class":"OCA\\Cospend\\Db\\ProjectMapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/cospend/lib/Controller/PageController.php","line":457,"function":"createProject","class":"OCA\\Cospend\\Service\\ProjectService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"webCreateProject","class":"OCA\\Cospend\\Controller\\PageController","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Cospend\\Controller\\PageController"],"webCreateProject"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Cospend\\Controller\\PageController","webCreateProject",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["cospend.page.webCreateProject"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/cospend/projects"]},{"file":"/var/www/html/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":101}}},"CustomMessage":"Exception thrown: OC\\DB\\Exceptions\\DbalException"}}

I guess some more cleanup should be done here !

Thanks in advance, Michel

julien-nc commented 5 months ago

Have you performed any manual change in your database schema after you tried the app in 2020? Like dropping the oc_cospend_categories table? If so, Nextcloud won't recreate it because it won't trigger the related migration step again.

To get a clean start, drop oc_cospend_* tables and delete all Cospend migration steps in oc_migrations:

DROP TABLE oc_cospend_bill_owers;
DROP TABLE oc_cospend_bills;
DROP TABLE oc_cospend_categories;
DROP TABLE oc_cospend_currencies;
DROP TABLE oc_cospend_members;
DROP TABLE oc_cospend_paymentmodes;
DROP TABLE oc_cospend_projects;
DROP TABLE oc_cospend_shares;
DELETE FROM oc_migrations WHERE app=cospend;

Then install/enable Cospend again. Any better?

mmallejac commented 5 months ago

Great ! I am now able to create a new project. I haven't been further than that, but it should be good now. Thanks a lot for your kind help Michel

julien-nc commented 5 months ago

@mmallejac You're welcome. I'm still curious to know if you had manually dropped the oc_cospend_categories table after you tried the app in 2020.

mmallejac commented 5 months ago

No, I don't think so. In 2020, someone asked to install Cospend so that he could test it, then they told me they would not use it so I simply removed the app.