Troubleshoot source code upload errors

2024/1/22 |

Symptoms

After uploading the source code archive using the Lucent Sky AVM Web UI or CLI, you receive an error message.

Cause

Various reasons can cause source code archive upload to fail. This article describes common causes and solutions to source code archive upload errors.

Resolution

  • After uploading the source code archive, you receive one of the following error messages:

      An unspecified error occurred while extracting the archive file.
    
      An unspecified I/O error has occurred.
    
      ARCHIVE_UNSPECIFIED_ERROR
    

    This problem occurs when CLEAR Engine encountered an error extracting the source code archive. A common cause is invalid characters in the path of files in the archive file.

    CLEAR Engine uses .NET Framework Compression API to extract archive files in Zip format. Follow these steps to identify the underlying error that occurred while extracting the source code archive:

    1. On the server running CLEAR Engine, open Windows PowerShell as administrator.
    2. Enter the following command:

       # Replace <SourceCodePath> with path to the source code archive
       $sourceCodePath = "<SourceCodePath>"
       # Replace <TempDirectoryPath> with path to a temporary directory
       $tempDirectoryPath = "<TempDirectoryPath>"
       Import-Module C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.IO.Compression.FileSystem.dll; [System.IO.Compression.ZipFile]::ExtractToDirectory("$sourceCodePath", "$tempDirectoryPath")
      
    3. If an exception occurred, the source code archive is incompatible with .NET Framework Compression API. Follow the exception message to resolve the error. Using a 3rd-party program (such as 7-Zip) to extract and recreate the source code archive might also resolve the error.

    CLEAR Engine uses 7-Zip to extract archive files in other formats. Use the Teat archive function in 7-Zip to verify the integrity of the source code archive file.

  • After uploading the source code archive, you receive the following error message:

      Maximum request length exceeded.
    

    This problem occurs when the uploaded source code archive exceeded the maximum size allowed by CLEAR Engine.

    By default, Web UI allows a maximum size of 1 GB when uploading the source code archive. This limit can be extended to 2 GB. Follow these steps to increase the limit:

    • Web UI

      1. Open C:\Program Files\Lucent Sky\CLEAR Web\web.config with a text editor.
      2. Locate the <httpRuntime> node in the <system.web> section, and change the value of the maxRequestLength attribute to 2097152.
      3. Locate the the <requestLimits> node in the <requestFiltering> section, and change the value of the maxAllowedContentLength attribute to 2147483648.
    • The CLI already allows the maximum upload size of 2 GB.

  • After uploading the source code archive, you receive the following error message:

      The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
    

    This problem occurs when the path of some files in the source code archive is too long.

    On systems running Windows Server 2016 (OS Build 14393) and later, enabling long path support will remove this limit. To learn about how to enable long path support, view the following article in the Lucent Sky Knowledge Base:
    Administration of Lucent Sky AVM CLI

    On systems running on an earlier version of Windows, a workaround exists that extends the path length limit to around 190 characters. Applying this workaround will prevent CLEAR Engine from generating reports and remediated source code of previous scans. Follow these steps to apply the workaround:

    1. Create a directory with a short name in the root of a disk volume, such as C:\CLEAR. Make sure the LocalSystem account has full control permission to the directory and the NetworkService account has write permission to the directory.
    2. Open C:\Program Files\Lucent Sky\CLEAR Engine\SkyAnalyzer.config using a text editor.
    3. Locate the <StorageRoot> node in the <appSettings> section, and change its value to C:\CLEAR, where C:\CLEAR is the directory you created in a previous step.
    4. Open Windows PowerShell as administrator, enter the following command to restart CLEAR Engine:

       Stop-Service "CLEAR Engine"; Start-Service "CLEAR Engine"