Ajout d'image KO (par glisser ou bouton sélectionner image) - perte des données - message debug

Installation & Configuration du logiciel
Répondre
Avatar du membre
bbc94
Gsup LEVEL 5
Messages : 180
Enregistré le : ven. 6 juil. 2018 12:47

Bonjour,

J'ai un problème sur l'ajout multiple d'image, au bout d'un certain nombre d'image ou un certain volume je ne sais pas, au moment d'enregistrer j'ai une page blanche qui apparaît et ma modification n'est pas conservée, j'ai activé le mode débug et voici ce que j'ai dans le texte :
DEBUG MODE:
VAR: save= post_modify=submit post_quit= post_mail= post_upload= post_send= post_action= get_action='' post_category=10 post_subcat=162 post_technician=29 globalrow_technician=29 post_u_service= globalrow_u_service=9 post_u_agency= globalrow_u_agency=0 post_asset_id= globalrow[asset_id]=0 post_sender_service=21 globalrow_sender_service=21 post_priority=3 post_title=Demande d'évolution de l'écran CA_commercial
post_u_service=9

QUERY:
UPDATE tincidents SET user='16', type='2', u_group='', u_service='9', u_agency='', sender_service='21', technician='29', t_group='', title=Demande d'évolution de l'écran CA_commercial, description=
=== ici le contenu de mon ticket dont l'image qui est bien présente ===
, date_create='2018-09-25 07:59:18', date_hope='', date_res='2018-12-07 18:04:28', priority='3', criticality='', state='2', time='420', time_hope='420', category='10', subcat='162', techread='', techread_date='', place='', asset_id='', start_availability='', end_availability='', availability_planned='' WHERE id LIKE '189'

Warning: PDOStatement::execute(): MySQL server has gone away in C:\wamp64\www\xxx.nov.group\core\ticket.php on line 541

Warning: PDOStatement::execute(): Error reading result set's header in C:\wamp64\www\xxx.nov.group\core\ticket.php on line 541

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in C:\wamp64\www\xxx.nov.group\core\ticket.php:541 Stack trace: #0 C:\wamp64\www\xxx.nov.group\core\ticket.php(541): PDOStatement->execute(Array) #1 C:\wamp64\www\xxx.nov.group\ticket.php(88): include('C:\\wamp64\\www\\s...') #2 C:\wamp64\www\xxx.nov.group\index.php(919): include('C:\\wamp64\\www\\s...') #3 {main} thrown in C:\wamp64\www\xxx.nov.group\core\ticket.php on line 541
- GestSup 3.2.40 - OS: Windows 2016 64bits - Apache: 2.4.52 - PHP: 8.1.3 - MariaDB - 10.2.8
Avatar du membre
Flox
Administrateur du site
Messages : 8972
Enregistré le : jeu. 21 juin 2012 19:00

Bonjour,

lorsque vous utiliser le champ description ou résolution les images insérées à ce niveau sont stockées en base de données.
Si la quantité de données est trop importante pour votre serveur de base de données se dernier affichera ce message d'erreur.

Je vous invite à utiliser la fonction de pièces jointe en zippant les fichier si elles sont trop nombreuses.

Vous pouvez désactiver le bouton d'insertion d'image au besoin via les droits : ticket_description_insert_image et ticket_resolution_insert_image
GestSup: 3.2.47 | Debian: 12 | Apache: 2.4.58 | MariaDB: 11.3.2 | PHP: 8.3.4 | https://doc.gestsup.fr/
Avatar du membre
bbc94
Gsup LEVEL 5
Messages : 180
Enregistré le : ven. 6 juil. 2018 12:47

Merci pour votre réponse, pour clore le sujet quelques petites questions complémentaires :
- Est-il possible d'augmenter cette limite sur mon serveur ? au niveau de wamp ? car en effet la lecture du ticket est simplifiée dans mon domaine avec des images écrans (souvent beaucoup) liés à des explications texte ...
- Réduire la qualité des images serait donc une piste ?
- J'ai un moyen de connaitre la taille du champ description ?
- GestSup 3.2.40 - OS: Windows 2016 64bits - Apache: 2.4.52 - PHP: 8.1.3 - MariaDB - 10.2.8
Avatar du membre
Flox
Administrateur du site
Messages : 8972
Enregistré le : jeu. 21 juin 2012 19:00

Bonjour,

il n'y a pas de limite de taille sur le champ au niveau de la base de donnée.
Pour augmenter les performances de votre serveur, vous pouvez ajouter de la RAM + CPU.
et modifier le fichier de configuration de base de données "my.ini" en augmentant les valeurs.

Attention toutefois l'ajout d'un nombre important de donnée de type image en base de données peut ralentir à terme les performances de l'application.


