glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.36k stars 1.3k forks source link

Missing image in notification stop all notification to be send. #13516

Closed mat44444 closed 1 year ago

mat44444 commented 2 years ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.5

Bug description

Notification stop beeing sent by mail. looking a the log, a missing file appear. making a false file of the same name, let's the process continue and solve the issue.

Maybe a good idea to handle the kind of exception

Relevant log output

[2022-12-02 09:38:03] glpiphplog.WARNING:   *** PHP Warning (2): getimagesize(/secret/gri.dmz.urgences-sante.qc.ca/files/PNG/c5/bdbabf8b761877188705e717bc56c79f21c362.PNG): Failed to open stream: No such file or directory in /secret/gri.dmz.urgences-sante.qc.ca/src/NotificationEventMailing.php at line 283
  Backtrace :
  src/NotificationEventMailing.php:283               getimagesize()
  src/QueuedNotification.php:602                     NotificationEventMailing::send()
  src/CronTask.php:1018                              QueuedNotification::cronQueuedNotification()
  front/cron.php:84                                  CronTask::launch()

[2022-12-02 09:38:03] glpiphplog.WARNING:   *** PHP Warning (2): Trying to access array offset on value of type bool in /secret/gri.dmz.urgences-sante.qc.ca/src/NotificationEventMailing.php at line 284
  Backtrace :
  src/QueuedNotification.php:602                     NotificationEventMailing::send()
  src/CronTask.php:1018                              QueuedNotification::cronQueuedNotification()
  front/cron.php:84                                  CronTask::launch()

[2022-12-02 09:38:03] glpiphplog.WARNING:   *** PHP Warning (2): Trying to access array offset on value of type bool in /secret/gri.dmz.urgences-sante.qc.ca/src/NotificationEventMailing.php at line 285
  Backtrace :
  src/QueuedNotification.php:602                     NotificationEventMailing::send()
  src/CronTask.php:1018                              QueuedNotification::cronQueuedNotification()
  front/cron.php:84                                  CronTask::launch()

[2022-12-02 09:38:03] glpiphplog.CRITICAL:   *** Uncaught Exception DivisionByZeroError: Division by zero in /secret/gri.dmz.urgences-sante.qc.ca/src/NotificationEventMailing.php at line 289
  Backtrace :
  src/QueuedNotification.php:602                     NotificationEventMailing::send()
  src/CronTask.php:1018                              QueuedNotification::cronQueuedNotification()
  front/cron.php:84                                  CronTask::launch()

Page URL

No response

Steps To reproduce

1) Stop the notification processe 2) Generate a ntoficiation that contain an image, like a new ticket with image 3) Delete from file directory the specify image 4) restart notification process.

After that all other notification arent handle and are stuck in the process

Your GLPI setup information

Informations sur le système, l'installation et la configuration
GLPI 10.0.5 ( => /secret/gri.dmz.urgences-sante.qc.ca)
Installation mode: TARBALL
Current language:fr_FR

Server
 
Operating system: Linux srv-pr-apachedmzv1.ipa.urgences-sante.qc.ca 4.18.0-372.32.1.el8_6.x86_64 #1 SMP Fri Oct 7 12:35:10 EDT
    2022 x86_64
PHP 8.1.12 fpm-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bz2, calendar, cgi-fcgi, ctype, curl, date, dom,
    exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imap, intl, json, ldap, libxml, mbstring, memcached, msgpack,
    mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, phpiredis, redis, session, snmp, sockets, sodium, sqlite3, standard,
    tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="600" memory_limit="512M" post_max_size="8M" safe_mode="" session.save_handler="files"
    upload_max_filesize="20M" 
Software: Apache/2.4.37 (Red Hat Enterprise Linux) ()
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Server Software: MariaDB Server
    Server Version: 10.2.35-MariaDB-log
    Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    Parameters: glpi_gri@207.96.146.199:3306/GRI
    Host info: 207.96.146.199 via TCP/IP

