ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 627 forks source link

Timeout when registering new user #885

Open martin-bts opened 3 years ago

martin-bts commented 3 years ago

We are authenticating our users through an oauth2 provider. Essentially this works, but there is one issue when users log into Askbot for the first time:

After the first authentication there is a small helper page, where users provide a username and an email address for their Askbot account. When users submit this form, there is a timeout. The only thing I can see in my logs is

[26/Jan/2021:14:32:26 +0000] "GET /s/jsi18n/ HTTP/1.1" 200 4529 "https://ASKBOT/account/signin/complete-oauth2/?code=redacted&state=redacted" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36" "-"
[pid: 16|app: 0|req: 25/25] redacted IP () {50 vars in 1729 bytes} [Tue Jan 26 15:32:26 2021] GET /s/jsi18n/ => generated 4529 bytes in 14 msecs (HTTP/1.1 200) 3 headers in 103 bytes (1 switches on core 0)
2021/01/26 14:35:43 [error] 14#14: *40 upstream timed out (110: Operation timed out) while reading response header from upstream, client: redacted, server: , request: "POST /account/register/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/uwsgi.sock", host: "ASKBOT", referrer: "https://ASKBOT/account/signin/complete-oauth2/?code=redacted&state=redacted"
[26/Jan/2021:14:35:43 +0000] "POST /account/register/ HTTP/1.1" 504 570 "https://ASKBOT/account/signin/complete-oauth2/?code=redacted&state=redacted" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36" "-"

[Errno 110] Operation timed out
Tue Jan 26 15:36:58 2021 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /account/register/ (ip redacted) !!!
Tue Jan 26 15:36:58 2021 - uwsgi_response_write_headers_do(): Broken pipe [core/writer.c line 248] during POST /account/register/ (redacted)
OSError: write error
[pid: 16|app: 0|req: 26/26] redacted IP () {62 vars in 2126 bytes} [Tue Jan 26 15:32:43 2021] POST /account/register/ => generated 0 bytes in 254884 msecs (HTTP/1.1 302) 6 headers in 0 bytes (0 switches on core 0)

The account registration still works. As a user i simply revist the main site, I click on my SSO login button and I am immediately logged in to Askbot. Apparently everything is successful, but users have to endure a 504 error and revisit the site on their first visit.