Cdt
Fichiers joints
2018-12-12 12_29_06-screenshot-zensoft.png
2018-12-12 12_29_06-screenshot-zensoft.png (3.42 Kio) Vu 13386 fois
GestSup: 3.2.47 | Debian: 12 | Apache: 2.4.58 | MariaDB: 11.3.2 | PHP: 8.3.4 | https://doc.gestsup.fr/
Avatar du membre
bbc94
Gsup LEVEL 5
Messages : 180
Enregistré le : ven. 6 juil. 2018 12:47

Une nouvelle fois merci,
Mon serveur est assez puissant pour augmenter un peut je penses, merci de l'alerte :
====
VM hébergé sous un serveur Hyper-V
3,30GHz intel XEON CPU E5-2667
4Go ram
====
Je dispose de deux fichiers my.ini un dans le répertoire mysql5.7.19 et un autre dans mariadb10.2.8
J'imagine que celui qui me concerne est mysql5.7.19

Son contenu (que je n'ai jamais modifié) est le suivant, même si c'est plutôt déconseillé, quels sont les valeurs à augmenter dans un premier temps ? (je ne voudrais pas non plus augmenter inutilement des valeurs au risque de causer des problèmes) :

; Example MySQL config file for medium systems.
;
; This is for a large system with memory of 1G-2G where the system runs mainly
; MySQL.
;
; MySQL programs look for option files in a set of
; locations which depend on the deployment platform.
; You can copy this option file to one of those
; locations. For information about these locations, see:
; http://dev.mysql.com/doc/mysql/en/option-files.html
;
; In this file, you can use all long options that a program supports.
; If you want to know which options a program supports, run the program
; with the "--help" option.

; The following options will be passed to all MySQL clients
[client]
;password = your_password
port = 3306
socket = /tmp/mysql.sock

; Here follows entries for some specific programs

; The MySQL server
[wampmysqld64]
;skip-grant-tables
port = 3306
socket = /tmp/mysql.sock
key_buffer_size = 64M
max_allowed_packet = 1M

;Added to reduce memory used (minimum is 400)
table_definition_cache = 600

sort_buffer_size = 2M
net_buffer_length = 8K
read_buffer_size = 2M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 32M
;Path to mysql install directory
basedir="c:/wamp64/bin/mysql/mysql5.7.19"
log-error="c:/wamp64/logs/mysql.log"
;Verbosity Value 1 Errors only, 2 Errors and warnings , 3 Errors, warnings, and notes
log_error_verbosity=2
;Path to data directory
datadir="c:/wamp64/bin/mysql/mysql5.7.19/data"

;Path to the language
;See Documentation:
; http://dev.mysql.com/doc/refman/5.7/en/ ... guage.html
lc-messages-dir="c:/wamp64/bin/mysql/mysql5.7.19/share"
lc-messages=fr_FR

; The default storage engine that will be used when create new tables
default-storage-engine=MYISAM
; New for MySQL 5.6 default_tmp_storage_engine if skip-innodb enable
; default_tmp_storage_engine=MYISAM

;To avoid warning messages
secure_file_priv="c:/wamp64/tmp"
skip-ssl

explicit_defaults_for_timestamp=true

; Set the SQL mode to strict
;sql-mode=""
sql-mode="STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"

; Don't listen on a TCP/IP port at all. This can be a security enhancement,
; if all processes that need to connect to mysqld run on the same host.
; All interaction with mysqld must be made via Unix sockets or named pipes.
; Note that using this option without enabling named pipes on Windows
; (via the "enable-named-pipe" option) will render mysqld useless!
;
;skip-networking

; Disable Federated by default
skip-federated

; Replication Master Server (default)
; binary logging is required for replication
;log-bin=mysql-bin

; binary logging format - mixed recommended
;binlog_format=mixed

; required unique id between 1 and 2^32 - 1
; defaults to 1 if master-host is not set
; but will not function as a master if omitted
server-id = 1

; Replication Slave (comment out master section to use this)

; New for MySQL 5.6 if no slave
skip-slave-start

;
; To configure this host as a replication slave, you can choose between
; two methods :
;
; 1) Use the CHANGE MASTER TO command (fully described in our manual) -
; the syntax is:
;
; CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
; MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
;
; where you replace <host>, <user>, <password> by quoted strings and
; <port> by the master's port number (3306 by default).
;
; Example:
;
; CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
; MASTER_USER='joe', MASTER_PASSWORD='secret';
;
; OR
;
; 2) Set the variables below. However, in case you choose this method, then
; start replication for the first time (even unsuccessfully, for example
; if you mistyped the password in master-password and the slave fails to
; connect), the slave will create a master.info file, and any later
; change in this file to the variables' values below will be ignored and
; overridden by the content of the master.info file, unless you shutdown
; the slave server, delete master.info and restart the slaver server.
; For that reason, you may want to leave the lines below untouched
; (commented) and instead use CHANGE MASTER TO (see above)
;
; required unique id between 2 and 2^32 - 1
; (and different from the master)
; defaults to 2 if master-host is set
; but will not function as a slave if omitted
;server-id = 2
;
; The replication master for this slave - required
;master-host = <hostname>
;
; The username the slave will use for authentication when connecting
; to the master - required
;master-user = <username>
;
; The password the slave will authenticate with when connecting to
; the master - required
;master-password = <password>
;
; The port the master is listening on.
; optional - defaults to 3306
;master-port = <port>
;
; binary logging - not required for slaves, but recommended
;log-bin=mysql-bin

