Anomalie #4022
ferméProblème import fichier csv de données avec fichier attaché si pas de première connection à l'application
100%
La table UserToken est créée à la volée lors de la première utilisation.
Le CSV demande une transformation à TE qui nécessité un token.
Il faut créer la table sur CORE_post.
./wsh.php --api=updateclass --class=UserTokenCORE_post
Description
On veut importer un fichier csv de données (voir PJ) sans s'être encore connecté à l'application (au moment du déploiement d'un contexte). L'import des fichiers fonctionne SAUF lorsqu'il y a des fichiers attachés (exemple CR_EVENEMENT du fichier csv).
Si on accède une première fois à l'application (même sans s'authentifier) et qu'on réimporte le fichier csv de la même façon les données sont cette fois importées correctement sans erreur.
Voici la stacktrace :
LOG::[W] Dynacase:DbObj:usertoken : exec_query :
CREATE TABLE usertoken (
token VARCHAR(256) NOT NULL PRIMARY KEY,
userid INT NOT NULL,
expire TIMESTAMP NOT NULL,
expendable BOOLEAN DEFAULT FALSE,
context text
)
23/05/2013 13:29:01 LOG::[W] Dynacase:DbObj:usertoken : PostgreSQL Error : {DB0001} query error : ERREUR: la transaction est annulée, les commandes sont ignorées jusqu'à la fin du bloc
de la transaction
0) /var/www/sysman/WHAT/Class.DbObj.php:769 DbObj::setError()
1) /var/www/sysman/WHAT/Class.DbObj.php:586 DbObj::exec_query()
2) /var/www/sysman/WHAT/Class.DbObj.php:656 DbObj::Create()
3) /var/www/sysman/WHAT/Class.DbObj.php:755 DbObj::tryCreate()
4) /var/www/sysman/WHAT/Class.UserToken.php:128 DbObj::exec_query()
5) /var/www/sysman/WHAT/Class.Account.php:1051 UserToken::deleteExpired()
6) /var/www/sysman/FDL/Lib.Vault.php:50 Account::getUserToken()
7) /var/www/sysman/FDL/Lib.Vault.php:197 ::getOpenTeUrl()
8) /var/www/sysman/FDL/Class.Doc.php:3678 ::sendTextTransformation()
9) /var/www/sysman/FDL/Class.Doc.php:825 Doc::sendTextToEngine()
10) /var/www/sysman/WHAT/Class.DbObj.php:438 Doc::PostInsert()
11) /var/www/sysman/FDL/Class.ImportSingleDocument.php:505 DbObj::Add()
12) /var/www/sysman/FDL/import_file.php:73 importSingleDocument::import()
13) /var/www/sysman/FDL/Class.ImportDescription.php:574 ::csvAddDoc()
14) /var/www/sysman/FDL/Class.ImportDescription.php:154 importDocumentDescription::doDoc()
15) /var/www/sysman/FDL/import_file.php:44 importDocumentDescription::import()
16) /var/www/sysman/FDL/Class.importDocument.php:86 ::add_import_file()
17) /var/www/sysman/API/importDocuments.php:81 ImportDocument::importDocuments()
18) /var/www/sysman/wsh.php:151 ::include()
{DB0001} query error : ERREUR: la transaction est annulée, les commandes sont ignorées jusqu'à la fin du bloc
de la transaction
CREATE TABLE usertoken (
token VARCHAR(256) NOT NULL PRIMARY KEY,
userid INT NOT NULL,
expire TIMESTAMP NOT NULL,
expendable BOOLEAN DEFAULT FALSE,
context text
)
23/05/2013 13:29:01 LOG::[W] Dynacase:DbObj:usertoken : exec_query :DELETE FROM usertoken WHERE expire < now()
23/05/2013 13:29:01 LOG::[W] Dynacase:DbObj:usertoken : PostgreSQL Error : {DB0001} query error : ERREUR: la relation « usertoken » n'existe pas
LIGNE 1 : DELETE FROM usertoken WHERE expire < now()
^
0) /var/www/sysman/WHAT/Class.DbObj.php:769 DbObj::setError()
1) /var/www/sysman/WHAT/Class.UserToken.php:128 DbObj::exec_query()
2) /var/www/sysman/WHAT/Class.Account.php:1051 UserToken::deleteExpired()
3) /var/www/sysman/FDL/Lib.Vault.php:50 Account::getUserToken()
4) /var/www/sysman/FDL/Lib.Vault.php:197 ::getOpenTeUrl()
5) /var/www/sysman/FDL/Class.Doc.php:3678 ::sendTextTransformation()
6) /var/www/sysman/FDL/Class.Doc.php:825 Doc::sendTextToEngine()
7) /var/www/sysman/WHAT/Class.DbObj.php:438 Doc::PostInsert()
8) /var/www/sysman/FDL/Class.ImportSingleDocument.php:505 DbObj::Add()
9) /var/www/sysman/FDL/import_file.php:73 importSingleDocument::import()
10) /var/www/sysman/FDL/Class.ImportDescription.php:574 ::csvAddDoc()
11) /var/www/sysman/FDL/Class.ImportDescription.php:154 importDocumentDescription::doDoc()
12) /var/www/sysman/FDL/import_file.php:44 importDocumentDescription::import()
13) /var/www/sysman/FDL/Class.importDocument.php:86 ::add_import_file()
14) /var/www/sysman/API/importDocuments.php:81 ImportDocument::importDocuments()
15) /var/www/sysman/wsh.php:151 ::include()
{DB0001} query error : ERREUR: la relation « usertoken » n'existe pas
LIGNE 1 : DELETE FROM usertoken WHERE expire < now()
^
DELETE FROM usertoken WHERE expire < now()
Erreur : {DB0001} query error : ERREUR: la relation « usertoken » n'existe pas
LIGNE 1 : DELETE FROM usertoken WHERE expire < now()
^
DELETE FROM usertoken WHERE expire < now()
Fichiers
Mis à jour par Éric Brison il y a presque 13 ans
Mis à jour par Éric Brison il y a presque 13 ans
- Statut changé de Assigné à Analysé
Pour réaliser l'importation CSV il faut au préalable lancer
./wsh.php --api=updateclass --class=UserToken
en attendant l'intégration de cette demande.
Mis à jour par Éric Brison il y a presque 13 ans
- Statut changé de Analysé à Intégré
- % réalisé changé de 0 à 100
Appliqué par commit commit:74abf1fc644f716829fb9447ae1c81be50d583d5.