Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-2574

Enhance okapi-driven error message with defect docx-files coming from Google

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • None
    • None
    • Okapi integration
    • High

    Description

      Please also see the linked TS issue for example data.

      The case does not only occur for docx, but also for xlsx data.

      Please see the file "Outdoor Sales Campaign KV - From Google Drive direct.docx" in attached TS-Issue.

      When imported in translate5, okapi throws an error:

      ZfExtended_BadGateway: HTTP Status was not 200/201/401 body: <!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> java.lang.IllegalArgumentException: Failure parsing MediaType string: application/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.wordprocessingml.document</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p><hr class="line" /><h3>Apache Tomcat/9.0.16 (Ubuntu)</h3></body></html>

       

      The essential part of this error is this:

      Failure parsing MediaType string: application/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.wordprocessingml.document

       

      The reason is, that the media-type is defect and not valid.

      Therefore the error message should be enhanced for this case to:

      DE: "Der Mediatyp der MS-Office-Datei ist invalide, die Importdatei daher formal korrupt.

      Versuchen Sie die Datei nochmals neu mit "Speichern unter" in MS-Office zu speichern.

      Wenn dies nichts hilft: Bitte speichern Sie entweder die Datei im LibreOffice-Format ab, öffnen Sie Sie erneut mit MS Word und speichern Sie sie wieder als MS Office-Datei ab.

      Oder alternativ: Legen Sie eine neue leere MS Office-Datei mit MS Office an und kopieren Sie die Inhalte aus der korrupten Datei in die neue und speichern die neue Datei."

      EN: "The media type of the MS-Office file is invalid, therefore the import file is formally corrupt.

      Try to save the file again with "Save as" in MS-Office.

      If this does not help: Please either save the file in LibreOffice format, open it again with MS Word and save it again as MS Office file.

      Or alternatively: Create a new empty MS Office file with MS Office and copy the contents from the corrupt file to the new one and save the new file."

      This should be the only error message in the log. The message "For the fileextension "docx" no parser is registered. For available parsers see log details." should not be shown, because it is irritating the user and wrong in this case.

      Attachments

        Issue Links

          Activity

            People

              tlauria Thomas Lauria
              marcmittag Marc Mittag [Administrator]
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: