Error when creating an invoice
normen opened this issue · 3 comments
normen commented
Describe the bug
When pressing the button to create an invoice theres a 500
server error. The invoice is created nonetheless.
To Reproduce
Steps to reproduce the behavior:
- Open Gestion
- Click on 'Add Invoice'
- See Error
- See that invoice is created anyway
Expected behavior
The invoice should be created without error.
Logs
[index] Fehler: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[42883]: Undefined function: 7 ERROR: function last_insert_id() does not exist
LINE 1: SELECT LAST_INSERT_ID();
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts. at <<closure>>
0. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1780
Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
1. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1719
Doctrine\DBAL\Connection->handleDriverException(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
2. /var/www/html/3rdparty/doctrine/dbal/src/Statement.php line 193
Doctrine\DBAL\Connection->convertExceptionDuringQuery(Doctrine\DBAL\Driver\PDO\Exception {}, "SELECT LAST_INSERT_ID();", [], [])
3. /var/www/html/lib/private/DB/PreparedStatement.php line 87
Doctrine\DBAL\Statement->execute([])
5. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 314
OC\DB\PreparedStatement->execute([])
6. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 262
OCA\Gestion\Db\Bdd->execSQLNoJsonReturn("SELECT LAST_INSERT_ID();", [])
7. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 115
OCA\Gestion\Db\Bdd->lastinsertid()
8. /var/www/html/custom_apps/gestion/lib/Controller/PageController.php line 279
OCA\Gestion\Db\Bdd->insertFacture("megalith")
9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 225
OCA\Gestion\Controller\PageController->insertFacture()
10. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 133
OC\AppFramework\Http\Dispatcher->executeController(OCA\Gestion\Controller\PageController {}, "insertFacture")
11. /var/www/html/lib/private/AppFramework/App.php line 172
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Gestion\Controller\PageController {}, "insertFacture")
12. /var/www/html/lib/private/Route/Router.php line 298
OC\AppFramework\App::main("OCA\\Gestion\\C ... r", "insertFacture", OC\AppFramework\ ... {}, ["gestion.page.insertFacture"])
13. /var/www/html/lib/base.php line 1030
OC\Route\Router->match("/apps/gestion/facture/insert")
14. /var/www/html/index.php line 36
OC::handleRequest()
POST /apps/gestion/facture/insert
from 2003:d7:1708:a400:915:afc6:c9e1:2c4 by megalith at 2022-11-13T17:29:09+00:00
Nextcloud
- Version 24.0.7 (PHP-FPM Docker)
Desktop (please complete the following information):
- OS: iOS, MacOS
- Browser Safari
- Version 16
Smartphone (please complete the following information):
- Device: iPhone/iPad/MacBook
Additional context
Add any other context about the problem here.
baimard commented
Could you tell me more about your database ?Cordialement,Benjamin AIMARDDe : Normen Hansen ***@***.***>Envoyé : dimanche 13 novembre 2022 à 18:31À : baimard/gestion ***@***.***>Cc : Subscribed ***@***.***>Objet : [baimard/gestion] Error when creating an invoice (Issue #304)
Describe the bug
When pressing the button to create an invoice theres a 500 server error. The invoice is created nonetheless.
To Reproduce
Steps to reproduce the behavior:
Open Gestion
Click on 'Add Invoice'
See Error
Expected behavior
The invoice should be created without error.
Screenshots
Logs
[index] Fehler: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[42883]: Undefined function: 7 ERROR: function last_insert_id() does not exist
LINE 1: SELECT LAST_INSERT_ID();
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts. at <<closure>>
0. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1780
Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
1. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1719
Doctrine\DBAL\Connection->handleDriverException(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
2. /var/www/html/3rdparty/doctrine/dbal/src/Statement.php line 193
Doctrine\DBAL\Connection->convertExceptionDuringQuery(Doctrine\DBAL\Driver\PDO\Exception {}, "SELECT LAST_INSERT_ID();", [], [])
3. /var/www/html/lib/private/DB/PreparedStatement.php line 87
Doctrine\DBAL\Statement->execute([])
4. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 314
OC\DB\PreparedStatement->execute([])
5. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 262
OCA\Gestion\Db\Bdd->execSQLNoJsonReturn("SELECT LAST_INSERT_ID();", [])
6. /var/www/html/custom_apps/gestion/lib/Db/Bdd.php line 115
OCA\Gestion\Db\Bdd->lastinsertid()
7. /var/www/html/custom_apps/gestion/lib/Controller/PageController.php line 279
OCA\Gestion\Db\Bdd->insertFacture("megalith")
8. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 225
OCA\Gestion\Controller\PageController->insertFacture()
9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 133
OC\AppFramework\Http\Dispatcher->executeController(OCA\Gestion\Controller\PageController {}, "insertFacture")
10. /var/www/html/lib/private/AppFramework/App.php line 172
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Gestion\Controller\PageController {}, "insertFacture")
11. /var/www/html/lib/private/Route/Router.php line 298
OC\AppFramework\App::main("OCA\\Gestion\\C ... r", "insertFacture", OC\AppFramework\ ... {}, ["gestion.page.insertFacture"])
12. /var/www/html/lib/base.php line 1030
OC\Route\Router->match("/apps/gestion/facture/insert")
13. /var/www/html/index.php line 36
OC::handleRequest()
POST /apps/gestion/facture/insert
from 2003:d7:1708:a400:915:afc6:c9e1:2c4 by megalith at 2022-11-13T17:29:09+00:00
Nextcloud
Version 24.0.7
Desktop (please complete the following information):
OS: iOS, MacOS
Browser Safari
Version 16
Smartphone (please complete the following information):
Device: iPhone/iPad/MacBook
Additional context
Add any other context about the problem here.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
normen commented
Its a postgres 13 database running in a separate docker container, anything other info I can supply?
baimard commented
it's du to that line : LINE 1: SELECT LAST_INSERT_ID();
Sorry for that I will correct this bug