Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python django social auth对Google OpenID给出502错误,但仅对少数用户_Python_Django_Nginx_Openid_Django Socialauth - Fatal编程技术网

Python django social auth对Google OpenID给出502错误,但仅对少数用户

Python django social auth对Google OpenID给出502错误,但仅对少数用户,python,django,nginx,openid,django-socialauth,Python,Django,Nginx,Openid,Django Socialauth,在过去的几周里,我一直在和一个让我发疯的虫子斗争。 请帮忙 症状如下: 如果用户没有登录到GMail,他可以毫无问题地登录到我的网站(使用GMail openID)。 这将自动提示用户首先在GMail中进行身份验证 但是,如果用户已经在GMail中进行了身份验证,他会看到一个由nginx生成的502错误页面 这种情况只发生在少数用户身上(我不是他们中的一员),其中一人非常友好地进行了报道,甚至制作了一段视频来演示: 很奇怪,不是吗 我在django social auth的生产环境中添加了一些

在过去的几周里,我一直在和一个让我发疯的虫子斗争。 请帮忙

症状如下:

如果用户没有登录到GMail,他可以毫无问题地登录到我的网站(使用GMail openID)。 这将自动提示用户首先在GMail中进行身份验证

但是,如果用户已经在GMail中进行了身份验证,他会看到一个由nginx生成的502错误页面

这种情况只发生在少数用户身上(我不是他们中的一员),其中一人非常友好地进行了报道,甚至制作了一段视频来演示:

很奇怪,不是吗

我在django social auth的生产环境中添加了一些调试行,以尝试了解正在发生的事情(只需执行ctrl+f+logger以查找我的更改)

在这个设置中,健康登录尝试会在我的(django)日志文件中充满类似的内容


2013-09-06 11:19:26659[DEBUG]社交身份验证后端:auth_complete ARGS=(),KWARGS={…}
2013-09-06 11:19:26666[调试]社交授权后端:响应和状态/成功
2013-09-06 11:19:26675[调试]社会授权视图:获取用户:5ca95b48317944cd87b7d5af4b6e77
2013-09-06 11:19:26683[DEBUG]社交身份验证视图:返回重定向到:/

但是,此特定用户失败的登录尝试不会在django的日志文件中产生任何输出。 因此,它甚至不涉及视图方法

不过nginx上有一些日志

下面是错误登录尝试的情况(在/var/log/nginx/access.log中):

``` 130.225.243.86---[03/Sep/2013:13:23:39+0000]"得到/complete/google/?janrain\u nonce=2013-09-03T13%3A23%xxxxxxxxxx&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id\res&openid.op\u endpoint=https%3A%2F%2Fwww.google.com%2Fo8%2Fud&openid.response\u nonce=2013-09-03T13%3A23%38zwrngw3a2xtu2byq&openid.return=http%3A%2F%2F%2ffreedomorg%2fjan2fjan2f3%2F%2fn一旦%3D2013-09-03T13%253A23%253xxxxxxxxx和openid.assoc_handle=1.amlyxxxxxxxxxr5mkoxu-k-3cnkxxxxxxxxxxxxxxxxxxxxxxxxxgdepo3og和openid.signed=op_端点%2cloaded_id%2Cidentity%2Creturn到%2Cresponse_当前%2Cassoc_句柄%2Cns.ext1%2Cext1.mode%2Cext1.type.old_电子邮件%2Cext1.value.old电子邮件%2Cext1.type.first_名称%2Cext1.value.first_类型%2Cext1_名称%2Cext1.value.last_name%2Cext1.type.email%2Cext1.value.email&openid.sig=3n46muyn8wiwpvyijxj%2BeZqC7o%3D&openid.identity=https%3A%2F%2Fwww.google.com%2fcaccounts%2Fo8%2Fid%3Fid%3daitoawmjgmlrwuxxxxxxxxxxxxxxxxxtixgpq&openid.声明的id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3daitowmjjjjdgmlrowjd.openxq&opengqdxt1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch\u response&openid.ext1.type.old\u email=http%3A%2F%2F%2Fschema.openid.net%2fect%2fect%2Femail&openid.ext1.value.old\u email=xxxxxxxxx.junior%40gmail.com&openid.ext1.type.first\u name=http%3A%2F%2Faxschema%2Faxschema.org%2Ffirst&openid.ext1.value.first\u name=ext=http%3A%2F%2Faxschema.org%2fasmaneperson%2Flast&openid.ext1.value.last_name=Hougaard&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Faxschema.org%2Femail&openid.ext1.value.email=xxxxxxxxxxxxx.junior%40gmail.com http/1.1“502 575.0”“Mozilla/5.0(X11;Linux x86_64)AppleWebKit/537.36(KHTML,如Gecko)Chrome/29.0.1547.62 Safari/537.36”

```

