Automic Workload Automation

  • 1.  U04002691 An unexpected error occurred while downloading the file (&01).

    Posted Sep 06, 2016 04:26 AM
    Whenever I try to use the Open or Open as text... buttons to view a report file list in the Report window of a job, an error like this appears:
    U04002691 An unexpected error occurred while downloading the file (&01). The download was canceled.
    The Download... button works fine. The above error appeared when I tried to open the REP (Report) file. If I try to open a registered output file, the same error occurs, but the name of the file appears in place of &01 in the error message.

    This problem began after we upgraded from v9 to v11. We are running UC4 Version 11.2.2+build.622.

    Has anyone else seen this?


  • 2.  U04002691 An unexpected error occurred while downloading the file (&01).

    Posted Sep 08, 2016 04:48 AM
    Frequent readers of my discussions may remember that I discovered that when the UI is started using a custom script that sets environment variables and Java system parameters, some applications functions that write files to the local system where the UI is running seem to get confused. For example, the UI has problems writing temporary files related to RA agents when the UI is started in a non-standard way.

    I suspect that the problem with Open and Open as text... are affected in a similar way, because they also write temporary files. The problem with Open and Open as text... does not happen when the UI is run with a more standard out-of-the-box configuration.


  • 3.  RE: U04002691 An unexpected error occurred while downloading the file (&01).

    Posted Aug 26, 2019 11:34 AM
    Edited by Michael A. Lowry Aug 28, 2019 05:19 AM
    I finally found a fix for this today. I had looked into this before, but had not found a solution until today. It has to do with an inconsistency in the way UCDJ handles relative paths. In our environment, we specify relative paths in the uc4config.xml file, e.g., for the location where logs should be stored.
    <logging count="10">logs\UCDJ_LOG_##.TXT</logging>

    Normally, relative paths are relative to the current working directory. And indeed, some parts of UCDJ use the current working directory at the time when the program was launched when evaluating relative paths. However, other parts of UCDJ, including the parts that download files, use the path specified in the user.dir, Java system property if it is set.

    If there is a mismatch between the two paths, downloading the log will usually fail.

    UCDJ uses a directory called downloads to store temporary downloaded files. This directory resides in the logs directory specified in logging element of the uc4config.xml file.
    1. When you start UCDJ, it checks whether whether the logs directory specified in the uc4config.xml file exists, and creates it necessary. If this directory is specified using a relative path, UCDJ checks under the current working directory. The program completely ignores the user.dir system property.
    2. When you click on the Open or Open as text... buttons in the Directory tab of a Report window, UCDJ checks whether the logs/downloads directory exists, and creates it if necessary. If the user.dir system property is set, it looks in the directory specified in user.dir instead of in the current working directory.
    3. UCDJ downloads the requested file to the downloads directory.
    4. UCDJ opens the file.

    Step #2 will fail if:
    • The logs directory is specified with a relative path in uc4config.xml
      and
    • The current working directory differs from the directory specified with user.dir
      and
    • The logs directory does not already exist under the user.dir directory.
    This is because although the program is able to create the downloads sub-directory if it does not exist, it assumes that the logging parent directory has already been created. And because the part of the program that creates the logs directory always creates this director under the current working directory, there may be no logs directory in the (different) directory specified by user.dir.

    Step #2 will also fail if:
    • The logs directory resides on a UNC network path, even if it and the downloads sub-directory already exist.

    So, this reveals two undocumented requirements:
    • The current working directory when UCDJ is started must not be a UNC network path.
    • If user.dir is specified, it should be set to the same path as the current working directory.

    I will update the UC4 User Interface startup script soon.


  • 4.  RE: U04002691 An unexpected error occurred while downloading the file (&01).

    Posted Aug 26, 2019 11:59 AM
    So, this reveals two undocumented requirements:
    •  The current working directory when UCDJ is started must not be a UNC network path.
    •  If user.dir is specified, it should be set to the same path as the current working directory.
    Unfortunately, this means that if I want log downloads to work, I can no longer store UCDJ logs in my Documents folder.


  • 5.  RE: U04002691 An unexpected error occurred while downloading the file (&01).

    Posted Aug 29, 2019 10:40 AM
    I have posted the updated UC4.ps1 script. To work around the problem with the way relative paths are handled, I changed the location used to store config files, logs, and temporary files from %MyDocuments% to %AppData%.