The given key was not present in the dictionary during Export, Save or Save target in WorldServer


When saving a DOCX file in WorldServer, the error

The given key was not present in the dictionary

appears either in Browser Workbench or as Autoerror during the Save or Save target task. It also appears as error when trying to export in WSXZ format.


Root Cause:

There are two possible root causes:

1- The issue is due to misplaced, missing or wrong tags in the target segment after Segment Asset or Pretranslate
2- The file cannot be saved also without TM due to a filter defect in these versions of WorldServer
Important: First verify if the error is due to root cause #1 or #2.

To do so, in Explorer
1- create subfolder under source target folder
2- copy source file to subfolder,
3- create subfolder with same name under target language folder
4- right click subfolder under target folder and select Properties
5- in the Properties window, change the TM to no TM or use dummy TM
6- open source file in Browser Worbench from subfolder under source language folder
7- once opened, click Save

If it saved without error, continue with workaround(s) to Issue #1 since this is probably related to misplaced tags. If it cannot be saved also without TM (or with an empty TM), continue with workaround for Issue #2

Issue #1 
There are 2 possible workarounds. Note: both workarounds below might require linguistic expertise in order to be able to place missing tags in the correct position in the target segment.

Workaround #1 (mostly applicable if the file is small. Which larger files, apply workaround #2)
  1. Open the file in Browser Workbench
  2. Search for translated or pretranslated segments where the target tags/placeholders do not match the source segment
  3. Fix each of them and do a Save in Browser Workbench to confirm it works
  4. Complete the Autoerror and confirms that it completes correctly

Workaround #2

If the Tasks/files have a high wordcount, applying Workaround #1 might be very time consuming and it might be difficult to find the tag issues. Since the Tasks cannot be exported in WSXZ format because the same error would prevent the export, the workaround is to export them in XLIFF format instead.
  1. Select the Task in Autoerror and export it in XLIFF format.
  2. WorldServer will export a ZIP file including the XLIFF file only. Extract the ZIP file and open it in SDL Trados Studio 2017 or 2019
  3. In SDL Trados Studio, run a Tag Verification and fix all errors where tags are missing, misplaced or have the wrong numbering.
  4. Make sure you confirm the segments you fix in SDL Trados Studio
  5. Save your file in SDL Trados Studio.
  6. Go to File/Save target as... This will create the fixed XLIFF file.
  7. Compress/zip the XLIFF file and import the ZIP file containing the fixed XLIFF file to WorldServer.
  8. If the Import works without error, the issue is fixed since the import includes a Save action in the background
  9. Complete the Autoerror(s) in WorldServer. The issue should be solved.
Issue #2

Apply the Microsoft Word 2007-2013 File Type Filter configuration to the target language subfolder (use Filter Group) by changing the Filter Configuration section of the Properties to the Filter Group containing the Microsoft Word 2007-2013 File Type. Then select the source file under subfolder under source language folder, clear cache, open in Browser Workbench, Save. It should save without error.

If it works, add that file to the project as a new Task following the steps in this article:

How to add a new task to an existing project in WorldServer

Once the Task is added to the project and can be successfully, cancel the Task in Autoerror and proceed with the translation of the new Task.