Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzDevOps user can not access Java Bin folders #3228

Closed
1 of 7 tasks
joshuarichards512 opened this issue Apr 21, 2021 · 16 comments
Closed
1 of 7 tasks

AzDevOps user can not access Java Bin folders #3228

joshuarichards512 opened this issue Apr 21, 2021 · 16 comments
Assignees
Labels
Area: Java investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows

Comments

@joshuarichards512
Copy link

joshuarichards512 commented Apr 21, 2021

Description
The AzDevops user is unable to access the x64 folders for all installed versions of Java

Area for Triage: Java

Question, Bug, or Feature?: Bug

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11.0
  • Windows Server 2016 R2
  • Windows Server 2019

Image version

Latest

Expected behavior
Java bin folder should be accessible to the AzDevops user in order to run the executables

Actual behavior
x64: Access is denied.

Repro steps

  1. Set up a pipeline with a powershell task
  2. Run the following command: CD C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64
@github-actions github-actions bot added Area: Java investigate Collect additional information, like space on disk, other tool incompatibilities etc. labels Apr 21, 2021
@dibir-magomedsaygitov
Copy link
Contributor

dibir-magomedsaygitov commented Apr 21, 2021

Hello @joshuarichards512 . Thank you for your report. We will take a look at this issue and come back as soon as we have results to share.

@al-cheb
Copy link
Contributor

al-cheb commented Apr 22, 2021

Hello, @joshuarichards512
I can't reproduce the issue from my side.

    steps:
         - name: ls
           run: |
            $env:JAVA_HOME_8_X64
            cd $env:JAVA_HOME_8_X64
            dir

image

@dsame dsame self-assigned this Apr 22, 2021
@dsame
Copy link
Contributor

dsame commented Apr 22, 2021

@dsame
Copy link
Contributor

dsame commented Apr 22, 2021

@joshuarichards512 can you please provide the link to a filed build?

@joshuarichards512
Copy link
Author

Here is a snippet from Install-JavaTools.ps1

