How to fix InternalServerErrorApplyingTranslation when translating some Documents?

Arwa Shamardal 0 Reputation points
2025-09-29T09:02:26.6233333+00:00

Issue Description

I'm experiencing persistent failures with Azure Document Translation service for a specific file. I am using Python SDK.

Error:

  • Error Code: InternalServerErrorApplyingTranslation
  • Error Message:
  Document failed during applying translation. If the error persists, report it with 
  date/time of error, request identifier from response header X-RequestId, and client 
  identifier from request header X-ClientTraceId.

Additional Context:

  • The error suggests the translation completes successfully, but fails during the final step of applying/writing the translation
  • This specific file consistently fails while other files work (Only a single failure before)

Environment Setup

Azure Resources Info:

  • Region: UAE North for both storage and translator
  • Subscription Type: S1 for both storage and translator

File Characteristics:

  • Format: docx
  • File Size: 160 KB
  • Source Language: Arabic
  • Target Language: English

**
Troubleshooting Attempts**

Attempt 1: Azure SDK (Programmatic Approach)

  • Result: InternalServerErrorApplyingTranslation

Attempt 2: Language Studio (Web UI) (Using Azure Language Studio web interface for Document) Translation

Network console:

  Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split')
  at translationHandlerGroup.ts:180:52
  • Final Result: After resolving all configuration issues, the job appears to submit but ultimately fails with InternalServerErrorApplyingTranslation

Thanks in advance.

Azure AI Translator
Azure AI Translator
An Azure service to easily conduct machine translation with a simple REST API call.
{count} votes

1 answer

Sort by: Most helpful
  1. Aryan Parashar 1,850 Reputation points Microsoft External Staff Moderator
    2025-09-30T05:24:26.2333333+00:00

    Hi Arwa,

    I tested many Arabic DOCX files to English, and I didn't encounter any issues.

    The code below will give you the exact error that is causing the translation to fail:

    from azure.core.credentials import AzureKeyCredential
    from azure.ai.translation.document import DocumentTranslationClient, DocumentTranslationInput, TranslationTarget
    
    # Azure Translator credentials (replace with your own)
    endpoint = "https://<your-translator-resource>.cognitiveservices.azure.com/"
    key = "<your-azure-key>"
    client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))
    
    # Source and target container SAS URLs (replace with your own)
    source_container_sas_url = "https://<your-source-container>.blob.core.windows.net/<container>?<sas-token>"
    target_container_sas_url = "https://<your-target-container>.blob.core.windows.net/<container>?<sas-token>"
    
    # Define source and target languages
    source_language = "ar"
    target_language = "en"
    
    # Prepare translation input
    input_docs = [
        DocumentTranslationInput(
            source_url=source_container_sas_url,
            targets=[TranslationTarget(
                target_url=target_container_sas_url,
                language=target_language
            )],
            source_language=source_language
        )
    ]
    
    # Start the translation operation
    poller = client.begin_translation(input_docs)
    result = poller.result()
    
    # Check translation status
    for doc in result:
        print(f"Document ID: {doc.id}")
        print(f"Status: {doc.status}")
        if doc.status == "Succeeded":
            print(f"Translated URL: {doc.translated_document_url}")
        else:
            print(f"Error: {doc.error}")
    

    If possible, please provide the file via private message so I can assist more accurately.

    If this helps, feel free to accept it as an answer.
    Thankyou for reaching out to the Microsoft QNA Portal.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.