2017-02-27 5 views
1

WindowsコマンドラインからAWS-CLIコマンドを発行すると、"aws s3 ls"が正常に完了します。 EclipseでRを使用してshell(paste0("aws ", "s3 ", "ls"))を試すと、正常に完了します。RStudioを使用してAWS-CLI資格情報が見つかりませんでしたが、Windows CLIからうまく機能します

ただし、Windowsのコマンドラインから、同じ資格情報を使用して別のマシン上で、"aws s3 ls"は正常に完了しますが、RStudio shell(paste0("aws ", "s3 ", "ls"))で私が取得:

"fatal error: Unable to locate credentials"

私はRStudioからshell(paste0("aws ", "s3 ", "ls ", "--debug"))を実行する場合、私は得る:

2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env 2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role 2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file 2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: config-file 2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: ec2-credentials-file 2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: boto-config 2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: container-role 2017-02-27 15:07:10,516 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: iam-role 2017-02-27 15:07:10,520 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTP connection (1): xxx.xxx.xxx.xxx 2017-02-27 15:07:10,523 - MainThread - botocore.utils - DEBUG - Caught exception while trying to retrieve credentials: ('Connection aborted.', error(10051, 'A socket operation was attempted to an unreachable network')) Traceback (most recent call last): File "botocore\utils.pyc", line 159, in _get_request File "botocore\vendored\requests\api.pyc", line 69, in get File "botocore\vendored\requests\api.pyc", line 50, in request File "botocore\vendored\requests\sessions.pyc", line 465, in request File "botocore\vendored\requests\sessions.pyc", line 573, in send File "botocore\vendored\requests\adapters.pyc", line 415, in send

Windowsのコマンドラインで成功したケースについては、次のように資格情報が見つかります。

2017-02-27 15:07:03,267 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env 2017-02-27 15:07:03,267 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role 2017-02-27 15:07:03,267 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file 2017-02-27 15:07:03,267 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials

私は、AWS CLIがRStudioを使用して資格情報を見つけることができない理由を理解しようとしていますが、Windows CLIから問題なく動作します。

更新:両方のマシンにEclipseをインストールしても問題ありません。しかし、RStudioではまだ動作していないので、IDE関連の問題でなければなりません。何か案は?

+1

あなたは[** aws.s3 **](https://cran.r-project.orgを使用して代わりに試してみてください/package=aws.s3)パッケージで、S3へのネイティブRインターフェイスを提供します。 – Thomas

+0

ありがとうございます。残念ながら、私はもはやこのプロジェクトに取り組んでおらず、試してみることはできません。しかし、良いオプションのように思える。 – Jeff

答えて

1

私はRStudioでAWSの資格情報を定義することによって、それを解決することができました:

Sys.setenv ("AWS_ACCESS_KEY_ID" = "YourKEY_ID", 
      "AWS_SECRET_ACCESS_KEY" = "YOURSECRETACCESSKEY", 
      "AWS_DEFAULT_REGION" = "eu-west-1") 
関連する問題