azure-arm: Provisioning with powershell script: E:\AZRDOAgent01\_work\139\s\self\images\win/Installers/Install-JavaTools.ps1
2021-04-14T18:17:15.4224920Z     azure-arm: Downloading package from: https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u282b08.zip to path C:\Users\packer\AppData\Local\Temp\OpenJDK8U-jdk_x64_windows_hotspot_8u282b08.zip .
2021-04-14T18:17:17.3021779Z     azure-arm: Expand archive 'C:\Users\packer\AppData\Local\Temp\OpenJDK8U-jdk_x64_windows_hotspot_8u282b08.zip' to 'C:\Users\packer\AppData\Local\Temp\Java_8.0.282-8' directory
2021-04-14T18:17:19.2596112Z     azure-arm: Creating Adopt openjdk toolcache folder
2021-04-14T18:17:19.2605622Z     azure-arm: Creating Java '8.0.282-8' folder in 'C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8'
2021-04-14T18:17:19.2615266Z     azure-arm: Set 'JAVA_HOME_8_X64' environmental variable as C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64
2021-04-14T18:17:19.2622932Z     azure-arm:
2021-04-14T18:17:19.2636734Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:17:19.2644750Z     azure-arm: Add C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64\bin to PATH
2021-04-14T18:17:19.2678141Z     azure-arm: C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64\bin;C:\npm\prefix;C:\Program Files\Microsoft SDKs\Azure\Azure Dev Spaces CLI;C:\Program Files\Microsoft SDKs\Azure\Azure Dev Spaces CLI\;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Docker;C:\Program Files\PowerShell\7\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;
2021-04-14T18:17:19.2685029Z     azure-arm: Set JAVA_HOME environmental variable as C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64
2021-04-14T18:17:19.2698459Z     azure-arm:
2021-04-14T18:17:19.2701065Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:17:19.2717808Z     azure-arm: Downloading package from: https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9.zip to path C:\Users\packer\AppData\Local\Temp\OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9.zip .
2021-04-14T18:17:22.3074396Z     azure-arm: Expand archive 'C:\Users\packer\AppData\Local\Temp\OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9.zip' to 'C:\Users\packer\AppData\Local\Temp\Java_11.0.10-9' directory
2021-04-14T18:17:27.0308165Z     azure-arm: Creating Java '11.0.10-9' folder in 'C:\hostedtoolcache\windows\Java_Adopt_jdk\11.0.10-9'
2021-04-14T18:17:27.0317683Z     azure-arm: Set 'JAVA_HOME_11_X64' environmental variable as C:\hostedtoolcache\windows\Java_Adopt_jdk\11.0.10-9\x64
2021-04-14T18:17:27.0335640Z     azure-arm:
2021-04-14T18:17:27.0346603Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:17:27.0362715Z     azure-arm: Downloading package from: https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_windows_hotspot_13.0.2_8.zip to path C:\Users\packer\AppData\Local\Temp\OpenJDK13U-jdk_x64_windows_hotspot_13.0.2_8.zip .
2021-04-14T18:17:30.2097157Z     azure-arm: Expand archive 'C:\Users\packer\AppData\Local\Temp\OpenJDK13U-jdk_x64_windows_hotspot_13.0.2_8.zip' to 'C:\Users\packer\AppData\Local\Temp\Java_13.0.2-8.1' directory
2021-04-14T18:17:38.6708063Z     azure-arm: Creating Java '13.0.2-8.1' folder in 'C:\hostedtoolcache\windows\Java_Adopt_jdk\13.0.2-8.1'
2021-04-14T18:17:38.6724580Z     azure-arm: Set 'JAVA_HOME_13_X64' environmental variable as C:\hostedtoolcache\windows\Java_Adopt_jdk\13.0.2-8.1\x64
2021-04-14T18:17:38.6742772Z     azure-arm:
2021-04-14T18:17:38.6759144Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:17:38.6776356Z     azure-arm: Running [#1]: choco install ant -y -i
2021-04-14T18:17:38.6794129Z     azure-arm: Chocolatey v0.10.15
2021-04-14T18:17:38.6810179Z     azure-arm: 2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).
2021-04-14T18:17:38.6823436Z     azure-arm:
2021-04-14T18:17:38.6841580Z     azure-arm: Validation Warnings:
2021-04-14T18:17:38.6860199Z     azure-arm:  - A pending system reboot request has been detected, however, this is
2021-04-14T18:17:38.6883561Z     azure-arm:    being ignored due to the current Chocolatey configuration.  If you
2021-04-14T18:17:38.6893591Z     azure-arm:    want to halt when this occurs, then either set the global feature
2021-04-14T18:17:38.6915330Z     azure-arm:    using:
2021-04-14T18:17:38.6924593Z     azure-arm:      choco feature enable -name=exitOnRebootDetected
2021-04-14T18:17:38.6943536Z     azure-arm:    or pass the option --exit-when-reboot-detected.
2021-04-14T18:17:38.6963693Z     azure-arm:
2021-04-14T18:17:38.6973737Z     azure-arm: Installing the following packages:
2021-04-14T18:17:38.6982684Z     azure-arm: ant
2021-04-14T18:17:38.7012588Z     azure-arm: By installing you accept licenses for the packages.
2021-04-14T18:17:40.6037441Z     azure-arm: Progress: Downloading ant 1.10.9... 100%
2021-04-14T18:17:41.1074568Z     azure-arm:
2021-04-14T18:17:41.1081423Z     azure-arm: ant v1.10.9 [Approved]
2021-04-14T18:17:41.1105324Z     azure-arm: ant package files install completed. Performing other installation steps.
2021-04-14T18:17:41.9207862Z     azure-arm: Extracting C:\ProgramData\chocolatey\lib\ant\tools\apache-ant-1.10.9-bin.zip to C:\ProgramData\chocolatey\lib\ant\tools...
2021-04-14T18:17:49.7567071Z     azure-arm: C:\ProgramData\chocolatey\lib\ant\tools
2021-04-14T18:17:49.7576007Z     azure-arm: Added C:\ProgramData\chocolatey\bin\ant.exe shim pointed to '..\lib\ant\tools\apache-ant-1.10.9\bin\ant.bat'.
2021-04-14T18:17:49.7584673Z     azure-arm: Environment Vars (like PATH) have changed. Close/reopen your shell to
2021-04-14T18:17:49.7598827Z     azure-arm:  see the changes (or in powershell/cmd.exe just type `refreshenv`).
2021-04-14T18:17:51.0820018Z     azure-arm:  The install of ant was successful.
2021-04-14T18:17:51.0976689Z     azure-arm:   Software installed to 'C:\ProgramData\chocolatey\lib\ant\tools'
2021-04-14T18:17:51.1648418Z     azure-arm:
2021-04-14T18:17:51.3217367Z     azure-arm: Chocolatey installed 1/1 packages.
2021-04-14T18:17:51.4073099Z     azure-arm:  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-04-14T18:17:52.4314512Z     azure-arm: Package installed: ant|1.10.9
2021-04-14T18:17:52.4340631Z     azure-arm: Running [#1]: choco install maven -y -i --version=3.6.3
2021-04-14T18:17:52.4361471Z     azure-arm: Chocolatey v0.10.15
2021-04-14T18:17:52.4382089Z     azure-arm: 2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).
2021-04-14T18:17:52.4400875Z     azure-arm:
2021-04-14T18:17:52.4419542Z     azure-arm: Validation Warnings:
2021-04-14T18:17:52.4439580Z     azure-arm:  - A pending system reboot request has been detected, however, this is
2021-04-14T18:17:52.4467559Z     azure-arm:    being ignored due to the current Chocolatey configuration.  If you
2021-04-14T18:17:52.4487950Z     azure-arm:    want to halt when this occurs, then either set the global feature
2021-04-14T18:17:52.4506614Z     azure-arm:    using:
2021-04-14T18:17:52.4526034Z     azure-arm:      choco feature enable -name=exitOnRebootDetected
2021-04-14T18:17:52.4545795Z     azure-arm:    or pass the option --exit-when-reboot-detected.
2021-04-14T18:17:52.4564646Z     azure-arm:
2021-04-14T18:17:52.4584019Z     azure-arm: Installing the following packages:
2021-04-14T18:17:52.4603765Z     azure-arm: maven
2021-04-14T18:17:52.4623609Z     azure-arm: By installing you accept licenses for the packages.
2021-04-14T18:17:52.9942696Z     azure-arm: Progress: Downloading maven 3.6.3... 100%
2021-04-14T18:17:54.2627055Z     azure-arm:
2021-04-14T18:17:54.2632982Z     azure-arm: maven v3.6.3 [Approved] - Likely broken for FOSS users (due to download location changes)
2021-04-14T18:17:54.2645511Z     azure-arm: maven package files install completed. Performing other installation steps.
2021-04-14T18:17:56.3791199Z     azure-arm: Downloading Maven
2021-04-14T18:17:56.6182807Z     azure-arm:   from 'https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip'
2021-04-14T18:17:58.4403592Z     azure-arm: Progress: 100% - Completed download of C:\Users\packer\AppData\Local\Temp\chocolatey\maven\3.6.3\apache-maven-3.6.3-bin.zip (9.16 MB).
2021-04-14T18:17:58.4427467Z     azure-arm: Download of apache-maven-3.6.3-bin.zip (9.16 MB) completed.
2021-04-14T18:18:02.6041793Z     azure-arm: Hashes match.
2021-04-14T18:18:02.6063042Z     azure-arm: Extracting C:\Users\packer\AppData\Local\Temp\chocolatey\maven\3.6.3\apache-maven-3.6.3-bin.zip to C:\ProgramData\chocolatey\lib\maven...
2021-04-14T18:18:02.6084023Z     azure-arm: C:\ProgramData\chocolatey\lib\maven
2021-04-14T18:18:02.6102764Z     azure-arm: C:\Users\packer\.m2
2021-04-14T18:18:02.6122504Z     azure-arm: PATH environment variable does not have %M2_HOME%\bin in it. Adding...
2021-04-14T18:18:02.6155511Z     azure-arm: Environment Vars (like PATH) have changed. Close/reopen your shell to
2021-04-14T18:18:02.6243993Z     azure-arm:  see the changes (or in powershell/cmd.exe just type `refreshenv`).
2021-04-14T18:18:02.6260910Z     azure-arm:  The install of maven was successful.
2021-04-14T18:18:02.6279874Z     azure-arm:   Software installed to 'C:\ProgramData\chocolatey\lib\maven'
2021-04-14T18:18:02.6296859Z     azure-arm:
2021-04-14T18:18:02.6315094Z     azure-arm: Chocolatey installed 1/1 packages.
2021-04-14T18:18:02.6344393Z     azure-arm:  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-04-14T18:18:04.0555520Z     azure-arm: Package installed: maven|3.6.3
2021-04-14T18:18:04.0580137Z     azure-arm: Running [#1]: choco install gradle -y
2021-04-14T18:18:04.0593807Z     azure-arm: Chocolatey v0.10.15
2021-04-14T18:18:04.0609194Z     azure-arm: 2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).
2021-04-14T18:18:04.0615947Z     azure-arm:
2021-04-14T18:18:04.0629522Z     azure-arm: Validation Warnings:
2021-04-14T18:18:04.0638136Z     azure-arm:  - A pending system reboot request has been detected, however, this is
2021-04-14T18:18:04.0661792Z     azure-arm:    being ignored due to the current Chocolatey configuration.  If you
2021-04-14T18:18:04.0673007Z     azure-arm:    want to halt when this occurs, then either set the global feature
2021-04-14T18:18:04.0677582Z     azure-arm:    using:
2021-04-14T18:18:04.0688325Z     azure-arm:      choco feature enable -name=exitOnRebootDetected
2021-04-14T18:18:04.0696476Z     azure-arm:    or pass the option --exit-when-reboot-detected.
2021-04-14T18:18:04.0703679Z     azure-arm:
2021-04-14T18:18:04.0715146Z     azure-arm: Installing the following packages:
2021-04-14T18:18:04.0729867Z     azure-arm: gradle
2021-04-14T18:18:04.0749372Z     azure-arm: By installing you accept licenses for the packages.
2021-04-14T18:18:05.9957906Z     azure-arm: Progress: Downloading gradle 6.8.3... 100%
2021-04-14T18:18:05.9966110Z     azure-arm:
2021-04-14T18:18:05.9972611Z     azure-arm: gradle v6.8.3 [Approved]
2021-04-14T18:18:05.9979459Z     azure-arm: gradle package files install completed. Performing other installation steps.
2021-04-14T18:18:09.2707708Z     azure-arm: Downloading gradle
2021-04-14T18:18:09.2729967Z     azure-arm:   from 'https://services.gradle.org/distributions/gradle-6.8.3-all.zip'
2021-04-14T18:18:09.2737846Z     azure-arm: Progress: 100% - Completed download of C:\Users\packer\AppData\Local\Temp\chocolatey\gradle\6.8.3\gradle-6.8.3-all.zip (143.65 MB).
2021-04-14T18:18:09.2745435Z     azure-arm: Download of gradle-6.8.3-all.zip (143.65 MB) completed.
2021-04-14T18:18:13.2044159Z     azure-arm: Hashes match.
2021-04-14T18:18:13.2054882Z     azure-arm: Extracting C:\Users\packer\AppData\Local\Temp\chocolatey\gradle\6.8.3\gradle-6.8.3-all.zip to C:\ProgramData\chocolatey\lib\gradle\tools...
2021-04-14T18:18:42.6980391Z     azure-arm: C:\ProgramData\chocolatey\lib\gradle\tools
2021-04-14T18:18:43.5582496Z     azure-arm: Added C:\ProgramData\chocolatey\bin\gradle.exe shim pointed to '..\lib\gradle\tools\gradle-6.8.3\bin\gradle.bat'.
2021-04-14T18:18:43.5588544Z     azure-arm: Environment Vars (like PATH) have changed. Close/reopen your shell to
2021-04-14T18:18:43.5600052Z     azure-arm:  see the changes (or in powershell/cmd.exe just type `refreshenv`).
2021-04-14T18:18:56.0518185Z     azure-arm:  The install of gradle was successful.
2021-04-14T18:18:56.2152869Z     azure-arm:   Software installed to 'C:\ProgramData\chocolatey\lib\gradle\tools'
2021-04-14T18:18:56.4445933Z     azure-arm:
2021-04-14T18:18:56.4482894Z     azure-arm: Chocolatey installed 1/1 packages.
2021-04-14T18:18:56.4506391Z     azure-arm:  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-04-14T18:18:56.4526594Z     azure-arm:
2021-04-14T18:18:56.4546946Z     azure-arm: Did you know the proceeds of Pro (and some proceeds from other
2021-04-14T18:18:56.4567412Z     azure-arm:  licensed editions) go into bettering the community infrastructure?
2021-04-14T18:18:56.4588094Z     azure-arm:  Your support ensures an active community, keeps Chocolatey tip top,
2021-04-14T18:18:56.4608913Z     azure-arm:  plus it nets you some awesome features!
2021-04-14T18:18:56.4635335Z     azure-arm:  https://chocolatey.org/compare
2021-04-14T18:18:57.0751269Z     azure-arm: Package installed: gradle|6.8.3
2021-04-14T18:18:57.0760631Z     azure-arm:
2021-04-14T18:18:57.0776394Z     azure-arm:
2021-04-14T18:18:57.0787750Z     azure-arm:     Directory: C:\ProgramData
2021-04-14T18:18:57.0799094Z     azure-arm:
2021-04-14T18:18:57.0806713Z     azure-arm:
2021-04-14T18:18:57.0818746Z     azure-arm: Mode                LastWriteTime         Length Name
2021-04-14T18:18:57.0827805Z     azure-arm: ----                -------------         ------ ----
2021-04-14T18:18:57.0841166Z     azure-arm: d-----        4/14/2021   6:18 PM                m2
2021-04-14T18:18:57.0855098Z     azure-arm:
2021-04-14T18:18:57.0863363Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:18:57.0870356Z     azure-arm:
2021-04-14T18:18:57.0882438Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:18:57.0889573Z     azure-arm:
2021-04-14T18:18:57.0904235Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:18:57.0913004Z     azure-arm: Downloading package from: https://downloads.sourceforge.net/project/cobertura/cobertura/2.1.1/cobertura-2.1.1-bin.zip to path C:\Users\packer\AppData\Local\Temp\cobertura.zip .
2021-04-14T18:18:59.4772456Z     azure-arm: Expand archive 'C:\Users\packer\AppData\Local\Temp\cobertura.zip' to 'C:\' directory
2021-04-14T18:18:59.4783909Z     azure-arm:
2021-04-14T18:18:59.4798407Z     azure-arm: SUCCESS: Specified value was saved.
2021-04-14T18:19:00.8067685Z     azure-arm:
2021-04-14T18:19:00.8080603Z     azure-arm: Starting discovery in 1 files.
2021-04-14T18:19:00.8100623Z     azure-arm: Discovering in C:\image\Tests\Java.Tests.ps1.
2021-04-14T18:19:01.9163217Z     azure-arm: Found 8 tests. 535ms
2021-04-14T18:19:01.9174676Z     azure-arm: Discovery finished in 1.1s.
2021-04-14T18:19:01.9187540Z     azure-arm:
2021-04-14T18:19:01.9200129Z     azure-arm: Running tests from 'C:\image\Tests\Java.Tests.ps1'
2021-04-14T18:19:03.1040079Z     azure-arm: Describing Java
2021-04-14T18:19:04.7568413Z     azure-arm:   [+] Java 8 is default 938ms (706ms|232ms)
2021-04-14T18:19:04.7586658Z     azure-arm:   [+] java 107ms (106ms|1ms)
2021-04-14T18:19:04.7594368Z     azure-arm:   [+] mvn 216ms (215ms|2ms)
2021-04-14T18:19:04.7605381Z     azure-arm:   [+] ant 264ms (263ms|1ms)
2021-04-14T18:19:05.8148148Z     azure-arm:   [+] gradle 634ms (632ms|2ms)
2021-04-14T18:19:05.8155820Z     azure-arm:   [+] Java 8 148ms (144ms|4ms)
2021-04-14T18:19:05.8186300Z     azure-arm:   [+] Java 11 140ms (139ms|1ms)
2021-04-14T18:19:05.8194064Z     azure-arm:   [+] Java 13 109ms (108ms|1ms)
2021-04-14T18:19:06.6262992Z     azure-arm: Tests completed in 5.68s
2021-04-14T18:19:06.6282318Z     azure-arm: Tests Passed: 8, Failed: 0, Skipped: 0 NotRun: 0

