microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

JavaTooInstallerV0 install failue via azureStorageAccount due to storage path #14214

Closed robododge closed 3 years ago

robododge commented 3 years ago

Question, Bug, or Feature?
Type: Bug

Enter Task Name: JavaTooInstarllerV0

Environment

Issue Description

When using the azure storage account to load in jdk gzip file, if a nested path to the jdk file is supplied, file extraction fails because the azureCommonVirtualFile path does nor handle a prefixed extra path as described in tool tips. The resulting logs indicate an attempt to stat the tar.jz file from a with a double stacked path $(Pipeline.Workspace)/jdk15/jdk15/openjdk-15.0.1_linux-x64_bin.tar.gz which does not exist. Note, the doubling of the jdk15 intermediate path.

    - task: JavaToolInstaller@0
      inputs:
        versionSpec: '15'
        jdkArchitectureOption: 'x64'
        jdkSourceOption: 'AzureStorage'
        azureResourceManagerEndpoint: 'Rainmaker-SC'
        azureStorageAccountName: '30253adobuildstorage'
        azureContainerName: 'openjdk-container'
        azureCommonVirtualFile: 'jdk15/openjdk-15.0.1_linux-x64_bin.tar.gz'
        jdkDestinationDirectory: '$(Pipeline.Workspace)/jdk15'
        cleanDestinationDirectory: true

Troubleshooting

Tried moving the jdk artifact to the top-level directory in the storage account blob. That worked because it removed the need to use an extra path in the azureCommonVirtualFile property

Error logs

Retrieving the JDK from Azure blob storage.
Downloading artifacts from Azure blob storage, Container Name: openjdk-container
Successfully fetcted list of items
Downloading openjdk-15.0.1_linux-x64_bin.tar.gz to /azagent/_work/1/jdk15/openjdk-15.0.1_linux-x64_bin.tar.gz
Downloaded openjdk-15.0.1_linux-x64_bin.tar.gz to /azagent/_work/1/jdk15/openjdk-15.0.1_linux-x64_bin.tar.gz
Total Files: 1, Processed: 1, Skipped: 0, Failed: 0, Download time: 3.124 secs, Download size: 0Bytes
Extracting archive to: /azagent/_work/1/jdk15/JAVA_HOME_15_x64_openjdk-15.0.1_linux-x64_bin_tar.gz
Creating destination folder: /azagent/_work/1/jdk15/JAVA_HOME_15_x64_openjdk-15.0.1_linux-x64_bin_tar.gz
##[error]ENOENT: no such file or directory, stat '/azagent/_work/1/jdk15/jdk15/openjdk-15.0.1_linux-x64_bin.tar.gz'
##[error]ENOENT: no such file or directory, stat '/azagent/_work/1/jdk15/jdk15/openjdk-15.0.1_linux-x64_bin.tar.gz'
Finishing: JavaToolInstaller
BrianMouncer commented 3 years ago

@egor-bryzgalov I am running into this same issue.

to work around this, I had to upload the OpenJKS package needed to the root of our blob storage container, rather than into an OpenJDK folder inside the container.

It also feed like a waist and a danger, that the installer searches the entire drop folder looking for all zip files in the container, if it is going to fail to install it if the zip file it finds is not in the root of the blob container...

It would be grate to have a separate input parameter for the "source path" relative from the drop container, that would both limit the search of files, as well as fix this duplication of directory names in the path.

ArthwitRail commented 3 years ago

Me too - we came across this problem today as well, really could do with a fix

AnnaOpareva commented 3 years ago

Hi, @ArthwitRail We fixed this problem. Updated task version 0.194.0 will be deployed in the next 5 weeks. Feel free to ping us if you will have any problem with it.

anatolybolshakov commented 3 years ago

Hi everyone, fix for this issue has been already rolled out - closing this at the moment. Please let us know if you have any other questions.