You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-05-04 20:37:47

dinesh.ks
Member
Registered: 2021-05-04
Posts: 4

Mails are struck in QueuedNotification

Hi All,

can someone help me on this??

I'm new to GLPI. When the user created a new ticket mail is not send to any Email ID. It is struck in the Maintenance-> notification Log.
Automatic actions -> QueuedNotification are set to CLI.
When I manually Executing the QueuedNotification/Notification_Log, mails are sent.
Test Mail is working Perfectly.

[2021-05-04 23:32:01] glpiphplog.CRITICAL:   *** Uncaught Exception Error: Class "mysqli" not found in /var/www/glpi/inc/dbmysql.class.php at line 160
  Backtrace :
  inc/dbmysql.class.php:147                          DBmysql->connect()
  inc/dbconnection.class.php:192                     DBmysql->__construct()
  inc/dbconnection.class.php:274                     DBConnection::switchToMaster()
  inc/config.php:85                                  DBConnection::establishDBConnection()
  inc/includes.php:48                                include_once()
  front/cron.php:38                                  include()

[2021-05-04 23:34:01] glpiphplog.CRITICAL:   *** Uncaught Exception Error: Class "mysqli" not found in /var/www/glpi/inc/dbmysql.class.php at line 160
  Backtrace :
  inc/dbmysql.class.php:147                          DBmysql->connect()
  inc/dbconnection.class.php:192                     DBmysql->__construct()
  inc/dbconnection.class.php:274                     DBConnection::switchToMaster()
  inc/config.php:85                                  DBConnection::establishDBConnection()
  inc/includes.php:48                                include_once()
  front/cron.php:38                                  include()

[2021-05-04 23:52:00] glpiphplog.WARNING: Test logger
[2021-05-05 00:19:35] glpiphplog.WARNING: Test logger
Crontab
*/5 * * * * root /usr/bin/php7.2 /var/www/glpi/front/cron.php &>/dev/null


My GLPI Spec

 
GLPI 9.5.5 ( => /var/www/glpi)
Installation mode: TARBALL

Server
 
Operating system: Linux itserver 4.15.0-142-generic #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 x86_64
PHP 7.2.34-21+ubuntu18.04.1+deb.sury.org+1 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache,
	apache2handler, apc, apcu, bcmath, bz2, calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash,
	iconv, imagick, imap, intl, json, ldap, libxml, mbstring, memcache, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite,
	posix, pspell, readline, recode, session, shmop, sockets, sodium, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer,
	wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="360" memory_limit="256M" post_max_size="8M" safe_mode="" session.save_handler="files"
	upload_max_filesize="100M" 
Software: Apache/2.4.29 (Ubuntu) (Apache/2.4.29 (Ubuntu) Server at helpdesk.ignitarium.in Port 80)
	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Server Software: Ubuntu 18.04
	Server Version: 10.1.47-MariaDB-0ubuntu0.18.04.1
	Server SQL Mode: 
	Parameters: glpiign@localhost/glpi
	Host info: Localhost via UNIX socket
	
PHP version is at least 7.2.0 - Perfect!PHP version is at least 7.2.0 - Perfect!
Sessions support is available - Perfect!Sessions support is available - Perfect!
Allocated memory > 64 Mio - Perfect!Allocated memory > 64 Mio - Perfect!
mysqli extension is installedmysqli extension is installed
ctype extension is installedctype extension is installed
fileinfo extension is installedfileinfo extension is installed
json extension is installedjson extension is installed
mbstring extension is installedmbstring extension is installed
iconv extension is installediconv extension is installed
zlib extension is installedzlib extension is installed
curl extension is installedcurl extension is installed
gd extension is installedgd extension is installed
simplexml extension is installedsimplexml extension is installed
intl extension is installedintl extension is installed
ldap extension is installedldap extension is installed
apcu extension is installedapcu extension is installed
Zend OPcache extension is installedZend OPcache extension is installed
xmlrpc extension is installedxmlrpc extension is installed
CAS extension is installedCAS extension is installed
exif extension is installedexif extension is installed
zip extension is installedzip extension is installed
bz2 extension is installedbz2 extension is installed
sodium extension is installedsodium extension is installed
Database version seems correct (10.1.47) - Perfect!Database version seems correct (10.1.47) - Perfect!
Access to timezone database (mysql) is not allowed.Access to timezone database (mysql) is not allowed.
The log file has been created successfully.The log file has been created successfully.
Write access to /var/www/glpi/files/_cache has been validated.Write access to /var/www/glpi/files/_cache has been validated.
Write access to /var/www/glpi/config has been validated.Write access to /var/www/glpi/config has been validated.
Write access to /var/www/glpi/files/_cron has been validated.Write access to /var/www/glpi/files/_cron has been validated.
Write access to /var/www/glpi/files has been validated.Write access to /var/www/glpi/files has been validated.
Write access to /var/www/glpi/files/_dumps has been validated.Write access to /var/www/glpi/files/_dumps has been validated.
Write access to /var/www/glpi/files/_graphs has been validated.Write access to /var/www/glpi/files/_graphs has been validated.
Write access to /var/www/glpi/files/_lock has been validated.Write access to /var/www/glpi/files/_lock has been validated.
Write access to /var/www/glpi/files/_pictures has been validated.Write access to /var/www/glpi/files/_pictures has been validated.
Write access to /var/www/glpi/files/_plugins has been validated.Write access to /var/www/glpi/files/_plugins has been validated.
Write access to /var/www/glpi/files/_rss has been validated.Write access to /var/www/glpi/files/_rss has been validated.
Write access to /var/www/glpi/files/_sessions has been validated.Write access to /var/www/glpi/files/_sessions has been validated.
Write access to /var/www/glpi/files/_tmp has been validated.Write access to /var/www/glpi/files/_tmp has been validated.
Write access to /var/www/glpi/files/_uploads has been validated.Write access to /var/www/glpi/files/_uploads has been validated.
Write access to /var/www/glpi/marketplace has been validated.Write access to /var/www/glpi/marketplace has been validated.
Web access to files directory is protectedWeb access to files directory is protected