@dsame
Copy link
Contributor

dsame commented Apr 26, 2021

Here is a snippet from Install-JavaTools.ps1

The provided snipped does not have Access is denied message.
Please provide the failed build or repro.

@joshuarichards512
Copy link
Author

Misunderstood your previous comment:

failed build output:

2021-04-20T18:39:26.9594141Z ##[section]Starting: Command Line Script
2021-04-20T18:39:26.9781514Z ==============================================================================
2021-04-20T18:39:26.9783512Z Task         : Command line
2021-04-20T18:39:26.9784014Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2021-04-20T18:39:26.9784408Z Version      : 2.182.0
2021-04-20T18:39:26.9784736Z Author       : Microsoft Corporation
2021-04-20T18:39:26.9785225Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2021-04-20T18:39:26.9785728Z ==============================================================================
2021-04-20T18:39:29.8449989Z Generating script.
2021-04-20T18:39:29.8990981Z ========================== Starting Command Output ===========================
2021-04-20T18:39:29.9380597Z ##[command]"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\a\_temp\c2ce18f5-5a4f-4987-baec-7ba059789b4d.cmd""
2021-04-20T18:39:29.9607914Z C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64
2021-04-20T18:39:29.9622282Z C:\agent\externals\git\cmd;C:\Program Files\MongoDB\Server\4.4\bin;C:\aliyun-cli;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.5.1\x64;C:\tools\ghc-9.0.1\bin;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\R\R-4.0.5\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Rust\.cargo\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\hostedtoolcache\windows\go\1.15.11\x64\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Ruby\2.5.8\x64\bin;C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64\bin;C:\npm\prefix;C:\Program Files\Microsoft SDKs\Azure\Azure Dev Spaces CLI;C:\Program Files\Microsoft SDKs\Azure\Azure Dev Spaces CLI\;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Docker;C:\Program Files\PowerShell\7\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.3\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\OpenSSL\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\TortoiseSVN\bin;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\CMake\bin;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files (x86)\Microsoft BizTalk Server\;C:\Users\AzDevOps\AppData\Local\Microsoft\WindowsApps;
2021-04-20T18:39:29.9632832Z Access is denied.
2021-04-20T18:39:29.9641093Z  Volume in drive C is Windows
2021-04-20T18:39:29.9642155Z  Volume Serial Number is E41F-2582
2021-04-20T18:39:29.9642699Z 
2021-04-20T18:39:29.9643481Z  Directory of C:\a\1\s
2021-04-20T18:39:29.9643967Z 
2021-04-20T18:39:29.9645008Z 04/20/2021  06:37 PM    <DIR>          .
2021-04-20T18:39:29.9648954Z 04/20/2021  06:37 PM    <DIR>          ..
2021-04-20T18:39:29.9650745Z 04/20/2021  06:37 PM             1,330 .gitignore
2021-04-20T18:39:29.9651756Z 04/20/2021  06:37 PM               594 Dockerfile
2021-04-20T18:39:29.9652595Z 04/20/2021  06:37 PM             1,567 requirements.txt
2021-04-20T18:39:29.9653933Z 04/20/2021  06:37 PM    <DIR>          sq_app
2021-04-20T18:39:29.9654862Z                3 File(s)          3,491 bytes
2021-04-20T18:39:29.9655970Z                3 Dir(s)  95,139,500,032 bytes free
2021-04-20T18:39:29.9735322Z 'java' is not recognized as an internal or external command,
2021-04-20T18:39:29.9736197Z operable program or batch file.
2021-04-20T18:39:30.0629298Z ##[error]Cmd.exe exited with code '1'.
2021-04-20T18:39:30.1257183Z ##[section]Finishing: Command Line Script

