0

I'm using boto3 to create hit on mturk and I'm using my customized Hit type.

The problem is that sometimes the hit could be create successfully but most of the time it failed with the following error: botocore.exceptions.ClientError: An error occurred (505) when calling the CreateHITWithHITType operation: HTTP Version Not Supported.

The endpoint url I'm using is https://mturk-requester.us-east-1.amazonaws.com

Here's the code:

client = boto3.client(
    service_name = 'mturk',
    region_name = 'us-east-1',
    endpoint_url = 'https://mturk-requester.us-east-1.amazonaws.com',
    aws_access_key_id = self.aws_access_key_id,
    aws_secret_access_key = self.aws_secret_access_key,
)
client.create_hit_with_hit_type(
    HITTypeId = '3EAACKBRW4VD5JIOW1PV2FZNGTKNPO',
    Question = xmlstr,
    MaxAssignments  = 3,
    LifetimeInSeconds = 60*60*24*7,
    UniqueRequestToken = 'history-hit-1',
)
jia chen
  • 1
  • 1
  • Can you include the exact code you're using (less your Access Key and Secret Key)? That URL seems right. It must be something else. – jrb Mar 26 '17 at 20:39
  • I've updated the code in the question – jia chen Mar 26 '17 at 22:16
  • That code works fine for me. Do you get the same error when you call this method: client.get_account_balance()['AvailableBalance']? – jrb Mar 26 '17 at 22:20
  • No, it works fine and the balance is a positive number. – jia chen Mar 26 '17 at 22:33
  • Any chance you can past the entire code (end-to-end) excluding your Access Key and Secret Key? Wondering if it's something else that's just resulting in a bad error (your XML or otherwise). Seems unlikely, but I'm at a loss for what could be causing it. – jrb Mar 27 '17 at 04:24
  • It looks like this was an issue with the MTurk SDK implementation in Boto. Based on this ticket, it's also been resolved: https://github.com/boto/boto3/issues/1041 – jrb Apr 06 '17 at 17:44

0 Answers0