Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save Translation edits throws an error in WebToVTTCaptions v2.0.0 #354

Open
6 tasks done
flick1533 opened this issue Nov 17, 2022 · 2 comments
Open
6 tasks done

Save Translation edits throws an error in WebToVTTCaptions v2.0.0 #354

flick1533 opened this issue Nov 17, 2022 · 2 comments
Labels

Comments

@flick1533
Copy link

flick1533 commented Nov 17, 2022

Describe the bug

When I click on the Save edits button after editing the Translation, the workflow starts to rerun but ends with an Error status.

To Reproduce

1. Upload a video and run a workflow. The workflow I ran has the following configuration.
    Audio Operators - Transcribe - Source Language - English US
    Text Operators - Translate - Spanish
    Video is uploaded and analyzed well.
2. Edit the Tanslation for the workflow
3. Click Save edits
4. The workflow ends in an Error state. The Step Functions console shows the error is in WebToVTTCaptions.

Expected behavior

The workflow reruns with the edited translation.

Please complete the following information about the solution:

  • Version: 2.0.0

  • Region: [e.g. us-east-1]

  • Was the solution modified from the version published on this repository?

No

  • If the answer to the previous question was yes, are the changes available on GitHub?

  • Have you checked your service quotas for the services this solution uses?

Yes

  • Were there any errors in the CloudWatch Logs?

This is ValueError in step: Complete Stage TransformText

{
  "errorMessage": "Exception: 'Stage TransformText encountered and error during execution, aborting the workflow'",
  "errorType": "ValueError",
  "requestId": "9cf69725-b853-4ff8-9159-f9cd13f9dacd",
  "stackTrace": [
    "  File \"/var/task/app.py\", line 327, in complete_stage_execution_lambda\n    return complete_stage_execution(\"lambda\", event[\"Name\"], event[\"Status\"], event[\"Outputs\"], event[\"WorkflowExecutionId\"])\n",
    "  File \"/var/task/app.py\", line 467, in complete_stage_execution\n    raise ValueError(\n"
  ]
}

This is the error from the Execute WebToVTTCaptions (TransformText) - Caught twice in Execute WebToVTCaptions (TransformText)

{
  "Name": "WebToVTTCaptions",
  "AssetId": "1224dc3f-5e34-42cf-be48-1c4b0081bfed",
  "WorkflowExecutionId": "e416570c-bd06-4a56-8ba4-757732ab5ecb",
  "Input": {
    "Media": {
      "Video": {
        "S3Bucket": "clo-miestack-XXXXXXXXXXXX-dataplane-XXXXXXXXXXXX",
        "S3Key": "public/upload/Welcome to AWS, London.mp4"
      }
    },
    "MetaData": {}
  },
  "Configuration": {
    "MediaType": "MetadataOnly",
    "Enabled": true,
    "TargetLanguageCodes": [
      "es",
      "en"
    ]
  },
  "Status": "Started",
  "MetaData": {},
  "Media": {},
  "Outputs": {
    "Error": "MasExecutionError",
    "Cause": "{\"errorMessage\": \"{'Name': 'WebToVTTCaptions', 'AssetId': '1224dc3f-5e34-42cf-be48-1c4b0081bfed', 'WorkflowExecutionId': 'e416570c-bd06-4a56-8ba4-757732ab5ecb', 'Input': {'Media': {'Video': {'S3Bucket': 'clo-miestack-XXXXXXXXXXXXX-dataplane-XXXXXXXXXXXXX', 'S3Key': 'public/upload/Welcome to AWS, London.mp4'}}, 'MetaData': {}}, 'Configuration': {'MediaType': 'MetadataOnly', 'Enabled': True, 'TargetLanguageCodes': ['es', 'en']}, 'Status': 'Error', 'MetaData': {'WebCaptionsError': \\\"No valid inputs 'SourceLanguageCode'\\\"}, 'Media': {}}\", \"errorType\": \"MasExecutionError\", \"requestId\": \"37b7b2f0-e57a-4bc8-bdfd-c85857db4624\", \"stackTrace\": [\"  File \\\"/var/task/webcaptions.py\\\", line 589, in create_vtt\\n    webcaptions_object = WebCaptions(operator_object)\\n\", \"  File \\\"/var/task/webcaptions.py\\\", line 77, in __init__\\n    raise MasExecutionError(operator_object.return_output_object())\\n\"]}"
  }
}

It seems the application fails to identify the SourceLangnugeCode because after editing the translated subtitles and saving, the SourceLanguageCodes (en) and TargetLanguageCodes (es) are both passed as the TargetLanguageCodes, seen below.

WebToVTCaptions (TransformText) error

'Configuration': {'MediaType': 'MetadataOnly', 'Enabled': True, 'TargetLanguageCodes': ['es', 'en']}, 'Status': 'Error', 'MetaData': {'WebCaptionsError': \\\"No valid inputs 'SourceLanguageCode'\\\"},

Screenshots

image

Additional context

Add any other context about the problem here.

@flick1533 flick1533 added the bug label Nov 17, 2022
@mortizbey
Copy link

mortizbey commented May 10, 2024

Hi team! I had this same error editing both the Subtitles or the Translation. We identified that the error occurs on lambdas: WebToVTTCaptionsFunction and WebToSRTCaptionsFunction specially here since it does not receive any of these values (specially source_language_code) which prevents it to continue working:

if "TranscribeSourceLanguage" in self.operator_object.input['MetaData']:
                self.source_language_code = self.operator_object.input['MetaData']['TranscribeSourceLanguage'].split('-')[0]
            elif "TranslateSourceLanguage" in self.operator_object.input['MetaData']:
                self.source_language_code = self.operator_object.input['MetaData']['TranslateSourceLanguage'].split('-')[0]
            else:
                # If TranscribeSourceLanguage is not available, then SourceLanguageCode
                # must be present in the operator Configuration block.
                self.source_language_code = self.operator_object.configuration.get("SourceLanguageCode","en")

            if "TargetLanguageCodes" in self.operator_object.configuration:
                self.target_language_codes = self.operator_object.configuration["TargetLanguageCodes"]
            if "ExistingSubtitlesObject" in self.operator_object.configuration:
                self.existing_subtitles_object = self.operator_object.configuration["ExistingSubtitlesObject"]
                self.existing_subtitles = True

It seems that these values are not being correctly propagated on Subtitle or Translation editing.

@amzn-gaod
Copy link
Member

Thank you for reporting this issue. We will consider your feedback and have added this request to our backlog for this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants