繁体   English   中英

错误:使用Boto python时,“请求中包含的安全令牌无效”

[英]Error: “The security token included in the request is invalid” when using Boto python

当我在nginx上运行我的django项目时,我收到此错误。 我使用dynamodb作为数据库,S3使用S3来提供项目中的静态文件。 在localhost上运行时,该项目运行正常。

该项目最初是在另一个ec2实例中托管的,它运行起来就像魅力一样。 我从该实例的图像中启动了一个新的ec2实例。 而现在它正在抛出这个错误。 事情是,

当我在命令行上运行一些测试代码时,连接正常。

但是在项目运行时会抛出此错误。

/的JSONResponseError

JSONResponseError: 400 Bad Request
{u'message': u'The security token included in the request is invalid.', u'__type': u'com.amazon.coral.service#UnrecognizedClientException'}
Request Method: POST
Request URL:    http://ec2-54-200-144-115.us-west-2.compute.amazonaws.com/?attempt=1&code=AQBfOzPR4Hlgrpkjz-qXQj8b7OLq6cm1NM_oZf64Wz3EmlX2-VDS6qfZ5V5f0Tmbx4MrLc4SGuJxUHa8drQClz3A1IWMVqUGKLEEW_0ol1RqClI8cZViWreBm5c3HJ-Vp48Xx81a7gvXSjRNJUn-kazXqahDrgsAeLez_8FrXIb_HWHyekhnUmxgkskRGBNzcTtpqASNe3agzG3ZZowCMYi6bDBAdVuODli3ApWQWENSmjLaN5QbZWbGo3ATvJNMAUQjj6VTHCkVS-UWcuh-PtwAAFtUqb8HkLsbFG31KevwPKz6x10ojD45pe03zA1SF_g
Django Version: 1.5
Exception Type: JSONResponseError
Exception Value:    
JSONResponseError: 400 Bad Request
{u'message': u'The security token included in the request is invalid.', u'__type': u'com.amazon.coral.service#UnrecognizedClientException'}
Exception Location: /srv/www/test/local/lib/python2.7/site-packages/boto/dynamodb2/layer1.py in _retry_handler, line 1530
Python Executable:  /srv/www/test/bin/python
Python Version: 2.7.3

无法理解发生了什么。 谁能帮我?

您收到此消息,因为您的AWS账户的安全凭证/访问密钥已更改。

再次使用新的访问键,它将工作。

祝一切顺利。

你使用的是更新版本的python 2.7吗? 由于ssl修复,我遇到了类似的错误。 我这样做是有效的

import ssl
# for fix to python on mac which is newer than the one on linux
ssl._create_default_https_context = ssl._create_unverified_context

因为这里没有一个解决方案适合我。

在一个平均堆栈上,我不得不像sudo一样运行

sudo forever start startme.js

要么

sudo node startme.js

当我没有使用'sudo'时,我收到错误:

UnrecognizedClientException: The security token included in the request is invalid.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM