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.24k stars 1.29k forks source link

Cronjob not triggering automatic actions #13416

Closed gkukovacec closed 1 year ago

gkukovacec commented 1 year ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.5

Bug description

CLI mode doesn't work. Cron log shows Internal #1: Nothing to Launch on every execution.

Email notifications are correctly set up. Test email to administrator works fine.

Upon creating ticket, notification list gets correctly populated (and can be sent manually, emails are sent).

Automatic action of queuednotification is not triggered at all, I have double-checked that it's set to CLI run mode and has status Scheduled. If executed manually notifications are sent. If set to GLPI mode, notifications eventually get sent.

I guess Cronjob works fine, I get this email message from Cron:

_X-Powered-By: PHP/7.4.33 Set-Cookie: glpi_dea0aedf958b8e6c1734f2744227d1ec=23f70cb5961a552d5d5eca1daf9a90b9; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Content-Type: image/gif Content-Length: 63 Cache-Control: no-cache,no-store Pragma: no-cache Connection: close

GIF89a_

So queuednotification was not triggered by Cronjob even once.

Please advise. Am I missing something?

Thanks!

Relevant log output

No response

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

Information about system installation & configuration
GLPI 10.0.5 (/glpi => /home/getimin5/public_html/glpi)
Installation mode: TARBALL
Current language:en_US

Server
 
