我在MAC(iOS 10.9)上设置CLI,我相信我已正确设置了MTURK_CMD_HOME和JAVA_CMD_HOME路径。
但是,当我运行getBalance.sh
时,我仍然收到一个错误,指出无法找到该文件。我的代码如下:
/users/USER/Desktop/aws-mturk-clt-1.3.1/
-bash: /users/USER/Desktop/aws-mturk-clt-1.3.1/: is a directory
/System/Library/Frameworks/JavaVM.framework/Home
-bash: /System/Library/Frameworks/JavaVM.framework/Home: is a directory
export MTURK_CMD_HOME=/users/USER/Desktop/aws-mturk-clt-1.3.1/
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export PATH=$PATH:/users/USER/Desktop/aws-mturk-clt-1.3.1/bin
/users/USER/Desktop/aws-mturk-clt-1.3.1/bin/getBalance.sh
返回以下错误:
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: ../log/aws-mturk-clt.log (No such file or directory)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:192)
at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
at org.apache.log4j.Logger.getLogger(Logger.java:118)
at com.amazonaws.mturk.cmd.AbstractCmd.<clinit>(AbstractCmd.java:51)
There was a problem reading your properties file from mturk.properties
The exception was java.io.FileNotFoundException: mturk.properties (No such file or directory)
Exception in thread "main" java.lang.RuntimeException: Cannot load configuration properties file from mturk.properties
at com.amazonaws.mturk.util.PropertiesClientConfig.<init>(PropertiesClientConfig.java:99)
at com.amazonaws.mturk.util.PropertiesClientConfig.<init>(PropertiesClientConfig.java:72)
at com.amazonaws.mturk.cmd.AbstractCmd.<init>(AbstractCmd.java:61)
at com.amazonaws.mturk.cmd.GetBalance.<init>(GetBalance.java:24)
at com.amazonaws.mturk.cmd.GetBalance.main(GetBalance.java:27)
Caused by: java.io.FileNotFoundException: mturk.properties (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at com.amazonaws.mturk.util.PropertiesClientConfig.<init> (PropertiesClientConfig.java:95)
... 4 more
似乎正确指定了目录(并且bin包含getBalance.sh)。我已经仔细检查过我的访问密钥是否正确,文件路径是否正确。我该怎么办?
答案 0 :(得分:1)
这对我有用(无需更改任何脚本)。我确实在mturk.properties文件中设置了默认访问密钥和密码,并将URL更改为沙箱https地址。
$ cd /Users/me/Downloads/aws-mturk-clt-1.3.1/bin
$ ./getBalance.sh
An error occurred while fetching your balance: Error #1 for RequestId: 75edd876-61eb-4525-8c5a-5c984e1e31f3 - AWS.NotAuthorized: The identity contained in the request is not authorized to use this AWSAccessKeyId (1424124881922 s)
com.amazonaws.mturk.service.exception.AccessKeyException: Error #1 for RequestId: 75edd876-61eb-4525-8c5a-5c984e1e31f3 - AWS.NotAuthorized: The identity contained in the request is not authorized to use this AWSAccessKeyId (1424124881922 s)
at com.amazonaws.mturk.filter.ErrorProcessingFilter.processErrors(ErrorProcessingFilter.java:91)
at com.amazonaws.mturk.filter.ErrorProcessingFilter.execute(ErrorProcessingFilter.java:48)
at com.amazonaws.mturk.filter.Filter.passMessage(Filter.java:56)
at com.amazonaws.mturk.filter.RetryFilter.execute(RetryFilter.java:115)
at com.amazonaws.mturk.filter.Filter.passMessage(Filter.java:56)
at com.amazonaws.mturk.util.CLTExceptionFilter.sendMessage(CLTExceptionFilter.java:77)
at com.amazonaws.mturk.util.CLTExceptionFilter.execute(CLTExceptionFilter.java:62)
at com.amazonaws.mturk.service.axis.FilteredAWSService.executeRequests(FilteredAWSService.java:172)
at com.amazonaws.mturk.service.axis.FilteredAWSService.executeRequest(FilteredAWSService.java:152)
at com.amazonaws.mturk.service.axis.FilteredAWSService.executeRequest(FilteredAWSService.java:116)
at com.amazonaws.mturk.service.axis.RequesterServiceRaw.getAccountBalance(RequesterServiceRaw.java:1193)
at com.amazonaws.mturk.service.axis.RequesterService.getAccountBalance(RequesterService.java:922)
at com.amazonaws.mturk.cmd.GetBalance.getBalance(GetBalance.java:50)
at com.amazonaws.mturk.cmd.GetBalance.runCommand(GetBalance.java:41)
at com.amazonaws.mturk.cmd.AbstractCmd.run(AbstractCmd.java:148)
at com.amazonaws.mturk.cmd.GetBalance.main(GetBalance.java:28)
您是否尝试过从bin
目录运行它?实际上是cd进入目录而不是使用完全限定的路径