PHP version (8.1.12) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, json, simplexml.
curl extension is installed.
gd extension is installed.
intl extension is installed.
libxml extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.2.35) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_cache has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/config has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_cron has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_dumps has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_graphs has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_lock has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_pictures has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_plugins has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_rss has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_sessions has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_tmp has been validated.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/files/_uploads has been validated.
The following directories should be placed outside "/secret/gri.dmz.urgences-sante.qc.ca":
‣ "/secret/gri.dmz.urgences-sante.qc.ca/files" ("GLPI_VAR_DIR")
‣ "/secret/gri.dmz.urgences-sante.qc.ca/config" ("GLPI_CONFIG_DIR")
You can ignore this suggestion if you are certain that these directories are not accessible through your web server.
For security reasons, SELinux mode should be Enforcing.
PHP directive "session.cookie_httponly" should be set to "on" to prevent client-side script to access cookie values.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
zip extension is installed.
bz2 extension is installed.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /secret/gri.dmz.urgences-sante.qc.ca/marketplace has been validated.
Timezones seems loaded in database.

GLPI constants
 
GLPI_ROOT: "/secret/gri.dmz.urgences-sante.qc.ca"
GLPI_CSRF_EXPIRES: 43200
GLPI_CONFIG_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/config"
GLPI_VAR_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files"
GLPI_MARKETPLACE_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/marketplace"
GLPI_USE_CSRF_CHECK: "1"
GLPI_CSRF_MAX_TOKENS: "100"
GLPI_USE_IDOR_CHECK: "1"
GLPI_IDOR_EXPIRES: "7200"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["/^(https?|feed):\\/\\/[^@:]+(\\/.*)?$/"]
GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org"
GLPI_INSTALL_MODE: "TARBALL"
GLPI_NETWORK_MAIL: "glpi@teclib.com"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: "0"
GLPI_CENTRAL_WARNINGS: "1"
GLPI_DOC_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files"
GLPI_CACHE_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_cache"
GLPI_CRON_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_cron"
GLPI_DUMP_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_dumps"
GLPI_GRAPH_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_graphs"
GLPI_LOCAL_I18N_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_locales"
GLPI_LOCK_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_lock"
GLPI_LOG_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_log"
GLPI_PICTURE_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_plugins"
GLPI_RSS_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_rss"
GLPI_SESSION_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_sessions"
GLPI_TMP_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_tmp"
GLPI_UPLOAD_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_uploads"
GLPI_INVENTORY_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/files/_inventories"
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/glpi-plugins/"
GLPI_I18N_DIR: "/secret/gri.dmz.urgences-sante.qc.ca/locales"
GLPI_VERSION: "10.0.5"
GLPI_SCHEMA_VERSION: "10.0.5@628dbfbb91eb4caf10c35969d9162b9300b141e0"
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MIN_PHP: "7.4.0"
GLPI_MAX_PHP: "8.3.0"
GLPI_YEAR: "2022"

Libraries
 
htmlawed/htmlawed version 1.2.9 in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.6.0 in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.5.0 in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/michelf/php-markdown/Michelf)
true/punycode in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/true/punycode/src)
iamcal/lib_autolink in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/iamcal/lib_autolink)
sabre/dav in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/sabre/dav/lib/DAV)
sabre/http in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/sabre/http/lib)
sabre/uri in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/sabre/uri/lib)
sabre/vobject in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/elvanto/litemoji/src)
symfony/console in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/symfony/console)
scssphp/scssphp in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/rlanvin/php-rrule/src)
blueimp/jquery-file-upload in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/blueimp/jquery-file-upload/server/php)
ramsey/uuid in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/ramsey/uuid/src)
psr/log in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/psr/log/Psr/Log)
psr/simple-cache in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/psr/simple-cache/src)
psr/cache in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/psr/cache/src)
league/csv in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/league/csv/src)
mexitek/phpcolors in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/paragonie/sodium_compat/src)
symfony/cache in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/symfony/cache)
html2text/html2text in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/html2text/html2text/src)
symfony/css-selector in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/symfony/css-selector)
symfony/dom-crawler in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/symfony/dom-crawler)
twig/twig in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/twig/twig/src)
twig/string-extra in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 not found
symfony/polyfill-php81 not found
symfony/polyfill-php82 in (/secret/gri.dmz.urgences-sante.qc.ca/vendor/symfony/polyfill-php82)

