powerpaul17 / nc_money

Nextcloud app for finance management
GNU Affero General Public License v3.0
96 stars 9 forks source link

Issue with importing csv #33

Open 1837456 opened 1 year ago

1837456 commented 1 year ago

Hello,

I could not import a complete csv file so I tried to import one by one row to find the problem and I have no idea why but this is the problematic one (all data are anonmized but have the same length and structure): Umsaetze_2023.01.04-neutral.csv

The import keeps spinning: Screenshot 2023-01-25 at 20 39 47

These are the error messages from the browser (the nextcloud log does not show anything related):

Screenshot 2023-01-25 at 20 38 21

Screenshot 2023-01-25 at 20 39 08

Nextcloud 25.0.3 Money App 0.13.0

Please let me know if you need more information.

powerpaul17 commented 1 year ago

Hello, thanks for the information. I don't see why the CSV should not work, it also seems to be a problem on the server (error 500), can you provide me with the relevant server logs please?

1837456 commented 1 year ago

It seems that I missed something last night looking at the nextcloud log. The "Verwendungszweck" column seems to be too long. And indeed, if I shorten that, I can import the csv without any problems and also the server doesn't show an error anymore.

Error OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1

/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 329:

OC\DB\Exceptions\DbalException::wrap()

/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php - line 139:

OC\DB\QueryBuilder\QueryBuilder->executeStatement()

/var/www/nextcloud/apps/money/lib/Service/TransactionService.php - line 66:

OCP\AppFramework\Db\QBMapper->insert()

/var/www/nextcloud/apps/money/lib/Controller/TransactionController.php - line 98:

OCA\Money\Service\TransactionService->create()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:

OCA\Money\Controller\TransactionController->addTransaction()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 172:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 298:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1047:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()

Caused by Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1780:

Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1719:

Doctrine\DBAL\Connection->handleDriverException()

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1173:

Doctrine\DBAL\Connection->convertExceptionDuringQuery()

/var/www/nextcloud/lib/private/DB/Connection.php - line 294:

Doctrine\DBAL\Connection->executeStatement()

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:

OC\DB\Connection->executeStatement()

/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 281:

Doctrine\DBAL\Query\QueryBuilder->execute()

/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 327:

OC\DB\QueryBuilder\QueryBuilder->execute()

/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php - line 139:

OC\DB\QueryBuilder\QueryBuilder->executeStatement()

/var/www/nextcloud/apps/money/lib/Service/TransactionService.php - line 66:

OCP\AppFramework\Db\QBMapper->insert()

/var/www/nextcloud/apps/money/lib/Controller/TransactionController.php - line 98:

OCA\Money\Service\TransactionService->create()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:

OCA\Money\Controller\TransactionController->addTransaction()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 172:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 298:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1047:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()

Caused by Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 94:

Doctrine\DBAL\Driver\PDO\Exception::new()

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1163:

Doctrine\DBAL\Driver\PDO\Statement->execute()

/var/www/nextcloud/lib/private/DB/Connection.php - line 294:

Doctrine\DBAL\Connection->executeStatement()

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:

OC\DB\Connection->executeStatement()

/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 281:

Doctrine\DBAL\Query\QueryBuilder->execute()

/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 327:

OC\DB\QueryBuilder\QueryBuilder->execute()

/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php - line 139:

OC\DB\QueryBuilder\QueryBuilder->executeStatement()

/var/www/nextcloud/apps/money/lib/Service/TransactionService.php - line 66:

OCP\AppFramework\Db\QBMapper->insert()

/var/www/nextcloud/apps/money/lib/Controller/TransactionController.php - line 98:

OCA\Money\Service\TransactionService->create()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:

OCA\Money\Controller\TransactionController->addTransaction()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 172:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 298:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1047:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()

Caused by PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php - line 92:

PDOStatement->execute()

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php - line 1163:

Doctrine\DBAL\Driver\PDO\Statement->execute()

/var/www/nextcloud/lib/private/DB/Connection.php - line 294:

Doctrine\DBAL\Connection->executeStatement()

/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php - line 354:

OC\DB\Connection->executeStatement()

/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 281:

Doctrine\DBAL\Query\QueryBuilder->execute()

/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 327:

OC\DB\QueryBuilder\QueryBuilder->execute()

/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php - line 139:

OC\DB\QueryBuilder\QueryBuilder->executeStatement()

/var/www/nextcloud/apps/money/lib/Service/TransactionService.php - line 66:

OCP\AppFramework\Db\QBMapper->insert()

/var/www/nextcloud/apps/money/lib/Controller/TransactionController.php - line 98:

OCA\Money\Service\TransactionService->create()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:

OCA\Money\Controller\TransactionController->addTransaction()

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 172:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 298:

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1047:

OC\Route\Router->match()

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()
powerpaul17 commented 1 year ago

Ok, this makes sense, thanks for the information. The app currently never checks the length of the strings :sweat_smile: I will add some checks for the input parameters.