Hi, as of today suddenly mails aren't being fetched. After a lot of trouble shooting I upgraded to 1.17.2 and also included the new Oauth plugin.
osTicket versie v1.17.2 (8fbc7ee) — Bij de tijd
Web Server Software Apache/2.4.52 (Ubuntu)
MySQLversie 8.0.31
PHPversie 8.1.13

However, when configuring Oauth (again, which was working properly) it keeps hanging on provisioning:

Apache logs says:

[Wed Dec 28 16:13:08.080191 2022] [php:error] [pid 62072] [client xx.xx.xx.xx:63717] PHP Fatal error:  Uncaught Error: Call to a member function setConfigClass() on null in phar:///var/www/html/support/include/plugins/auth-oauth2.phar/oauth2.php:601\nStack trace:\n#0 /var/www/html/support/include/class.email.php(682): GenericEmailOauth2Provider->getPluginInstance()\n#1 /var/www/html/support/include/ajax.email.php(26): EmailAccount->saveAuth()\n#2 /var/www/html/support/include/class.dispatcher.php(153): EmailAjaxAPI->configureAuth()\n#3 /var/www/html/support/include/class.dispatcher.php(40): UrlMatcher->dispatch()\n#4 /var/www/html/support/include/class.dispatcher.php(122): Dispatcher->resolve()\n#5 /var/www/html/support/include/class.dispatcher.php(40): UrlMatcher->dispatch()\n#6 /var/www/html/support/scp/ajax.php(326): Dispatcher->resolve()\n#7 {main}\n  thrown in phar:///var/www/html/support/include/plugins/auth-oauth2.phar/oauth2.php on line 601, referer: https://support.xx.nl/scp/emails.php?id=1
[Wed Dec 28 16:13:53.270986 2022] [php:error] [pid 62082] [client xx.xx.xx.xx:63755] PHP Fatal error:  Uncaught Error: Call to a member function setConfigClass() on null in phar:///var/www/html/support/include/plugins/auth-oauth2.phar/oauth2.php:601\nStack trace:\n#0 /var/www/html/support/include/class.email.php(682): GenericEmailOauth2Provider->getPluginInstance()\n#1 /var/www/html/support/include/ajax.email.php(26): EmailAccount->saveAuth()\n#2 /var/www/html/support/include/class.dispatcher.php(153): EmailAjaxAPI->configureAuth()\n#3 /var/www/html/support/include/class.dispatcher.php(40): UrlMatcher->dispatch()\n#4 /var/www/html/support/include/class.dispatcher.php(122): Dispatcher->resolve()\n#5 /var/www/html/support/include/class.dispatcher.php(40): UrlMatcher->dispatch()\n#6 /var/www/html/support/scp/ajax.php(326): Dispatcher->resolve()\n#7 {main}\n  thrown in phar:///var/www/html/support/include/plugins/auth-oauth2.phar/oauth2.php on line 601, referer: https://support.xx.nl/scp/emails.php?id=1
[Wed Dec 28 16:17:12.936800 2022] [php:error] [pid 62075] [client xx.xx.xx.xx:63833] PHP Fatal error:  Uncaught Error: Call to a member function setConfigClass() on null in phar:///var/www/html/support/include/plugins/auth-oauth2.phar/oauth2.php:601\nStack trace:\n#0 /var/www/html/support/include/class.email.php(682): GenericEmailOauth2Provider->getPluginInstance()\n#1 /var/www/html/support/include/ajax.email.php(26): EmailAccount->saveAuth()\n#2 /var/www/html/support/include/class.dispatcher.php(153): EmailAjaxAPI->configureAuth()\n#3 /var/www/html/support/include/class.dispatcher.php(40): UrlMatcher->dispatch()\n#4 /var/www/html/support/include/class.dispatcher.php(122): Dispatcher->resolve()\n#5 /var/www/html/support/include/class.dispatcher.php(40): UrlMatcher->dispatch()\n#6 /var/www/html/support/scp/ajax.php(326): Dispatcher->resolve()\n#7 {main}\n  thrown in phar:///var/www/html/support/include/plugins/auth-oauth2.phar/oauth2.php on line 601, referer: https://support.xx.nl/scp/emails.php?id=1

    I already did that multiple times but I did it again: It says:

    But, when saving it says:

      Rickymundo

      That means you are not logging in as the email itself to consent and get the token. The documentation clearly states that when you get redirected to MS you must login as the email you are setting up in osTicket to consent/authorize.

      Cheers.

      But that’s exactly what I’m doing. Please keep in mind it was working with Oauth until this morning. Suddenly it stopped. What else can it be?

        How can I figure out what is causing the error: cannot select INBOX, is this a valid transport?

          Rickymundo

          You really can’t unless you debug the code. The only time I’ve seen this is when using an account other than the email itself to consent/authorize.

          Cheers.

            Rickymundo

            Right but to be fair none of your issue makes sense if you are following the documentation. Make sure you are using official package of v1.17.2 from our website. Make sure you are using the latest build of the OAuth2 plugin. Try going to the database and delete the relevant ost_email_account records matching the email_id of the email having issues. Then you can go in and reconfigure modern auth.

            Cheers.

              Make sure your browser cache is cleared, or just use another browser

              Deleted ALL the browser cookies, started in incognito, deleted the app registration and created a new one, tried it on aonther computer. No matter what I do, I keep getting:

              Can you please explain to me what the error in fact means?

              Legacy login works perfectly. I even went into the mysql tables and deleted references to the account.

              Same issue here, having checked IMAP using other accounts and on different clients, this looks to be a Microsoft issue, although no acknowledgement as yet.

              Looks to have started after approx. 19:00 (GMT) on 27th December.

                I'm having the exact same issue as well, the oauth2 process works, tokens get refreshed, but no emails are being fetched anymore and the error "cannot select INBOX, is this a valid transport?" pops up every time when trying to save.
                I was originally using version 0.2 of the oauth2 plugin, but updating it didn't help.
                I can also confirm that the issue started about 2 days ago, with no issues for months before that.

                cubanp3te

                Why do you believe that? That really gives me a bit of hope since I was about to lose it....

                Found more issue I think might be related:

                Link (https://sugarclub[dot]sugarcrm[dot]com/explore/help-forums/enterprise-professional/f/enterprise-professional-questions/6111/group-email-account-not-archiving-from-mailbox)

                Another (https://pullanswer[dot]com/questions/collector-not-working-imap-oauth-tag2-bad-user-is-authenticated-but-not-connected)

                And another

                It looks like an IPv6 issue though, please follow this guide and test it:

                https://itsfoss[dot]com/disable-ipv6-ubuntu-linux/

                Looks like it's working when I disable IPv6. Can't explain it though...

                  Rickymundo I was having the same issue that has been listed here and several other times.

                  I had tried ALL other fixes supplied and this was the only one that worked and I can confirm it worked.

                  Microsoft Support had confirmed to me that nothing had changed on the 27th December (mine stopped working then too). I will let them know this knowledge so they can investigate.

                  • az68 replied to this.