Hi,
It is the second time we get the token not refreshing issue. And both happened when I was of for more than 2 days and not connected to osTicket. I don't know if it is a coincidence. Never had this issue over the weekend.

End of the year I was off, but my colleagues were working with osTicket. No emails were fetched and so not ticket created.
To get it fetching again, I had to go to email settings - config and submit, Then it asks me for the user and password and then the token get refreshed after a few minutes and emails a fetched again.
It was working perfectly; fetching emails with both options enable : Email Fetching and Fetch on auto-cron.
Then lately I was off again a few days and after 2 or 3 days the Token did not refresh and so no email was fetched. My collogues were connected to osTicket.

If this is really related to me not been connected for some days, is there a way to give the email authorization in a way that when I am not logged in for a few days, the token can refresh ? Or the did I set something wrong.

We use generic email addresses on Microsoft.

Thanks in advance for your help.
Cheers,

Server Information
osTicket Version v1.17.5 (7c20036) — Up to date
Web Server Software Apache/2.4.37 () OpenSSL/1.1.1g Phusion_Passenger/6.0.6
MySQL Version 5.7.34
PHP Version 8.0.11
PHP Extensions
gdlib Used for image manipulation and PDF printing
imap Used for email fetching
xml XML API
xml-dom Used for HTML email processing
json Improves performance creating and processing JSON
mbstring Highly recommended for non western european language content
phar Highly recommended for plugins and language packs
intl Highly recommended for non western european language content
fileinfo Used to detect file types for uploads
zip Used for ticket and task exporting
APCu Improves overall performance
Zend Opcache Improves overall performance

    KevinTheJedi

    Hi,
    About the cron job, my former colleague did it and we have in the logs "Cron Job - Cron job executed [CLI] every 5 minutes.

    We have this task running :
    */5 * * * * /home/asinstru/crons/osticket_check_mails.sh

    The called script is the following:
    #!/usr/bin/bash
    cd /home/asinstru/support.insiders.live/public/api
    /opt/remi/php80/root/bin/php ./cron.php

    Cheers,

      angeland_asi

      If you set your default log level to debug and wait for cron to run a few times do you see entries in the logs that say “cron job executed”?

      Also, if you have a cron job you need to disable the fetch on auto-cron setting. You only need the “Enable” checkbox checked.

      Cheers.

        KevinTheJedi

        Our default log level is already in debug and yes we get "Cron job executed [CLI]" every 5 minutes.
        Ok, I unchecked the box "Fetch on auto-cron" and kept only “Enable” box checked.
        Thanks, I will see if I can test not been connected for some days.

        Cheers,

          angeland_asi

          That is quite interesting. Are you using O365? Are you using v1.17.5 with the latest build of the OAuth2 plugin? The latest build of the plugin is quite important.

          Cheers.

            angeland_asi

            Don’t go off the plugin version as we don’t change it unless there are major changes. I would recommend downloading the latest build and installing it just to be 100% sure. We used to have an old bug where the Refresh Token wasn’t being updated so the token refresh would fail. This has since been addressed.

            The only other thing I can think of is if the account had some changes that invalidated the token or something.

            Also, idk why your previous admin made a bash file just for cron as you can simply have a single cron entry with no other files. For you the cron entry would be */5 * * * * /opt/remi/php80/root/bin/php /home/asinstru/support.insiders.live/public/api/cron.php.

            Cheers.

              KevinTheJedi

              To update the plugin with the last build I just need to replace the current .phar with the new one. Or do you recommande to do it differently in this case ?

              About the bash file. I don't know why he did it this way. I will check and try your exemple.
              Thanks

              Cheers,

                angeland_asi

                Yes, replace the existing plugin with the latest download and restart Apache and PHP-FPM (if you are running it).

                As far as the cron thing goes I don’t believe it’s an issue just curious as to why they did it that way when it involves more steps, etc.

                Cheers.

                  KevinTheJedi

                  It is working fine for now. I will see when I can do a test not been connected for some days.
                  I will give a feedback if the issue happens again.

                  Thank you a lot for your help.
                  Have a nice weekend. Cheers,

                  Write a Reply...