Uncaught exception ‘InvalidArgumentException’ w/message ‘Invalid token format’
-
Hi @naa986,
Great plugin (so far) but the emails are not sending.
This is what error.log of our hosting says;[Tue Dec 12 14:50:44.039355 2017] [lsapi:error] [pid 452193:tid 140040010450688] [client 212.xx.xx.xxx:51883] [host www.mydomain.com] Backend fatal error: PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Invalid token format' in /home/myuser/domains/mydomain.com/public_html/v2/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Client.php:434\nStack trace:\n#0 /home/myuser/domains/mydomain.com/public_html/v2/wp-content/plugins/gmail-smtp/class.phpmaileroauthgoogle.php(139): Google_Client->setAccessToken('{"error":"inval...')\n#1 /home/myuser/domains/mydomain.com/public_html/v2/wp-content/plugins/gmail-smtp/PHPMailer/class.smtp.php(475): GmailXOAuth2->getOauth64()\n#2 /home/myuser/domains/mydomain.com/public_html/v2/wp-content/plugins/gmail-smtp/class.phpmaileroauth.php(153): SMTP->authenticate('', '', 'XOAUTH2', '', '', Object(GmailXOAuth2))\n#3 /home/myuser/domains/mydomain.com/public_html/v2/wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php(1542): PHPMailerOAuth->smtpConnect(Array)\n#4 /home/myuser/domains/mydomain.com/public_html/v2/wp-content/plugins/gmail-smtp/PHPMailer/class.phpmailer.php(1337): PHPMailer->smtpS in /home/myuser/domains/mydomain.com/public_html/v2/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Client.php on line 434\n, referer: https://www.mydomain.com/v2/wp-admin/options-general.php?page=gmail-smtp-settings&action=test-email
this is what the plugin gives as result after trying to send a test email;
2017-12-12 13:50:42 Connection: opening to smtp.gmail.com:587, timeout=300, options=array () 2017-12-12 13:50:43 Connection: opened 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "220 smtp.gmail.com ESMTP v20sm8019741edm.10 - gsmtp" 2017-12-12 13:50:43 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP v20sm8019741edm.10 - gsmtp 2017-12-12 13:50:43 CLIENT -> SERVER: EHLO www.mydomain.com 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [185.xx.xx.xx]" 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250-SIZE 35882577" 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250-8BITMIME" 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250-STARTTLS" 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-STARTTLS" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES" 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250-PIPELINING" 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250-CHUNKING" 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "250 SMTPUTF8" 2017-12-12 13:50:43 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2017-12-12 13:50:43 CLIENT -> SERVER: STARTTLS 2017-12-12 13:50:43 SMTP -> get_lines(): $data is "" 2017-12-12 13:50:43 SMTP -> get_lines(): $str is "220 2.0.0 Ready to start TLS" 2017-12-12 13:50:43 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS 2017-12-12 13:50:44 CLIENT -> SERVER: EHLO www.mydomain.com 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [185.xx.xx.xx]" 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250-SIZE 35882577" 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250-8BITMIME" 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH" 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES" 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250-PIPELINING" 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250-CHUNKING" 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "250 SMTPUTF8" 2017-12-12 13:50:44 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [185.xx.xx.xx]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2017-12-12 13:50:44 Auth method requested: XOAUTH2 2017-12-12 13:50:44 Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH 2017-12-12 13:50:44 CLIENT -> SERVER: QUIT 2017-12-12 13:50:44 SMTP -> get_lines(): $data is "" 2017-12-12 13:50:44 SMTP -> get_lines(): $str is "221 2.0.0 closing connection v20sm8019741edm.10 - gsmtp" 2017-12-12 13:50:44 SERVER -> CLIENT: 221 2.0.0 closing connection v20sm8019741edm.10 - gsmtp 2017-12-12 13:50:44 Connection: closed
Server info:
OS: Linux web01.myhost.com 2.6.32-673.26.1.lve1.4.30.el6.x86_64 #1 SMP Wed Jun 21 19:37:37 EDT 2017 x86_64 PHP version: 5.6.32 WordPress version: 4.9.1 WordPress multisite: No openssl: Available allow_url_fopen: Enabled stream_socket_client: Available fsockopen: Available cURL: Available cURL Version: 7.19.7, NSS/3.27.1
Sidenote; I’ve removed our domainname and IP from all lines.
- The topic ‘Uncaught exception ‘InvalidArgumentException’ w/message ‘Invalid token format’’ is closed to new replies.