Signiant Support

Job hangs in file name mapping command Print


Symptoms

When running a custom template with a Source or Target File Name Mapping command, the job hangs.

Resolution

The File Name Mapping commands accept a list of file names, one per file, to STDIN.  The agent requires that a corresponding mapped file name (or special token) is emitted to STDOUT for every file name accepted by STDIN.  If the number of names or tokens sent to STDOUT is less than the number accepted by STDIN, the agent will appear to hang, waiting for the File Name Mapping command to fulfill its requirements.
 
In general, you want to make sure that every line of STDIN received by the File Name Mapping command has a corresponding line of STDOUT generated, as the agent will not cotinue until this is the case. In your mapping command, you need to make sure there is no possible way that a file name is not missed. While it may seem impossible to not match a particular condition, it is important to trap any possible exception.  
 
When an exception is caught, tt is recommended that you output useful debugging information to STDERR (so it will appear in the log), and either the unmodified file name (to transfer the file as is) OR the token "*** skip ***" (with no quotes, to skip the file) to STDOUT. This will satisfy the mapping command by emitting one line of STDOUT for each line of received STDIN, and will let the job continue.