为Mac的mTurk指定CLI路径 [英] Specify CLI path for mTurk for Mac

查看:57
本文介绍了为Mac的mTurk指定CLI路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在MAC(iOS 10.9)上设置CLI,我相信我已经正确设置了MTURK_CMD_HOME和JAVA_CMD_HOME路径.

I am setting up the CLI on a MAC (iOS 10.9) and I believe I've set up the MTURK_CMD_HOME and JAVA_CMD_HOME paths correctly.

但是,当我运行 getBalance.sh 时,仍然收到找不到该文件的错误.我的代码如下:

But, I'm still getting an error that the file can't be found when I run getBalance.sh. My code is as follows:

/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).我已经仔细检查了访问密钥是否正确以及文件路径是否正确.我该怎么办?

It seems the directory is specified correctly (and bin contains getBalance.sh). I've double checked that my access keys are correct and the file path is correct. What do I do?

推荐答案

这对我有用(无需更改任何脚本).我确实在mturk.properties文件中设置了默认访问密钥和密钥,并将URL更改为沙箱https地址.

This works for me (without needing to change any scripts). I did set the default access key and secret in the mturk.properties file and change the URL to the sandbox https address.

$ 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进入目录,而不是使用完全限定的路径

Have you tried running it from the bin dir? Actually cd into the directory rather than using the fully qualified path

这篇关于为Mac的mTurk指定CLI路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