Bonjour/Bonsoir,
Depuis la dernière mise à jour j'ai ce message qui s'affiche dans l'administration, et parfois sur la galerie:
"try '0' for key 'PRIMARY'
INSERT INTO `piwigo_activity`
(`object`,`object_id`,`action`,`performed_by`,`session_idx`,`ip_address`,`details`,`user_agent`)
VALUES('system','1','maintenance','1','25944a38819cb38412eddbdaca43eee4','77.141.220.214','a:2:{s:18:\"maintenance_action\";s:8:\"database\";s:6:\"script\";s:17:\"admin/maintenance\";}',NULL) in /home/jobe2043/public_html/fiches-cichlidae/include/dblayer/functions_mysqli.inc.php on line 847
De quoi cela peut provenir ?
Merci.
Piwigo 15.1.0
Système d'exploitation: Linux
PHP: 7.4.33 (Montrer les informations) [2024-11-30 11:44:59]
MySQL: 5.5.5-10.6.20-MariaDB [2024-11-30 11:44:59]
Bibliothèque graphique: ImageMagick ImageMagick 7.1.1-39
https://www.francecichlid.com/fiches-cichlidae/
Hors ligne
Bonjour,
Le problème semble lié à la gestion de la clé primaire dans la table "piwigo_activity". Dans un premier temps, je vous invite à vérifier la structure de cette table pour voir si la colonne "activity_id" est configurée avec l'attribut AUTO_INCREMENT.
Hors ligne
Est-ce que tu peux montrer dans ton gestionnaire de donnée le résultat de ces deux commandes :
desc piwigo_activity;
show create table piwigo_activity;
Voici les résultat de mon côté :
MariaDB [piwigo_db]> desc piwigo_activity; +--------------+-----------------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-----------------------+------+-----+---------------------+----------------+ | activity_id | int(11) unsigned | NO | PRI | NULL | auto_increment | | object | varchar(255) | NO | | NULL | | | object_id | int(11) unsigned | NO | | NULL | | | action | varchar(255) | NO | | NULL | | | performed_by | mediumint(8) unsigned | NO | | NULL | | | session_idx | varchar(255) | NO | | NULL | | | ip_address | varchar(50) | YES | | NULL | | | occured_on | timestamp | YES | | current_timestamp() | | | details | varchar(255) | YES | | NULL | | | user_agent | varchar(255) | YES | | NULL | | +--------------+-----------------------+------+-----+---------------------+----------------+ 10 rows in set (0.002 sec)
show create table piwigo_activity; +-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | piwigo_activity | CREATE TABLE `piwigo_activity` ( `activity_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `object` varchar(255) NOT NULL, `object_id` int(11) unsigned NOT NULL, `action` varchar(255) NOT NULL, `performed_by` mediumint(8) unsigned NOT NULL, `session_idx` varchar(255) NOT NULL, `ip_address` varchar(50) DEFAULT NULL, `occured_on` timestamp NULL DEFAULT current_timestamp(), `details` varchar(255) DEFAULT NULL, `user_agent` varchar(255) DEFAULT NULL, PRIMARY KEY (`activity_id`) ) ENGINE=MyISAM AUTO_INCREMENT=14848 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci | +-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.000 sec)
Hors ligne
Salut.
Voilà de mon côté (1ere et 2ème commande):
Field Type Null Key Default Extra
activity_id int(11) unsigned NO PRI NULL
object varchar(255) NO NULL
object_id int(11) unsigned NO NULL
action varchar(255) NO NULL
performed_by mediumint(8) unsigned NO NULL
session_idx varchar(255) NO NULL
ip_address varchar(50) YES NULL
occured_on timestamp NO current_timestamp()
details varchar(255) YES NULL
user_agent varchar(255) YES NULL
-------------------------------
piwigo_activity CREATE TABLE `piwigo_activity` (
`activity_id` i...
___________________________________________________________________________
Je peux ajouter que maintenant j'ai un nouveau message et que je ne peux plus agir sur la galerie en administration, j'ai ce message d'erreur:
Fatal error: Uncaught mysqli_sql_exception: Duplicate entry '0' for key 'PRIMARY' in /home/jobe2043/public_html/fiches-cichlidae/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /home/jobe2043/public_html/fiches-cichlidae/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /home/jobe2043/public_html/fiches-cichlidae/include/dblayer/functions_mysqli.inc.php(550): pwg_query() #2 /home/jobe2043/public_html/fiches-cichlidae/include/functions.inc.php(669): mass_inserts() #3 /home/jobe2043/public_html/fiches-cichlidae/admin/maintenance_actions.php(256): pwg_activity() #4 /home/jobe2043/public_html/fiches-cichlidae/admin/maintenance.php(117): include('/home/jobe2043/...') #5 /home/jobe2043/public_html/fiches-cichlidae/admin.php(406): include('/home/jobe2043/...') #6 {main} thrown in /home/jobe2043/public_html/fiches-cichlidae/include/dblayer/functions_mysqli.inc.php on line 132
Merci.
Dernière modification par Benoit (2025-01-06 10:04:35)
Hors ligne