Share via

I am experiencing an issue with the Document Translation API (api-version: 2025-12-01-preview) when translating PNG image files.

邱凌东 0 Reputation points
2026-03-10T10:27:58.79+00:00

API Endpoint:

POST /translator/document/batches

Issue Description:

PNG image translation fails consistently with the following error

{
    "id": "0ef5ccf0-2746-45e8-b712-24b165eeb675",
    "createdDateTimeUtc": "2026-03-10T10:20:56.3105795Z",
    "lastActionDateTimeUtc": "2026-03-10T10:21:07.7822589Z",
    "status": "Failed",
    "error": {
        "code": "InternalServerError",
        "message": "Document failed during parsing. 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.",
        "target": "Operation",
        "innerError": {
            "code": "InternalServerErrorDocumentParsing",
            "message": "Document failed during parsing. 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."
        }
    },
    "summary": {
        "total": 1,
        "failed": 1,
        "success": 0,
        "inProgress": 0,
        "notYetStarted": 0,
        "cancelled": 0,
        "totalCharacterCharged": 0,
        "totalImageCharged": 0
    }
}
Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


2 answers

Sort by: Most helpful
  1. Manas Mohanty 16,670 Reputation points Microsoft External Staff Moderator
    2026-04-30T10:07:22.9666667+00:00

    Hi 邱凌东

    I just tested below batch translation code in West US 2 region and getting 202 response code instead.

    Could you test in West US 2 with below code and let us know your observation.

    import requests
    import json
    
    # ========= CONFIG =========
    TRANSLATOR_KEY = "<apikey>"
    TRANSLATOR_ENDPOINT = "https://<translation>.cognitiveservices.azure.com"
    
    API_VERSION = "2025-12-01-preview"
    
    # ✅ SINGLE FILE (not container)
    
    SOURCE_FILE_URL = <SAS URL of file with READ, write, create permission>
    TARGET_CONTAINER_URL = <SAS Url of target container Read, write, create>
    
    SOURCE_LANGUAGE = "zh-Hans"
    TARGET_LANGUAGE = "ko"
    
    # ========= REQUEST =========
    url = f"{TRANSLATOR_ENDPOINT}/translator/document/batches?api-version={API_VERSION}"
    
    headers = {
        "Ocp-Apim-Subscription-Key": TRANSLATOR_KEY,
        "Content-Type": "application/json"
    }
    
    payload = {
        "inputs": [
            {
                "storageType": "File",   # ✅ REQUIRED for single file
                "source": {
                    "sourceUrl": SOURCE_FILE_URL,
                    "language": SOURCE_LANGUAGE,
                    
                },
                "targets": [
                    {
                        "targetUrl": TARGET_CONTAINER_URL,
                        "language": TARGET_LANGUAGE,
                       
                    }
                ]
            }
        ]
    }
    
    response = requests.post(url, headers=headers, data=json.dumps(payload))
    
    # ========= RESPONSE =========
    print("Status Code:", response.status_code)
    
    if response.status_code == 202:
        print("Batch submitted successfully.")
        print("Operation-Location:", response.headers.get("Operation-Location"))
    else:
        print("Error:")
        print(response.text)
    
    

    Thank you.

    0 comments No comments

  2. Q&A Assist
    2026-03-10T10:28:09.1866667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    PNG image translation with the Document Translation API using api-version=2025-12-01-preview is supported as part of the image translation preview feature.

    The error payload shows:

    • code: InternalServerError
    • innerError.code: InternalServerErrorDocumentParsing
    • message: "Document failed during parsing. 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."

    This indicates a service-side parsing failure rather than a validation or configuration problem. For image translation with this preview API version, no additional configuration is required beyond submitting a supported image file type (such as .png) in a standard batch request.

    Given that:

    • .png is explicitly listed as a supported image format for this preview.
    • The error is an internal parsing error with zero characters/images charged.

    The next step is to follow the guidance in the error message and report the issue to Microsoft with:

    1. Date and time of the failure.
    2. The X-RequestId value from the HTTP response headers.
    3. The X-ClientTraceId value from the request headers (if set).
    4. The failing PNG sample (or a minimal repro file) and the exact api-version and endpoint used.

    This will allow the product team to investigate the parsing failure in the preview image translation pipeline.


    References:

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.