这始终伴随着/var/log/nginx/errors.log中的一个条目,类似于:


2013/09/06 10:46:06[错误]667#0:*116533 recv()在从上游读取响应头时失败(104:由对等方重置连接),客户端:130.225.198.129,服务器:freedom赞助商.org,请求:得到//complete/google/?janrain\u nonce=2013-09-03T13%3A23%xxxxxxxxxx&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id\res&openid.op\u endpoint=https%3A%2F%2Fwww.google.com%2Fo8%2Fud&openid.response\u nonce=2013-09-03T13%3A23%38zwrngw3a2xtu2byq&openid.return\u=http%3A%2F%2ffreedomorg%2fjanjan2f%2F%2f3%2F_nonce%3D2013-09-03T13%253A23%253xxxxxxxxx和openid.assoc_handle=1.amlyxxxxxxxxxr5kxu-\u k_-3cnkxxxxxxxxxxxxxxxxxxxxxxxxxgdepo3og和openid.signed=op_端点%2cclaid_id%2Cidentity%2Creturn_到%2Cresponse_%2Cassoc_句柄%2Cns.ext1.mode%2Cext1.type.old_电子邮件%2Cext1.value.old电子邮件%2Cext1.type.first名称%2Cext1.name.value.first.typeast_name%2Cext1.value.last_name%2Cext1.type.email%2Cext1.value.email&openid.sig=3n46muyn8wiwpvyijjj%2BeZqC7o%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3daitoawmgmljd-ouxxxxxxxxxtixgpmjq&openid.claid=https%3A%2F%2Fwww.google.com%2Fo8%2Fid%3Fid%3daitoawmgxjjdxjq&openxins、 ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch\u response&openid.ext1.type.old\u email=http%3A%2F%2Fschema.openid.net%2fectact%2Femail&openid.ext1.value.old\u email=xxxxxxxxxxxxx.junior%40gmail.com&openid.ext1.type.first\u name=http%3A%2F%2Faxschema%2Faxschema.org%2Ffirst&openid.ext1.value.first\u name=extme=http%3A%2F%2Faxschema.org%2fame&openid.ext1.value.last\u name=Hougaard&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2fectact%2Femail&openid.ext1.value.email=xxxxxxxxx.junior%40gmail.com http/1.1“,上游:”uwsgi://unix:///tmp/frespo.sock:,主机:“freedom赞助商.org”,推荐人:http://freedomsponsors.org/login/google/"

好的登录尝试看起来完全一样(在access.log中),但不是以


502 575 "http://freedomsponsors.org/login/google/“Mozilla/5.0(X11;Linux x86_64)AppleWebKit/537.36(KHTML,类似Gecko)Chrome/29.0.1547.62 Safari/537.36”

它以


302 5“-”Mozilla/5.0(X11;Linux x86_64)AppleWebKit/537.36(KHTML,类似Gecko)Chrome/29.0.1547.62 Safari/537.36

当然,它不会在error.log中生成任何条目

我的生产环境是一个带有文件套接字的标准nginx+uswgi,非常像这样