; Point the following paths to different dedicated disks
;tmpdir = /tmp/
;log-update = /path-to-dedicated-directory/hostname

; The InnoDB tablespace encryption feature relies on the keyring_file
; plugin for encryption key management, and the keyring_file plugin
; must be loaded prior to storage engine initialization to facilitate
; InnoDB recovery for encrypted tables. If you do not want to load the
; keyring_file plugin at server startup, specify an empty string.
early-plugin-load=""

;innodb_data_home_dir = C:/mysql/data/
innodb_data_file_path = ibdata1:12M:autoextend
;innodb_log_group_home_dir = C:/mysql/data/
;innodb_log_arch_dir = C:/mysql/data/
; You can set .._buffer_pool_size up to 50 - 80 %
; of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
; Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
; Remove the next comment character if you are not familiar with SQL
;safe-updates

[isamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer_size = 2M
write_buffer_size = 2M

[myisamchk]
key_buffer_size = 20M
sort_buffer_size_size = 20M
read_buffer_size = 2M
write_buffer_size = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld]
port = 3306
- GestSup 3.2.40 - OS: Windows 2016 64bits - Apache: 2.4.52 - PHP: 8.1.3 - MariaDB - 10.2.8
Avatar du membre
Flox
Administrateur du site
Messages : 8972
Enregistré le : jeu. 21 juin 2012 19:00

Bonjour,

Vous pourrez vérifier si votre moteur de base de données est MySQL ou mariadb dans le menu système de l'application.

Je conseillerai mariadb pour les performances. (viewtopic.php?f=7&t=3582)

Ensuite au niveau des valeurs a augmenter cela dépend de la quantité de données transmises.

De mon côté j'ai réalisé des test en multipliant par deux les valeurs de la section [wampmariadb64] ci après :

Code : Tout sélectionner

key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 2M
net_buffer_length = 8K
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
et n'est plus observé l'erreur.

si vous modifier ces valeurs je vous invite à bien valider l'application après.
GestSup: 3.2.47 | Debian: 12 | Apache: 2.4.58 | MariaDB: 11.3.2 | PHP: 8.3.4 | https://doc.gestsup.fr/
Avatar du membre
bbc94
Gsup LEVEL 5
Messages : 180
Enregistré le : ven. 6 juil. 2018 12:47

Je viens de réaliser les modifications, c'est parfait ça fonctionne.
=> pour info j'ai tenté ce matin de suivre votre conseil et de migrer un environnement de test de MySQL sur mariaDB mais il m'est impossible de réimporter l'ensemble de la base de donnée MySQL sur MariaDB ... j'ai un message d'erreur qui concerne a priori justement des tickets comportant trop d'images ... si j'ignore l'erreur le reste des tables ne sont pas importés ...
Sauf s'il y a un moyen plus simple de migrer, je reste sur Mysql pour le moment, merci encore pour votre aide.

Image
- GestSup 3.2.40 - OS: Windows 2016 64bits - Apache: 2.4.52 - PHP: 8.1.3 - MariaDB - 10.2.8
Avatar du membre
Flox
Administrateur du site
Messages : 8972
Enregistré le : jeu. 21 juin 2012 19:00

Bonjour,

Je ne vois pas le message d'erreur mais si le message est "Gone away" modifier le my.ini avec max_allowed_packet" à 100M.

Cf procédure restauration dans la documentation.

C'est important de pouvoir restauré sa base de données en cas de problème.

Cdt
GestSup: 3.2.47 | Debian: 12 | Apache: 2.4.58 | MariaDB: 11.3.2 | PHP: 8.3.4 | https://doc.gestsup.fr/
Avatar du membre
bbc94
Gsup LEVEL 5
Messages : 180
Enregistré le : ven. 6 juil. 2018 12:47

Magnifique ! (100 ne suffisait pas j'ai mis à 200)
=> Je suis donc maintenant en production et recette sur maria DB pour le gain de performances, j'ai augmenté la limite pour l'ajout des images et ma base est restaurable.
C'est donc au delà de mon espérance ! merci !
- GestSup 3.2.40 - OS: Windows 2016 64bits - Apache: 2.4.52 - PHP: 8.1.3 - MariaDB - 10.2.8
Répondre