![](/img/trans.png)
[英]When I enter aws-acess-id and aws-secret-key /: “ERROR: NotAuthorizedError - Operation Denied. The security token included in the request is invalid:”
[英]Error: “The security token included in the request is invalid” when using Boto python
當我在nginx上運行我的django項目時,我收到此錯誤。 我使用dynamodb作為數據庫,S3使用S3來提供項目中的靜態文件。 在localhost上運行時,該項目運行正常。
該項目最初是在另一個ec2實例中托管的,它運行起來就像魅力一樣。 我從該實例的圖像中啟動了一個新的ec2實例。 而現在它正在拋出這個錯誤。 事情是,
當我在命令行上運行一些測試代碼時,連接正常。
但是在項目運行時會拋出此錯誤。
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.