GLPI constants
 
GLPI_ROOT: /var/www/glpi
GLPI_CONFIG_DIR: /var/www/glpi/config
GLPI_VAR_DIR: /var/www/glpi/files
GLPI_MARKETPLACE_DIR: /var/www/glpi/marketplace
GLPI_USE_CSRF_CHECK: 1
GLPI_CSRF_EXPIRES: 7200
GLPI_CSRF_MAX_TOKENS: 100
GLPI_USE_IDOR_CHECK: 1
GLPI_IDOR_EXPIRES: 7200
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: 
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_PRERELEASES: 
GLPI_MARKETPLACE_ALLOW_OVERRIDE: 1
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: 1
GLPI_USER_AGENT_EXTRA_COMMENTS: 
GLPI_AJAX_DASHBOARD: 1
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: 0
GLPI_FORCE_EMPTY_SQL_MODE: 1
GLPI_DOC_DIR: /var/www/glpi/files
GLPI_CACHE_DIR: /var/www/glpi/files/_cache
GLPI_CRON_DIR: /var/www/glpi/files/_cron
GLPI_DUMP_DIR: /var/www/glpi/files/_dumps
GLPI_GRAPH_DIR: /var/www/glpi/files/_graphs
GLPI_LOCAL_I18N_DIR: /var/www/glpi/files/_locales
GLPI_LOCK_DIR: /var/www/glpi/files/_lock
GLPI_LOG_DIR: /var/www/glpi/files/_log
GLPI_PICTURE_DIR: /var/www/glpi/files/_pictures
GLPI_PLUGIN_DOC_DIR: /var/www/glpi/files/_plugins
GLPI_RSS_DIR: /var/www/glpi/files/_rss
GLPI_SESSION_DIR: /var/www/glpi/files/_sessions
GLPI_TMP_DIR: /var/www/glpi/files/_tmp
GLPI_UPLOAD_DIR: /var/www/glpi/files/_uploads
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: /var/www/glpi/locales
GLPI_VERSION: 9.5.5
GLPI_SCHEMA_VERSION: 9.5.5
GLPI_MIN_PHP: 7.2.0
GLPI_YEAR: 2021

Libraries
 
