awsdocs / amazon-transcribe-developer-guide

The open source version of the Amazon Transcribe docs. You can submit feedback & requests for changes by submitting issues in this repo or by making proposed changes & submitting a pull request.
Other
25 stars 26 forks source link

BadRequestException #1

Closed sajattack closed 6 years ago

sajattack commented 6 years ago

I'm getting a BadRequestException using code I've adapted from the sample. I've verified that the file exists and the bucket permissions grant access to the Amazon Transcribe service. It is not a public file however. I am able to start a manual transcription job with the same URL but not with the SDK.

import boto3

with open('urls.txt', 'r') as infile:
    for line in infile:
        url = infile.readline()
        filename = url.split('/')[-1]
        transcribe = boto3.client('transcribe', region_name='us-east-1')
        job_name = filename.split('.')[0]
        job_uri = "https://s3.amazonaws.com/geeknights-test/" + filename
        print(job_uri)
        transcribe.start_transcription_job(
            TranscriptionJobName=job_name,
            Media={'MediaFileUri': job_uri},
            MediaFormat='mp3',
            LanguageCode='en-US'
            )
        status = transcribe.get_transcription_job(TranscriptionJobName=job_name)
        print(status)
https://s3.amazonaws.com/geeknights-test/20180205.mp3

Traceback (most recent call last):
  File "transcribe.py", line 16, in <module>
    LanguageCode='en-US'
  File "/usr/lib/python3.6/site-packages/botocore/client.py", line 324, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/lib/python3.6/site-packages/botocore/client.py", line 622, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the StartTranscriptionJob operation: The URI that you provided doesn't point to an S3 object. Make sure that the object exists and try your request again.
cbigham commented 6 years ago

Hi,

Thanks for contacting us about the problem that you're having. Unfortunately, this site is only for reporting problems with the documentation. For the kind of problem that you are having, you should post your question on the Amazon Lex forum (https://forums.aws.amazon.com/forum.jspa?forumID=251). Our developers actively monitor posts there so you're more likely to get the help that you need.

Thanks again, Chuck Bigham AWS Developer Documentation

cbigham commented 6 years ago

I am terribly sorry. I gave you the wrong link to the forum for Transcribe. Try this one instead: https://forums.aws.amazon.com/forum.jspa?forumID=278

sajattack commented 6 years ago

It says I don't have access