I am having a weird problem with Email to ticket. It only pulls from the IMAP after a reboot. Other wise the email stay in the inbox. Once I reboot it pulls the Cron is enabled and show that it's running. When I try and run the cron manually it tells me it's already running. Unfortunately I am unsure what to look at to try an pin point what's going on. I using Zoho mail with a custom domain. Like I said all the emails get pulled once it reboot and comes backup. It almost like a service.

TIA for any help,

Brent

    Would you run the following command and report the output?

    tail -f /var/log/apache2/error.log

      brentc

      Johnny added a lock file a while ago to prevent the same cron script running at the same time. These should clear themselves up, which would indicate an issue with your Cron job not finishing cleanly.

      Can you check /tmp for any sort of ITFlow lock files (and remove if present).

        psiiota

        Here is the log file.

        itadmin@techguru:~$ tail -f /var/log/apache2/error.log

        [Wed Oct 11 10:45:52.070407 2023] [php:warn] [pid 923] [client 192.168.50.3:46938] PHP Warning: Undefined array key "settings_timezone" in /var/www/helpdesk.tgha.net/check_login.php on line 55, referer: https://helpdesk.tgha.net/client_tickets.php?client_id=1

        [Wed Oct 11 10:45:52.073651 2023] [php:notice] [pid 923] [client 192.168.50.3:46938] PHP Notice: date_default_timezone_set(): Timezone ID '$session_timezone' is invalid in /var/www/helpdesk.tgha.net/check_login.php on line 58, referer: https://helpdesk.tgha.net/client_tickets.php?client_id=1

        [Wed Oct 11 10:46:57.074599 2023] [php:warn] [pid 922] [client 192.168.50.3:34498] PHP Warning: Undefined array key "settings_timezone" in /var/www/helpdesk.tgha.net/check_login.php on line 55, referer: https://helpdesk.tgha.net/client_logs.php?client_id=1

        [Wed Oct 11 10:46:57.077833 2023] [php:notice] [pid 922] [client 192.168.50.3:34498] PHP Notice: date_default_timezone_set(): Timezone ID '$session_timezone' is invalid in /var/www/helpdesk.tgha.net/check_login.php on line 58, referer: https://helpdesk.tgha.net/client_logs.php?client_id=1

        [Wed Oct 11 10:46:59.270890 2023] [php:warn] [pid 923] [client 192.168.50.3:46398] PHP Warning: Undefined array key "settings_timezone" in /var/www/helpdesk.tgha.net/check_login.php on line 55, referer: https://helpdesk.tgha.net/clients.php

        [Wed Oct 11 10:46:59.270970 2023] [php:notice] [pid 923] [client 192.168.50.3:46398] PHP Notice: date_default_timezone_set(): Timezone ID '$session_timezone' is invalid in /var/www/helpdesk.tgha.net/check_login.php on line 58, referer: https://helpdesk.tgha.net/clients.php

        [Wed Oct 11 10:47:01.269492 2023] [php:warn] [pid 924] [client 192.168.50.3:46406] PHP Warning: Undefined array key "settings_timezone" in /var/www/helpdesk.tgha.net/check_login.php on line 55, referer: https://helpdesk.tgha.net/users.php

        [Wed Oct 11 10:47:01.272670 2023] [php:notice] [pid 924] [client 192.168.50.3:46406] PHP Notice: date_default_timezone_set(): Timezone ID '$session_timezone' is invalid in /var/www/helpdesk.tgha.net/check_login.php on line 58, referer: https://helpdesk.tgha.net/users.php

        [Wed Oct 11 10:47:31.342237 2023] [php:warn] [pid 922] [client 192.168.50.3:37484] PHP Warning: Undefined array key "settings_timezone" in /var/www/helpdesk.tgha.net/check_login.php on line 55, referer: https://helpdesk.tgha.net/logs.php

        [Wed Oct 11 10:47:31.342290 2023] [php:notice] [pid 922] [client 192.168.50.3:37484] PHP Notice: date_default_timezone_set(): Timezone ID '$session_timezone' is invalid in /var/www/helpdesk.tgha.net/check_login.php on line 58, referer: https://helpdesk.tgha.net/logs.php

          wrongecho I did have a lock file in the /tmp I removed it but it came back after about a minute.

            brentc I can delete the lock file it will pull the email but will not move it to the ITFlow folder in the mailbox each time I delete the lock file it pulls the same email. And that's all it does. Doesn't send notifications

            The errors for the cron will not show in the apache error log unfortunately as they are being run by cron.

            We are going to need to see the output of manually running the crons. Something must be breaking when executing cron

            So here's what we need to do to get a valid error output:

            1. Stop the System from executing the crons temporarily
            2. delete the lock files itflow*.local from the tmp folder
            3. run the crons manually on the command line and copy the output to this post

              johnny I only got and output from the ticket_email_parser.php the rest no output was generated

              Output from command sudo -u www-data php /var/www/helpdesk.tgha.net/cron_ticket_email_parser.php XYlpMcxZDeePWTjvfyoO ..

              Created new ticket.<br>PHP Fatal error: Uncaught mysqli_sql_exception: Incorrect string value: '\xF0\x9F\x94\xB4 D...' for column `itflow`.`email_queue`.`email_subject` at row 1 in /var/www/helpdesk.tgha.net/cron_ticket_email_parser.php:153

              Stack trace:

              #0 /var/www/helpdesk.tgha.net/cron_ticket_email_parser.php(153): mysqli_query()

              #1 /var/www/helpdesk.tgha.net/cron_ticket_email_parser.php(400): addTicket()

              #2 {main}

              thrown in /var/www/helpdesk.tgha.net/cron_ticket_email_parser.php on line 153

              @johnny @wrongecho @psiiota

              Okay don't hate me, I do apologize for wasting your time. But I really appreciate the help. However I do believe I have found the problem. I disabled IPV6 on the server and now incoming email tickets, ticket notifications are now all flowing as normal. I just flooded it with 20 email one right after the other and they all came through along with the notifications. That's been the cause of several issues I've been having. And now so far so good. Again thanks for the help ya'll are so awesome and it such an awesome product you have created.

              Thanks Again,

              Brent

                brentc Thank you for the kind words, I most certainly do not hate you haha, and I'm sure the team does not either. This is an interesting resolution, but on the MSP side, I always disable everything IPv6.

                brentc

                Thanks for updating with the solution. Ipv6 continues to cause weird and wonderful issues..