Operating system: Linux server.getim.hr 4.18.0-348.20.1.lve.1.el8.x86_64 #1 SMP Wed Mar 16 08:45:39 EDT 2022 x86_64
PHP 7.4.33 cgi-fcgi (Core, PDFlib, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, bz2, calendar, cgi-fcgi, ctype,
    curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, json, ldap, libxml, mailparse,
    mbstring, mysqli, mysqlnd, openssl, pcntl, pcre, pdo_mysql, pdo_sqlite, posix, readline, session, shmop, soap, sockets, sodium,
    sqlite3, standard, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="90" memory_limit="128M" post_max_size="64M" safe_mode="" session.save_handler="files"
    upload_max_filesize="64M" 
Software: Apache ()
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Server Software: MySQL Community Server - GPL
    Server Version: 8.0.31-cll-lve
    Server SQL Mode: STRICT_TRANS_TABLES,ALLOW_INVALID_DATES
    Parameters: getimin5_dbuser@localhost/getimin5_03
    Host info: Localhost via UNIX socket

PHP version (7.4.33) 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 (8.0.31) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /home/getimin5/public_html/glpi/files/_cache has been validated.
Write access to /home/getimin5/public_html/glpi/config has been validated.
Write access to /home/getimin5/public_html/glpi/files/_cron has been validated.
Write access to /home/getimin5/public_html/glpi/files has been validated.
Write access to /home/getimin5/public_html/glpi/files/_dumps has been validated.
Write access to /home/getimin5/public_html/glpi/files/_graphs has been validated.
Write access to /home/getimin5/public_html/glpi/files/_lock has been validated.
Write access to /home/getimin5/public_html/glpi/files/_pictures has been validated.
Write access to /home/getimin5/public_html/glpi/files/_plugins has been validated.
Write access to /home/getimin5/public_html/glpi/files/_rss has been validated.
Write access to /home/getimin5/public_html/glpi/files/_sessions has been validated.
Write access to /home/getimin5/public_html/glpi/files/_tmp has been validated.
Write access to /home/getimin5/public_html/glpi/files/_uploads has been validated.
The following directories should be placed outside "/home/getimin5/public_html/glpi":
‣ "/home/getimin5/public_html/glpi/files" ("GLPI_VAR_DIR")
‣ "/home/getimin5/public_html/glpi/config" ("GLPI_CONFIG_DIR")
You can ignore this suggestion if you are certain that these directories are not accessible through your web server.
PHP directive "session.cookie_secure" should be set to "on" when GLPI can be accessed on HTTPS protocol.
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 /home/getimin5/public_html/glpi/marketplace has been validated.
Access to timezone database (mysql) is not allowed.

GLPI constants
 
GLPI_ROOT: "/home/getimin5/public_html/glpi"
GLPI_CONFIG_DIR: "/home/getimin5/public_html/glpi/config"
GLPI_VAR_DIR: "/home/getimin5/public_html/glpi/files"
GLPI_MARKETPLACE_DIR: "/home/getimin5/public_html/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: 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: "/home/getimin5/public_html/glpi/files"
GLPI_CACHE_DIR: "/home/getimin5/public_html/glpi/files/_cache"
GLPI_CRON_DIR: "/home/getimin5/public_html/glpi/files/_cron"
GLPI_DUMP_DIR: "/home/getimin5/public_html/glpi/files/_dumps"
GLPI_GRAPH_DIR: "/home/getimin5/public_html/glpi/files/_graphs"
GLPI_LOCAL_I18N_DIR: "/home/getimin5/public_html/glpi/files/_locales"
GLPI_LOCK_DIR: "/home/getimin5/public_html/glpi/files/_lock"
GLPI_LOG_DIR: "/home/getimin5/public_html/glpi/files/_log"
GLPI_PICTURE_DIR: "/home/getimin5/public_html/glpi/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/home/getimin5/public_html/glpi/files/_plugins"
GLPI_RSS_DIR: "/home/getimin5/public_html/glpi/files/_rss"
GLPI_SESSION_DIR: "/home/getimin5/public_html/glpi/files/_sessions"
GLPI_TMP_DIR: "/home/getimin5/public_html/glpi/files/_tmp"
GLPI_UPLOAD_DIR: "/home/getimin5/public_html/glpi/files/_uploads"
GLPI_INVENTORY_DIR: "/home/getimin5/public_html/glpi/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: "/home/getimin5/public_html/glpi/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 (/home/getimin5/public_html/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.6.0 in (/home/getimin5/public_html/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/home/getimin5/public_html/glpi/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.4.4 in (/home/getimin5/public_html/glpi/plugins/pdf/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/home/getimin5/public_html/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/home/getimin5/public_html/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/home/getimin5/public_html/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/home/getimin5/public_html/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/home/getimin5/public_html/glpi/vendor/sabre/http/lib)
sabre/uri in (/home/getimin5/public_html/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/home/getimin5/public_html/glpi/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/home/getimin5/public_html/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/home/getimin5/public_html/glpi/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/home/getimin5/public_html/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/home/getimin5/public_html/glpi/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/home/getimin5/public_html/glpi/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/home/getimin5/public_html/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/home/getimin5/public_html/glpi/vendor/symfony/console)
scssphp/scssphp in (/home/getimin5/public_html/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/home/getimin5/public_html/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/home/getimin5/public_html/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/home/getimin5/public_html/glpi/vendor/rlanvin/php-rrule/src)
blueimp/jquery-file-upload in (/home/getimin5/public_html/glpi/vendor/blueimp/jquery-file-upload/server/php)
ramsey/uuid in (/home/getimin5/public_html/glpi/vendor/ramsey/uuid/src)
psr/log in (/home/getimin5/public_html/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/home/getimin5/public_html/glpi/vendor/psr/simple-cache/src)
psr/cache in (/home/getimin5/public_html/glpi/vendor/psr/cache/src)
league/csv in (/home/getimin5/public_html/glpi/vendor/league/csv/src)
mexitek/phpcolors in (/home/getimin5/public_html/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/home/getimin5/public_html/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/home/getimin5/public_html/glpi/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/home/getimin5/public_html/glpi/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/home/getimin5/public_html/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/home/getimin5/public_html/glpi/vendor/paragonie/sodium_compat/src)
symfony/cache in (/home/getimin5/public_html/glpi/vendor/symfony/cache)
html2text/html2text in (/home/getimin5/public_html/glpi/vendor/html2text/html2text/src)
symfony/css-selector in (/home/getimin5/public_html/glpi/vendor/symfony/css-selector)
symfony/dom-crawler in (/home/getimin5/public_html/glpi/vendor/symfony/dom-crawler)
twig/twig in (/home/getimin5/public_html/glpi/vendor/twig/twig/src)
twig/string-extra in (/home/getimin5/public_html/glpi/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 in (/home/getimin5/public_html/glpi/vendor/symfony/polyfill-php80)
symfony/polyfill-php81 in (/home/getimin5/public_html/glpi/vendor/symfony/polyfill-php81)
symfony/polyfill-php82 in (/home/getimin5/public_html/glpi/vendor/symfony/polyfill-php82)

SQL replicas
 
Not active

Notifications
 
Way of sending emails: PHP

Plugins list
 
    barcode              Name: Barcode                        Version: 2.7.1      State: Installed / not activated               
        Install Method: Marketplace
    datainjection        Name: Data injection                 Version: 2.12.0     State: Enabled                                 
        Install Method: Marketplace
    glpiinventory        Name: GLPI Inventory                 Version: 1.0.5      State: Installed / not activated               
        Install Method: Marketplace
    addressing           Name: IP Adressing                   Version: 3.0.1      State: Not installed                           
        Install Method: Marketplace
    pdf                  Name: Print to pdf                   Version: 3.0.0      State: Enabled                                 
        Install Method: Manual
    shellcommands        Name: Shell Commands                 Version: 4.0.1      State: Installed / not activated               
        Install Method: Marketplace
    useditemsexport      Name: Used items export              Version: 2.5.1      State: Installed / not activated               
        Install Method: Marketplace

Anything else?

No response

cconard96 commented 1 year ago

How are you calling/running the Cron script from the cron job?

gkukovacec commented 1 year ago

Hi!

/usr/bin/php /home/xxxxxxxx/public_html/glpi/front/cron.php

Scheduled every minute in cPanel on Linux server.

Thanks! Goran

On 27.11.2022., at 11:19, Curtis Conard @.***> wrote:



How are you calling/running the Cron script from the cron job?

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

cconard96 commented 1 year ago

The check used to determine if cron.php is called from the CLI or web server doesn't seem to be working in that case. The email you receive should only be returned when called from the web server as that empty image is used to defer GLPI mode automatic actions to an async request. In CLI mode, it should trigger some CLI mode actions and return nothing in the response.

A quick search reveals that cPanel puts CGI PHP binaries in /usr/bin instead of the CLI PHP binary. You would need to use the path /usr/local/bin/php instead for CLI mode.

This isn't a GLPI bug, just an odd behavior of cPanel.

gkukovacec commented 1 year ago

I can confirm that this solved the problem.

Thanks @cconard96!