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

(adobereader) Fails to install in Docker container #220

Closed
2 tasks done
adam-clauss opened this issue May 20, 2024 · 5 comments
Closed
2 tasks done

(adobereader) Fails to install in Docker container #220

adam-clauss opened this issue May 20, 2024 · 5 comments
Labels
invalid / cant reproduce / wontfix The issue is invalid and will not be complete.

Comments

@adam-clauss
Copy link

adam-clauss commented May 20, 2024

Checklist

  • I have checked for similar opened and closed issues.
  • The issue title is in the format (<PACKAGENAME>) <ISSUE SUMMARY>.

Chocolatey Version

2.2.2

Chocolatey License

None

Package Version

Adobe Acrobat Reader DC 2024.2.20736

Current Behaviour

Chocolately fails to install the adobereader package when executed inside a container based on mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022.

Expected Behaviour

The package is successfully installed.

Steps To Reproduce

Execute the following commands to startup the base Microsoft image, add chocolately, then try to install adobereader.

  1. docker run --detach --interactive --tty --net=nat --name test_reader mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
  2. docker exec -i test_reader powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  3. docker exec -i test_reader choco install adobereader -y

Environment

- Operating System (run `[System.Environment]::OSVersion.ToString()` in a PowerShell session): Microsoft Windows NT 10.0.20348.0
- PowerShell Version (run `$PSVersionTable` in a PowerShell session): 5.1.20348.2400
- Shell: powershell

Chocolatey Log

https://gist.github.com/adam-clauss/33674751dda6d1610e340dffda797f30

Edit: I did a subsequent run passing "-d" on the install command. That gave some more information:
ERROR: Cannot index into a null array.
at , C:\ProgramData\chocolatey\lib\adobereader\tools\chocolateyinstall.ps1: line 268
at , C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 63
at , : line 1

Anything else?

We are running choco in some of our Docker images as a way to stage the availability of certain software. In this case, we are trying to install adobereader. This is required because it installs the ActiveX control needed to compile some software that embed a PDF viewer.

Copy link

Thanks for raising this issue!

The packages within this repository are maintained in my spare time. My spare time, like yours is important. Please help me not to waste it.

To help me, and to have the issue resolved more quickly, please see CONTRIBUTING for how to raise a pull request to resolve the issue yourself.

Thank you.

@adam-clauss
Copy link
Author

I should add, I have cursory knowledge of chocolatey (I can install packages), but not much beyond that. Based on the logs, I see it is calling into a chocoatelyinstall.ps1. I tried installing the package with the "-n" flag (so it just left that ps1 file there and I could potentially debug it), but it looks to contain some Chocolatey-specific commands, so I can't just execute it directly.

@pauby
Copy link
Owner

pauby commented May 21, 2024

ERROR: Cannot index into a null array.
at , C:\ProgramData\chocolatey\lib\adobereader\tools\chocolateyinstall.ps1: line 268
at , C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 63
at , : line 1

I would guess the problem lies in these two lines.

Line 267 is getting the Uninstall Registry key which should exist as it's just installed the software in line 264 just above it. But on line 268 the array is instead of $null.

This works on a normal virtual machine, so I'm going to assume that it can't be installed inside a Docker container. It's not something I've tested and not something I support. If you can find a fix for it that I can make without altering the functionality to the package, I'm happy to accept a PR.

If the registry key does in fact exist, the issue may lie inside Get-UninstallRegistryKey.

@pauby pauby added the invalid / cant reproduce / wontfix The issue is invalid and will not be complete. label May 21, 2024
@adam-clauss
Copy link
Author

I can try to take a look - can you point me to a way to execute the Chocolatey-specific powershell script? If I just execute hte powershell script myself, it doesn't like the Chocolatey-specific commands, such as that Get-UninstallRegistryKey.

@pauby
Copy link
Owner

pauby commented May 21, 2024

The PowerShell scripts live in $env:ChocolateyInstall\helpers.

@pauby pauby closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid / cant reproduce / wontfix The issue is invalid and will not be complete.
Projects
None yet
Development

No branches or pull requests

2 participants