Debian 7 上 Elastic Beanstalk 命令行界面的问题

Issues with Elastic Beanstalk Command Line Interface on Debian 7

我正在尝试将基本 rails 应用程序部署到 Elastic Beanstalk,但每当我尝试使用 eb 命令时,我 运行 都会遇到问题。我需要 运行 eb init,但我每次都会收到此错误。

xxxx@debian:~/xxxx/xxxx/xxxx/xxxx$ eb init

Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-southeast-1 : Asia Pacific (Singapore)
7) ap-southeast-2 : Asia Pacific (Sydney)
8) ap-northeast-1 : Asia Pacific (Tokyo)
9) sa-east-1 : South America (Sao Paulo)
(default is 3): 
ERROR: The current user does not have the correct permissions.
You have not yet set up your credentials or your credentials are incorrect 
You must provide your credentials.
(aws-access-id): xxxxxxxxxxxxxxxxxxx
(aws-secret-key): xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ERROR: Operation Denied. Are your permissions correct?
xxxx@debian:~/xxxx/xxxx/xxxx/xxxx$ 

我知道我的 ID 和密钥是正确的,因为我直接从 aws 根安全页面复制并粘贴了它们,并且我使用了我刚刚创建的 ID 和密钥。我也可以在 windows 上使用相同的 ID 和密钥,我没有遇到任何问题。

由于 eb init 不成功,none 个其他命令将起作用。

第一次成功了,我可以 运行 其他命令,但是离开一段时间后回来重试,我开始遇到这些错误。

任何帮助都会很棒,如果您需要更多信息,请告诉我。

编辑:这里是 eb init -debug