LDAP directories
 
Server: 'ldap://urgences-sante.local', Port: '389', BaseDN: 'dc=urgences-sante,dc=local', Connection filter:
        '(&(objectClass=user)(objectCategory=person)(!(distinguishedName:=%désactivés%))(!(userAccountControl:1.2.840.113556.1.4.803:=2)))',
        RootDN: 'CN=Sys_Qry_Ldap,OU=System,OU=Comptes,DC=Urgences-sante,DC=local', Use TLS: none

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP (anonymous@gri.dmz.urgences-sante.qc.ca)

Plugins list
 
    addressing           Name: Adressage IP                   Version: 3.0.1      State: Enabled                                 
        Install Method: Marketplace
    advanceddashboard    Name: advanceddashboard              Version: 1.4.3      State: Enabled                                 
        Install Method: Marketplace
    advancedplanning     Name: advancedplanning               Version: 1.1.0      State: Enabled                                 
        Install Method: Marketplace
    approvalbymail       Name: Approval by mail               Version: 2.1.1      State: Enabled                                 
        Install Method: Marketplace
    treeview             Name: Arborescence                   Version: 1.10.0     State: Enabled                                 
        Install Method: Marketplace
    fields               Name: Champs supplémentaires         Version: 1.19.0     State: Enabled                                 
        Install Method: Marketplace
    mydashboard          Name: Dashboard                      Version: 2.1.4      State: Enabled                                 
        Install Method: Marketplace
    datainjection        Name: Data Injection                 Version: 2.12.0     State: Enabled                                 
        Install Method: Marketplace
    consumables          Name: Demande de consommables        Version: 2.0.0      State: Enabled                                 
        Install Method: Marketplace
    useditemsexport      Name: Export des éléments utilisés   Version: 2.5.1      State: Enabled                                
         Install Method: Marketplace
    formcreator          Name: Form Creator                   Version: 2.13.3     State: Enabled                                 
        Install Method: Marketplace
    gantt                Name: gantt                          Version: 1.0.1      State: Enabled                                 
        Install Method: Marketplace
    gappessentials       Name: Gapp Essentials                Version: 2.1.1      State: Enabled                                 
        Install Method: Marketplace
    geninventorynumber   Name: Génération de numéros d'invent Version: 2.8.3      State: Enabled                                
         Install Method: Marketplace
    genericobject        Name: Gestion d'objets               Version: 2.14.1     State: Enabled                                 
        Install Method: Marketplace
    order                Name: Gestion des commandes          Version: 2.10.0     State: Enabled                                 
        Install Method: Marketplace
    agentconfig          Name: GLPI Agent config              Version: 1.2.0      State: Enabled                                 
        Install Method: Marketplace
    glpiinventory        Name: GLPI Inventory                 Version: 1.0.5      State: Enabled                                 
        Install Method: Marketplace
    tasklists            Name: Liste des tâches               Version: 2.0.3      State: Installed / not activated               
        Install Method: Marketplace
    releases             Name: Mises en production            Version: 2.0.3      State: Enabled                                 
        Install Method: Marketplace
    oauthimap            Name: Oauth IMAP                     Version: 1.4.1      State: Enabled                                 
        Install Method: Marketplace
    collaborativetools   Name: Outils collaboratifs           Version: 1.2.2      State: Enabled                                 
        Install Method: Marketplace
    ldaptools            Name: Outils LDAP                    Version: 0.0.3      State: Not installed                           
        Install Method: Marketplace
    gdpr                 Name: Outils RGPD                    Version: 2.0.3      State: Not installed                           
        Install Method: Marketplace
    mreporting           Name: Plus de rapports               Version: 1.8.2      State: Enabled                                 
        Install Method: Marketplace
    satisfaction         Name: Plus de satisfaction           Version: 1.6.1      State: Enabled                                 
        Install Method: Marketplace
    localeoverride       Name: Renommer les chaînes de GLPI   Version: 1.1.5      State: Enabled                                 
        Install Method: Marketplace
    dashboard            Name: Tableau de bord                Version: 1.0.2      State: Installed / not activated               
        Install Method: Manual
    taskdrop             Name: TaskDrop                       Version: 2.0.0      State: Enabled                                 
        Install Method: Marketplace
    vip                  Name: VIP                            Version: 1.8.2      State: Enabled                                 
        Install Method: Marketplace