Pipeline Step:

steps:
- powershell: |
   echo %JAVA_HOME%
   
   echo %PATH%
   
   cd %JAVA_HOME%\bin
   
   dir
   
   java

@dsame
Copy link
Contributor

dsame commented May 3, 2021

@joshuarichards512 i see you use cmd.exe syntax with powershell step. Please either run your step with cmd shell or use pwsh $env:Path syntax

@joshuarichards512
Copy link
Author

@dsame good catch, using powershell syntax:

steps:
         - name: ls
           run: |
            $env:JAVA_HOME_8_X64
            cd $env:JAVA_HOME_8_X64
            dir

Output:

2021-05-03T15:54:00.1305640Z ##[section]Starting: PowerShell Script
2021-05-03T15:54:00.1572861Z ==============================================================================
2021-05-03T15:54:00.1580534Z Task         : PowerShell
2021-05-03T15:54:00.1581031Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2021-05-03T15:54:00.1581461Z Version      : 2.180.1
2021-05-03T15:54:00.1582210Z Author       : Microsoft Corporation
2021-05-03T15:54:00.1582784Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2021-05-03T15:54:00.1583401Z ==============================================================================
2021-05-03T15:54:03.1603988Z Generating script.
2021-05-03T15:54:03.2171335Z ========================== Starting Command Output ===========================
2021-05-03T15:54:03.2460913Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\a\_temp\c6f4846e-8676-4ea3-80f5-0354f69037dc.ps1'"
2021-05-03T15:54:03.5878488Z C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64
2021-05-03T15:54:05.2175863Z dir : Access to the path 'C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.282-8\x64' is denied.
2021-05-03T15:54:05.2180282Z At C:\a\_temp\c6f4846e-8676-4ea3-80f5-0354f69037dc.ps1:5 char:1
2021-05-03T15:54:05.2240775Z + dir
2021-05-03T15:54:05.2259917Z + ~~~
2021-05-03T15:54:05.2309375Z     + CategoryInfo          : PermissionDenied: (C:\hostedtoolca...k\8.0.282-8\x64:String) [Get-ChildItem], Unauthoriz 
2021-05-03T15:54:05.2313461Z    edAccessException
2021-05-03T15:54:05.2315253Z     + FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
2021-05-03T15:54:05.2316213Z  
2021-05-03T15:54:05.3335965Z ##[error]PowerShell exited with code '1'.
2021-05-03T15:54:05.4085119Z ##[section]Finishing: PowerShell Script