的输出
xxx@debian:~/Dropbox/Debian_Workspace/GameHub/GameHub$ eb init --debug
2015-01-22 23:15:25,909 (DEBUG) eb : logging initialized for 'eb' using LoggingLogHandler
2015-01-22 23:15:25,909 (DEBUG) cement.ext.ext_plugin : plugin config dir /etc/eb/plugins.d does not exist.
2015-01-22 23:15:25,910 (DEBUG) cement.ext.ext_plugin : plugin config dir /home/xxx/.eb/plugins.d does not exist.
2015-01-22 23:15:25,911 (DEBUG) eb : collecting arguments/commands for <ebcli.core.base.EbBaseController object at 0xa3b82cc>
2015-01-22 23:15:25,913 (DEBUG) eb : collecting arguments/commands for <ebcli.controllers.initialize.InitController object at 0xa3b7bec>
-- EBCLI Version: 3.0.10
-- Python Version: 2.7.3 (default, Mar 14 2014, 11:57:14) 
[GCC 4.7.2]
2015-01-22 23:15:25,916 (DEBUG) ebcli.core.fileoperations : Project root found at: /home/xxx/Dropbox/Debian_Workspace/GameHub/GameHub
2015-01-22 23:15:25,918 (DEBUG) ebcli.core.fileoperations : Project root found at: /home/xxx/Dropbox/Debian_Workspace/GameHub/GameHub
2015-01-22 23:15:25,919 (DEBUG) ebcli.lib.elasticbeanstalk : Inside get_available_solution_stacks api wrapper
2015-01-22 23:15:25,919 (DEBUG) ebcli.lib.aws : Creating new Botocore Session
2015-01-22 23:15:25,937 (DEBUG) ebcli.lib.aws : Successfully created session for elasticbeanstalk
2015-01-22 23:15:25,941 (DEBUG) ebcli.core.fileoperations : Project root found at: /home/xxx/Dropbox/Debian_Workspace/GameHub/GameHub

Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-southeast-1 : Asia Pacific (Singapore)
7) ap-southeast-2 : Asia Pacific (Sydney)
8) ap-northeast-1 : Asia Pacific (Tokyo)
9) sa-east-1 : South America (Sao Paulo)
(default is 3): 
2015-01-22 23:15:38,798 (DEBUG) ebcli.lib.elasticbeanstalk : Inside get_available_solution_stacks api wrapper
2015-01-22 23:15:38,799 (DEBUG) ebcli.lib.aws : Making api call: (elasticbeanstalk, list-available-solution-stacks) to region: us-west-2 with args:{}
2015-01-22 23:15:39,242 (DEBUG) ebcli.lib.aws : API call finished, status = 403
2015-01-22 23:15:39,243 (DEBUG) ebcli.lib.aws : Response: {'ResponseMetadata': {'RequestId': '21c98454-a33b-11e4-a8b3-23511a136606'}, 'Error': {'Message': 'Signature expired: 20150123T051538Z is now earlier than 20150123T200009Z (20150123T200509Z - 5 min.)', 'Code': 'SignatureDoesNotMatch', 'Type': 'Sender'}}
2015-01-22 23:15:39,243 (DEBUG) ebcli.lib.aws : Received a 403
2015-01-22 23:15:39,244 (ERROR) eb : The current user does not have the correct permissions.
2015-01-22 23:15:39,245 (INFO) eb : Setting up ~/aws/ directory with config file
You have not yet set up your credentials or your credentials are incorrect 
You must provide your credentials.
(aws-access-id): XXXXXXXXXX
(aws-secret-key): XXXXXXXXXXXXXXXX
2015-01-22 23:17:15,862 (DEBUG) ebcli.core.fileoperations : Project root found at: /home/xxx/Dropbox/Debian_Workspace/GameHub/GameHub
2015-01-22 23:17:15,868 (DEBUG) ebcli.core.fileoperations : Project root found at: /home/xxx/Dropbox/Debian_Workspace/GameHub/GameHub
2015-01-22 23:17:15,869 (DEBUG) ebcli.core.fileoperations : Project root found at: /home/xxx/Dropbox/Debian_Workspace/GameHub/GameHub
2015-01-22 23:17:15,871 (DEBUG) ebcli.core.fileoperations : Directory found, but no config or app name exists
2015-01-22 23:17:15,876 (DEBUG) ebcli.lib.elasticbeanstalk : Inside get_all_applications api wrapper
2015-01-22 23:17:15,877 (DEBUG) ebcli.lib.aws : Making api call: (elasticbeanstalk, describe-applications) to region: us-west-2 with args:{}
2015-01-22 23:17:16,301 (DEBUG) ebcli.lib.aws : API call finished, status = 403
2015-01-22 23:17:16,301 (DEBUG) ebcli.lib.aws : Response: {'ResponseMetadata': {'RequestId': '5ba42797-a33b-11e4-832c-0ba59e4b9564'}, 'Error': {'Message': 'Signature expired: 20150123T051715Z is now earlier than 20150123T200146Z (20150123T200646Z - 5 min.)', 'Code': 'SignatureDoesNotMatch', 'Type': 'Sender'}}
2015-01-22 23:17:16,301 (DEBUG) ebcli.lib.aws : Received a 403
Traceback (most recent call last):
  File "/usr/local/bin/eb", line 9, in <module>
    load_entry_point('awsebcli==3.0.10', 'console_scripts', 'eb')()
  File "/usr/local/lib/python2.7/dist-packages/ebcli/core/ebcore.py", line 99, in main
    app.run()
  File "/usr/local/lib/python2.7/dist-packages/cement/core/foundation.py", line 694, in run
    self.controller._dispatch()
  File "/usr/local/lib/python2.7/dist-packages/cement/core/controller.py", line 455, in _dispatch
    return func()
  File "/usr/local/lib/python2.7/dist-packages/cement/core/controller.py", line 461, in _dispatch
    return func()
  File "/usr/local/lib/python2.7/dist-packages/ebcli/core/abstractcontroller.py", line 64, in default
    self.do_command()
  File "/usr/local/lib/python2.7/dist-packages/ebcli/controllers/initialize.py", line 59, in do_command
    self.app_name = self.get_app_name()
  File "/usr/local/lib/python2.7/dist-packages/ebcli/controllers/initialize.py", line 151, in get_app_name
    app_name = _get_application_name_interactive(self.region)
  File "/usr/local/lib/python2.7/dist-packages/ebcli/controllers/initialize.py", line 271, in _get_application_name_interactive
    app_list = operations.get_application_names(region)
  File "/usr/local/lib/python2.7/dist-packages/ebcli/core/operations.py", line 466, in get_application_names
    app_list = elasticbeanstalk.get_all_applications(region=region)
  File "/usr/local/lib/python2.7/dist-packages/ebcli/lib/elasticbeanstalk.py", line 472, in get_all_applications
    region=region)
  File "/usr/local/lib/python2.7/dist-packages/ebcli/lib/elasticbeanstalk.py", line 49, in _make_api_call
    **operation_options)
  File "/usr/local/lib/python2.7/dist-packages/ebcli/lib/aws.py", line 151, in make_api_call
    raise NotAuthorizedError('Operation Denied. Are your '
ebcli.objects.exceptions.NotAuthorizedError: Operation Denied. Are your permissions correct?
xxx@debian:~/Dropbox/Debian_Workspace/GameHub/GameHub$ 

鉴于您显示的调试信息,关键信息是:

Signature expired: 20150123T051715Z is now earlier than 20150123T200146Z (20150123T200646Z - 5 min.)

您计算机上的时间似乎不正确。 AWS签名需要你签名时间,时间必须在5分钟内准确。

只是 运行 遇到了同样的问题,我 运行 从 PowerShell wsl --shutdown,它就像魔术一样工作。