Anything else?

No response

mat44444 commented 1 year ago

hi, there no files being deleted. That was a syns issue between two GLPI node. To keep web acces fast to enduser, we made a load balance over NGINX that route user to one node and other task to the second node(Fusion inventory import/cron/mail collector/AD import/send notification). We have a RSYNC process to merge file différencial every 2 minute. For some reaseon the RSYNC cron was stuck.

Thank for the fix


De : Curtis Conard @.> Envoyé : 3 décembre 2022 04:42 À : glpi-project/glpi @.> Cc : mat44444 @.>; Author @.> Objet : Re: [glpi-project/glpi] Missing image in notification stop all notification to be send. (Issue #13516)

Hello,

Do you know how/why the files are being deleted from the file system rather than deleting the document in GLPI?

— Reply to this email directly, view it on GitHubhttps://github.com/glpi-project/glpi/issues/13516#issuecomment-1336123963, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7H7K2ETICLP5SN6TMAMPLWLMIXLANCNFSM6AAAAAASSGR7Q4. You are receiving this because you authored the thread.Message ID: @.***>

castpedrohutic commented 1 year ago

I have this same problem, but I don´t have balancing or anything like that, just the default GLPI only on one server.

`[2022-12-13 15:25:03] glpiphplog.WARNING: *** PHP Warning (2): getimagesize(/var/www/html/glpi/files/PNG/76/2afb157f1dd772b46a807551748268bb8c03f3.PNG): Failed to open stream: No such file or directory in /var/www/html/glpi/src/NotificationEventMailing.php at line 283 Backtrace : src/NotificationEventMailing.php:283 getimagesize() src/QueuedNotification.php:602 NotificationEventMailing::send() src/CronTask.php:1018 QueuedNotification::cronQueuedNotification() front/cron.php:84 CronTask::launch()

[2022-12-13 15:25:03] glpiphplog.WARNING: *** PHP Warning (2): Trying to access array offset on value of type bool in /var/www/html/glpi/src/NotificationEventMailing.php at line 284 Backtrace : src/QueuedNotification.php:602 NotificationEventMailing::send() src/CronTask.php:1018 QueuedNotification::cronQueuedNotification() front/cron.php:84 CronTask::launch()

[2022-12-13 15:25:03] glpiphplog.WARNING: *** PHP Warning (2): Trying to access array offset on value of type bool in /var/www/html/glpi/src/NotificationEventMailing.php at line 285 Backtrace : src/QueuedNotification.php:602 NotificationEventMailing::send() src/CronTask.php:1018 QueuedNotification::cronQueuedNotification() front/cron.php:84 CronTask::launch()

[2022-12-13 15:25:03] glpiphplog.CRITICAL: *** Uncaught Exception DivisionByZeroError: Division by zero in /var/www/html/glpi/src/NotificationEventMailing.php at line 289 Backtrace : src/QueuedNotification.php:602 NotificationEventMailing::send() src/CronTask.php:1018 QueuedNotification::cronQueuedNotification() front/cron.php:84 CronTask::launch() ` some guidance?

castpedrohutic commented 1 year ago

I solved the problem by creating the PNG file in place and set the same permission as the other files inside the folder.

cedric-anne commented 1 year ago

Fixed by #13517.