htmlawed/htmlawed version 1.2.5 in (/var/www/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.1.6 in (/var/www/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.6 in (/var/www/glpi/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.3.5 in (/var/www/glpi/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/var/www/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/var/www/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/var/www/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/var/www/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/var/www/glpi/vendor/sabre/http/lib)
sabre/uri in (/var/www/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/var/www/glpi/vendor/sabre/vobject/lib)
laminas/laminas-cache in (/var/www/glpi/vendor/laminas/laminas-cache/src)
laminas/laminas-i18n in (/var/www/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-serializer in (/var/www/glpi/vendor/laminas/laminas-serializer/src)
monolog/monolog in (/var/www/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/var/www/glpi/vendor/sebastian/diff/src)
elvanto/litemoji in (/var/www/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/var/www/glpi/vendor/symfony/console)
scssphp/scssphp in (/var/www/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/var/www/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/var/www/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/var/www/glpi/vendor/rlanvin/php-rrule/src)
blueimp/jquery-file-upload in (/var/www/glpi/vendor/blueimp/jquery-file-upload/server/php)
ramsey/uuid in (/var/www/glpi/vendor/ramsey/uuid/src)
psr/log in (/var/www/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/var/www/glpi/vendor/psr/simple-cache/src)
mexitek/phpcolors in (/var/www/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/var/www/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/var/www/glpi/vendor/guzzlehttp/psr7/src)
wapmorgan/unified-archive in (/var/www/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/var/www/glpi/vendor/paragonie/sodium_compat/src)
phpCas version 1.3.3 in (/usr/share/php)

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP+SSL (dinesh.ks@ignitarium.com@smtp.gmail.com)

Mails receivers
 

Plugins list
 
	fields               Name: Additionnal fields             Version: 1.12.3     State: Error / to clean
	datainjection        Name: Data injection                 Version: 2.9.0      State: Error / to clean
	oauthimap            Name: Oauth IMAP                     Version: 1.0.3      State: Error / to clean
	phpsaml              Name: PHP SAML                       Version: 0          State: Error / to clean

Last edited by dinesh.ks (2021-05-04 20:56:55)

Offline

#2 2021-05-04 20:58:40

oj69
Member
From: Somewhere in the cloud
Registered: 2021-02-01
Posts: 117

Re: Mails are struck in QueuedNotification

The cron-job is running with a wrong user context. It should be running in the same user context like your apache2 webserver. This is mostly www-data. Please check your settings.

Hope this helps

Offline

#3 2021-05-04 21:03:52

oj69
Member
From: Somewhere in the cloud
Registered: 2021-02-01
Posts: 117

Re: Mails are struck in QueuedNotification

if you run "crontab -l -u www-data" it should look like that:

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
* * * * * /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null

Offline

#4 2021-05-04 21:08:45

dinesh.ks
Member
Registered: 2021-05-04
Posts: 4

Re: Mails are struck in QueuedNotification

oj69 wrote:

The cron-job is running with a wrong user context. It should be running in the same user context like your apache2 webserver. This is mostly www-data. Please check your settings.

Hope this helps


Thanks for the update.
As i checked with www-data, still getting the same error
Please find the below image


Email Notification

Last edited by dinesh.ks (2021-05-04 21:09:26)

Offline

#5 2021-05-04 21:13:32

oj69
Member
From: Somewhere in the cloud
Registered: 2021-02-01
Posts: 117

Re: Mails are struck in QueuedNotification

Can not see your image. What is it telling ? How about the cron logfile ? Please try to manualy run it and see what will happened. Could you successfully run it ?

Offline

#6 2021-05-04 21:24:46

dinesh.ks
Member
Registered: 2021-05-04
Posts: 4

Re: Mails are struck in QueuedNotification

oj69 wrote:

Can not see your image. What is it telling ? How about the cron logfile ? Please try to manualy run it and see what will happened. Could you successfully run it ?

Cron job is running , but didn't get any email notifications


# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
* * * * * /usr/bin/php7.2 /var/www/glpi/front/cron.php &>/dev/null
May  5 00:50:01 itserver CRON[7819]: (www-data) CMD (/usr/bin/php7.2 /var/www/glpi/front/cron.php &>/dev/null)
May  5 00:51:01 itserver CRON[7832]: (www-data) CMD (/usr/bin/php7.2 /var/www/glpi/front/cron.php &>/dev/null)
May  5 00:52:01 itserver CRON[7838]: (www-data) CMD (/usr/bin/php7.2 /var/www/glpi/front/cron.php &>/dev/null)
May  5 00:53:01 itserver CRON[7845]: (www-data) CMD (/usr/bin/php7.2 /var/www/glpi/front/cron.php &>/dev/null)
May  5 00:54:01 itserver CRON[7848]: (www-data) CMD (/usr/bin/php7.2 /var/www/glpi/front/cron.php &>/dev/null)

Last edited by dinesh.ks (2021-05-04 21:28:06)

Offline

#7 2021-05-05 19:20:43

oj69
Member
From: Somewhere in the cloud
Registered: 2021-02-01
Posts: 117

Re: Mails are struck in QueuedNotification

If you run the command manually in your session ? any results ? error messages ?

Offline

#8 2021-05-05 19:49:58

dinesh.ks
Member
Registered: 2021-05-04
Posts: 4

Re: Mails are struck in QueuedNotification

oj69 wrote:

If you run the command manually in your session ? any results ? error messages ?

Issue resolved.


Hi,

Thanks for the help smile

Lastly, I resolved the issue, crontab with www-data not working.

But when I manually run the cron job with debugging, QueuedNotification is executed. So created a file with this below command and added it in the root crontab. now mails are receiving when new tickets are created.

root user crontab:
*/5 * * * *   /bin/sh /home/dinesam/glpi-cron.sh
glpi-cron.sh:

sudo /usr/bin/php /var/www/glpi/front/cron.php --force QueuedNotification

Offline

Board footer

Powered by FluxBB