没有凭据错误

时间:2016-04-24 12:59:32

标签: amazon-web-services amazon-s3 boto3 botocore

我正在尝试设置动态缩略图服务thumbor并支持s3作为存储,我需要设置此社区支持pip library for aws

它在我的本地环境中运行良好但是当我尝试在我们的一台服务器上托管它时,我得到NoCredentialsError。我假设这是因为botocore的不同版本(最新的一个和一个由pip库安装)。这是错误日志:

  File "/usr/local/lib/python2.7/dist-packages/botocore/session.py", line 774, in get_component
    # client config from the session
  File "/usr/local/lib/python2.7/dist-packages/botocore/session.py", line 174, in <lambda>
    self._components.lazy_register_component(
  File "/usr/local/lib/python2.7/dist-packages/botocore/session.py", line 453, in get_data
    - agent_version is the value of the `user_agent_version`
  File "/usr/local/lib/python2.7/dist-packages/botocore/loaders.py", line 119, in _wrapper
    data = func(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/botocore/loaders.py", line 364, in load_data
DataNotFoundError: Unable to load data for: _endpoints







2016-04-24 12:14:34 tornado.application:ERROR Future exception was never retrieved: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 230, in wrapper
    yielded = next(result)
  File "/usr/local/lib/python2.7/dist-packages/thumbor/handlers/imaging.py", line 31, in check_image
    exists = yield gen.maybe_future(self.context.modules.storage.exists(kw['image'][:self.context.config.MAX_ID_LENGTH]))
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 455, in wrapper
    future.result()
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 443, in wrapper
    result = f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tc_aws/aws/storage.py", line 107, in exists
    self.storage.get(file_abspath, callback=return_data)
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 455, in wrapper
    future.result()
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 443, in wrapper
    result = f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tc_aws/aws/bucket.py", line 44, in get
    Key=self._clean_key(path),
  File "/usr/local/lib/python2.7/dist-packages/tornado_botocore/base.py", line 97, in call
    return self._make_api_call(operation_name=self.operation, api_params=kwargs, callback=callback)
  File "/usr/local/lib/python2.7/dist-packages/tornado_botocore/base.py", line 60, in _make_api_call
    operation_model=operation_model, request_dict=request_dict, callback=callback)
  File "/usr/local/lib/python2.7/dist-packages/tornado_botocore/base.py", line 54, in _make_request
    request_dict=request_dict, operation_model=operation_model, callback=callback)
  File "/usr/local/lib/python2.7/dist-packages/tornado_botocore/base.py", line 32, in _send_request
    request = self.endpoint.create_request(request_dict, operation_model)
  File "/usr/local/lib/python2.7/dist-packages/botocore/endpoint.py", line 126, in create_request
    operation_name=operation_model.name)
  File "/usr/local/lib/python2.7/dist-packages/botocore/hooks.py", line 226, in emit
    return self._emit(event_name, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/botocore/hooks.py", line 209, in _emit
    response = handler(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/botocore/signers.py", line 90, in handler
    return self.sign(operation_name, request)
  File "/usr/local/lib/python2.7/dist-packages/botocore/signers.py", line 124, in sign
    signer.add_auth(request=request)
  File "/usr/local/lib/python2.7/dist-packages/botocore/auth.py", line 626, in add_auth
    raise NoCredentialsError
NoCredentialsError: Unable to locate credentials

是否可以通过正确的安装库来修复?因为pip库删除了现有较新版本的botocore并安装了旧版本。

编辑:

我正在使用supervisor运行进程,似乎进程无法访问aws凭据

编辑2:

通过正确配置主管解决了这个问题。由主管启动的进程用户无权访问配置文件

1 个答案:

答案 0 :(得分:0)

通过正确配置主管解决了这个问题。由supervisor启动的子进程的用户无权访问aws配置文件。因此,它与当地环境或单独创建流程合作,但不与主管合作。