@dsame
Copy link
Contributor

dsame commented May 19, 2021

@joshuarichards512 can you please give a link to the filed build?

I still can not reproduce the problem https://dev.azure.com/v-sedoli/dummy/_build/results?buildId=169&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a

@AlenaSviridenko
Copy link
Contributor

Closing this one due to no response for a long time. Please, let us know if you have any concerns.
Thanks.

@gonchalo620
Copy link

The same thing is happening to me too, I have problems with SonarQube

image

image

@miketimofeev
Copy link
Contributor

@gonchalo620 could you please provide more details about your java usage? It seems to be a pretty specific case since we haven't heard any complaints except this issue

@pobop
Copy link

pobop commented Jun 17, 2021

Hello,

I have also the errors (access denied and JAVA_HOME not valid) but only on my agent pools where the option "Configure VMs to run interactive tests" is turned on.

@miketimofeev
Copy link
Contributor

@gonchalo620 @pobop @joshuarichards512 the issue should be fixed in this PR #3605

@jamelia1303
Copy link

@miketimofeev
I run into this issue too.

vhd: Set JAVA_HOME environmental variable as C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.302-8\x64
vhd:
vhd: SUCCESS: Specified value was saved.
vhd: Downloading package from: https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_windows_hotspot_11.0.12_7.zip to path C:\Users\packer\AppData\Local\Temp\OpenJDK11U-jdk_x64_windows_hotspot_11.0.12_7.zip .
vhd: Package downloaded successfully in 2.1 seconds
vhd: Creating Java '11.0.12-7' folder in 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.12-7'
vhd: Expand archive 'C:\Users\packer\AppData\Local\Temp\OpenJDK11U-jdk_x64_windows_hotspot_11.0.12_7.zip' to 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.12-7' directory
vhd: Set 'JAVA_HOME_11_X64' environmental variable as C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.12-7\x64
vhd:
vhd: SUCCESS: Specified value was saved.
vhd: Downloading package from: https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17%2B35/OpenJDK17-jdk_x64_windows_hotspot_17_35.zip to path C:\Users\packer\AppData\Local\Temp\OpenJDK17-jdk_x64_windows_hotspot_17_35.zip .
vhd: Package downloaded successfully in 1.97 seconds
vhd: Creating Java '17.0.0-35' folder in 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\17.0.0-35'
vhd: Expand archive 'C:\Users\packer\AppData\Local\Temp\OpenJDK17-jdk_x64_windows_hotspot_17_35.zip' to 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\17.0.0-35' directory
vhd: Set 'JAVA_HOME_17_X64' environmental variable as C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\17.0.0-35\x64
vhd:
vhd: SUCCESS: Specified value was saved.
vhd: Downloading package from: https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08.1/OpenJDK8U-jdk_x64_windows_hotspot_8u302b08.zip to path C:\Users\packer\AppData\Local\Temp\OpenJDK8U-jdk_x64_windows_hotspot_8u302b08.zip .
vhd: Package downloaded successfully in 0.44 seconds
vhd: Creating Adopt toolcache folder
vhd: Creating Java '8.0.302-8' folder in 'C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.302-8'
vhd: Expand archive 'C:\Users\packer\AppData\Local\Temp\OpenJDK8U-jdk_x64_windows_hotspot_8u302b08.zip' to 'C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.302-8' directory

==> vhd: Rename-Item : Access to the path 'C:\hostedtoolcache\windows\Java_Adopt_jdk\8.0.302-8\jdk8u302-b08' is denied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Java investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows
Projects
None yet
Development

No branches or pull requests

9 participants