Went to setup another WordPress website and needed the Auth Token for the client.
Attempts to create the token end up with a spinning wheel and nothing until the web browser (Edge latest, tried Firefox too) displays 504 Gateway Timeout.
I haven't done this for some time and the rest of the website works fine as far as I can tell.
Any other details (e.g. nginx configs) let me know.
Also this issue seemed to be very similar to mine but I have got my system running latest 20.04 LTS. Restarted multiple times. No joy.
Display of Auth Token
Gateway Timeout
Unknown. Searched Forums, Google.
Nginx Error Log:2022/03/29 21:56:29 [error] 104979<a href='/104979'>#104979</a>: *173 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.1.1, server: matomo.example.com, request: "POST /index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated= HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "matomo.example.com", referrer: "https://matomo.example.com/index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated="
Nginx Access Log:192.168.1.1 - - [29/Mar/2022:22:01:50 +0800] "GET /index.php?module=Login&action=confirmPassword&idSite=1&period=day&date=today&activated= HTTP/2.0" 200 25491 "https://matomo.example.com/index.php?module=UsersManager&action=userSecurity&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
192.168.1.1 - - [29/Mar/2022:22:01:50 +0800] "POST /index.php?date=today&module=API&format=json&method=API.getPagesComparisonsDisabledFor&segment=&idSite=1&period=day HTTP/2.0" 200 230 "https://matomo.example.com/index.php?module=Login&action=confirmPassword&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
192.168.1.1 - - [29/Mar/2022:22:01:50 +0800] "GET /index.php?module=UsersManager&action=userSecurity&idSite=1&period=day&date=today&activated= HTTP/2.0" 200 32141 "https://matomo.example.com/index.php?module=UsersManager&action=userSecurity&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
192.168.1.1 - - [29/Mar/2022:22:01:51 +0800] "POST /index.php?date=today&module=API&format=json&method=API.getPagesComparisonsDisabledFor&segment=&idSite=1&period=day HTTP/2.0" 200 230 "https://matomo.example.com/index.php?module=UsersManager&action=userSecurity&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
192.168.1.1 - - [29/Mar/2022:22:01:53 +0800] "GET /index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated= HTTP/2.0" 200 30476 "https://matomo.example.com/index.php?module=UsersManager&action=userSecurity&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
192.168.1.1 - - [29/Mar/2022:22:01:54 +0800] "POST /index.php?date=today&module=API&format=json&method=API.getPagesComparisonsDisabledFor&segment=&idSite=1&period=day HTTP/2.0" 200 230 "https://matomo.example.com/index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
192.168.1.1 - - [29/Mar/2022:22:01:59 +0800] "POST /index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated= HTTP/2.0" 499 0 "https://matomo.example.com/index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
192.168.1.1 - - [29/Mar/2022:22:02:59 +0800] "POST /index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated= HTTP/2.0" 504 569 "https://matomo.example.com/index.php?module=UsersManager&action=addNewToken&idSite=1&period=day&date=today&activated=" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
PHP Error Log:
Nothing
Hi @TechCare-Aus, thanks for reaching out.
Immediately after generating a user token Matomo will attempt to send the token details to the user in an email, once this email is sent then the 'token created successfully' view will be rendered.
So it's possible that something is causing the email send to hang long enough for the request to timeout.
It might be worth confirming that Matomo is able to send emails using the console command documented in this FAQ
or disable email sending temporarily by adding emails_enabled = 0
to the [General] section of
config/config.ini.php` and then trying the token generation again.
@bx80 - you sir are a legend. Exactly the cause of the issue. Thankyou.
I removed SMTP settings and it immediately worked.
Would be great to see an error message about that on the GUI.
"Error - Unable to send email. Check SMTP settings and try again"
You're welcome :smiley:
I've created a new ticket so we can look at improving how things are handled when there is a mail configuration problem.
Just experienced the exact same issue. Found the answer here (problem with SMTP configuration).
Thanks for pointing out the solution here - maybe, as a quick "fix", this info could be added to some FAQ?