Dolibarr ERP & CRM » Bugs » bug #954
Silent pgsql errors in /user/perms.php?&action="">Dernières modifications
Répondre
État Détails |
Last Modified On: | 07/08/2013 17:43 | | Submitted by: | damien clochard (daamien) |
Submitted on: | 21/06/2013 15:24 | |
Summary: | Silent pgsql errors in /user/perms.php?&action="">
|
Description: | DETAIL: Key (id, entity)=(171, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396 = DB_ERROR_RECORD_ALREADY_EXISTS
2013-06-21 15:21:49 ERR 86.213.40.128 modDeplacement::insert_permissions error ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(171, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396
2013-06-21 15:21:49 WARNING 86.213.40.128 DoliDBPgsql::query SQL error usesavepoint = 1 - INSERT INTO llx_rights_def (id, entity, libelle, module, type, bydefault, perms, subperms) VALUES (251,1,'Consulter les autres utilisateurs','user','r',0,'user','lire') - ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(251, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396 = DB_ERROR_RECORD_ALREADY_EXISTS
2013-06-21 15:21:49 ERR 86.213.40.128 modUser::insert_permissions error ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(251, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396
2013-06-21 15:21:49 WARNING 86.213.40.128 DoliDBPgsql::query SQL error usesavepoint = 1 - INSERT INTO llx_rights_def (id, entity, libelle, module, type, bydefault, perms) VALUES (1001,1,'Lire les stocks','stock','r',1,'lire') - ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(1001, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396 = DB_ERROR_RECORD_ALREADY_EXISTS
2013-06-21 15:21:49 ERR 86.213.40.128 modStock::insert_permissions error ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(1001, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396
2013-06-21 15:21:49 WARNING 86.213.40.128 DoliDBPgsql::query SQL error usesavepoint = 1 - INSERT INTO llx_rights_def (id, entity, libelle, module, type, bydefault, perms) VALUES (103001,1,'Lecture','agefodd','w',1,'lire') - ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(103001, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396 = DB_ERROR_RECORD_ALREADY_EXISTS
2013-06-21 15:21:49 ERR 86.213.40.128 modAgefodd::insert_permissions error ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(103001, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396
2013-06-21 15:21:49 WARNING 86.213.40.128 DoliDBPgsql::query SQL error usesavepoint = 1 - INSERT INTO llx_rights_def (id, entity, libelle, module, type, bydefault, perms) VALUES (103021,1,'read','mailchimp','w',1,'read') - ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(103021, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396 = DB_ERROR_RECORD_ALREADY_EXISTS
2013-06-21 15:21:49 ERR 86.213.40.128 modMailchimp::insert_permissions error ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey"
DETAIL: Key (id, entity)=(103021, 1) already exists.
LOCATION: _bt_check_unique, nbtinsert.c:396
|
Step to reproduce bug: | 1- choisir un utilisateur
2- aller sur l'onglet "permissions utilisateur"
3- ajouter une permission |
Version: | 3.4.0 | | Category: | Core Problem |
Severity: | 5 - Major | | OS Type/Version: | |
PHP version: | | | Database type and version: | pgsql |
Etat |
Status: | Closed | | Assigned to: | Laurent Destailleur (eldy) |
Resolution: | Wont Fix | |
Commentaires- damien clochard 07/08/2013 17:43
Hi
Can't reproduce the bug with the latest 3.4 version from github (commit 0f86755033)
You can close this bug.
Thanks for your time and patience !- Laurent Destailleur 25/06/2013 15:54
- Laurent Destailleur (eldy):
> This is what happens :
This screen insert data that may be already present. Each insert is done with a savepoint because it can fails if already exsits.
This is normal, however, the output should be an error with level WARNING and DEBUG and not ERROR.
Here we still have ERROR because it seems that when we are doing the rollback savepoint to ignore error of duplicate key, the value of pg_last_error is reset. So when we compare error code to see if we must report an error with level DEBUG (if duplicate key) or level ERROR (if something else), the pg_last_error returns something else than the "ERROR: 23505: duplicate key value violates unique constraint "llx_rights_def_pkey" (this is correctly reported before the savepoint is done as we see it into log).
So this bug affect only a bad output into log.
Fixing for 3.4 is too dangerous but i added more complete log to confirm this.
If you can report log with last version into 3.4 branch it will be great. Once confirmed i will be able to find a fix for 3.5
|
|
|
|
|
|
Open→ Closed