英文:
Azure build Agent
问题
情境: 在 Azure Pipeline 的构建过程中,我在自托管代理上使用 JavaToolInstaller,在目录中放置了“java/JAVA_HOME_8_x64_”。
背景: 我认为这不是权限问题,因为我已经为该目录应用了完全权限,并为构建过程创建了它。
评估: 有人之前遇到过这个问题吗?
重现步骤 - 托管本地代理
JavaToolInstaller
- task: JavaToolInstaller@0
inputs:
versionSpec: '8'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'LocalDirectory'
jdkFile: '/opt/jdk-8u251-linux-x64.tar.gz'
jdkDestinationDirectory: '/opt/java'
cleanDestinationDirectory: true
condition: eq(variables['Agent.OS'], 'Linux')
构建期间的错误
在解压缩之前清理目标文件夹:/opt/java
从本地路径检索 JDK。
##[warning]找不到键的 loc 字符串:ExtractingArchiveToPath
正在解压缩至路径 /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
正在创建目标文件夹:/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
##[error]无法创建目录 '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'。EACCES:权限被拒绝,mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
##[error]无法创建目录 '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'。EACCES:权限被拒绝,mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
完成:JavaToolInstaller
英文:
Situation: During the build process of an azure pipeline i use the JavaToolInstaller on a self hosted agent and it places "java/JAVA_HOME_8_x64_" in the directory <br />
Background: I dont believe this to be a permission issue when i have applied full permissions to that directory and created it for the build process <br />
Assessment: Has anyone see this issue before?
Steps to reproduce - host onsite agent
JavaToolInstaller
- task: JavaToolInstaller@0
inputs:
versionSpec: '8'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'LocalDirectory'
jdkFile: '/opt/jdk-8u251-linux-x64.tar.gz'
jdkDestinationDirectory: '/opt/java'
cleanDestinationDirectory: true
condition: eq( variables['Agent.OS'], 'Linux' )
Error during build
Cleaning destination folder before extraction: /opt/java
Retrieving the JDK from local path.
##[warning]Can\'t find loc string for key: ExtractingArchiveToPath
ExtractingArchiveToPath /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
Creating destination folder: /opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz
##[error]Unable to create directory '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'. EACCES: permission denied, mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
##[error]Unable to create directory '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'. EACCES: permission denied, mkdir '/opt/java/JAVA_HOME_8_x64_jdk-8u251-linux-x64_tar.gz'
Finishing: JavaToolInstaller
答案1
得分: 0
根据错误消息,似乎您没有写入此文件的权限。请检查并确保您对此文件夹具有写入和读取权限。
步骤:
定位文件jdk-8u251-linux-x64.tar.gz->右键单击图标->选择属性->点击权限选项卡,然后检查帐户权限
或者使用命令 ls –l {file name}
来检查文件夹权限,然后运行命令 chmod [permission] [file_name]
来更新权限
请参考此链接获取更多详细信息:如何在Linux中更改目录权限
英文:
According to the error message, it seems that you do not have permission to write this file. Please check it and ensure that you have w and r permission for this folder
Steps:
Locate the file jdk-8u251-linux-x64.tar.gz->right-click on the icon->select Properties->click the tab permission then check the account permission
Or use the cmd ls –l {file name}
to check the folder permission, then run the cmd chmod [permission] [file_name]
to update the permission
Please refer this link for more details: How to change directory permissions in Linux
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论