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

using hyperv provider, can not read files in /packages share #41

Open
diablodale opened this issue Jun 19, 2019 · 7 comments
Open

using hyperv provider, can not read files in /packages share #41

diablodale opened this issue Jun 19, 2019 · 7 comments

Comments

@diablodale
Copy link

By using the hyperv provider for vagrant, I am unable to read files in the /packages share. I can see and list (dir) the files, but I can not read the files.

Setup

  • Windows 10 pro ver 1903 (Version 10.0.18362.175)
  • hyperv installed and working across multiple other things (hyperv itself, docker, etc.)
  • Vagrant 2.2.4

Repo

  1. Setup as per instructions at https://github.com/chocolatey-community/chocolatey-test-environment/blob/master/ReadMe.md except for the following:
    • No Virtualbox -- we will be using the hyperv box and provider
    • No plugin sahara -- this is unneeded for this issue
  2. vagrant winrm -e -s powershell -c "copy c:/packages/*.* c:/"

Result

copy : Could not find file 'C:\packages\ReadMe.md'.
At C:\windows\temp\winrm-elevated-shell-fff58481-a970-493f-9281-4d343fbfd9b2.ps
1:1 char:1
+ copy c:/packages/*.* c:/
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-Item], FileNotFoundExcep
   tion
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerS
   hell.Commands.CopyItemCommand

Expected

No errors and the Readme.md file to be copied.

Notes

Listing files succeeds like this:

vagrant winrm -e -s powershell -c "dir C:/packages/"
    Directory: C:\packages
Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         6/19/2019  12:05 AM        113 ReadMe.md

All attempts to read the files (like readme.md) usign different methods results in similar errors. For example, editing the Vagrantfile to have a provision command type c:/packages/ReadMe.md results in the error:

==> default: Running provisioner: shell...
    default: Running: inline PowerShell script
    default: SUCCESS: Specified value was saved.
    default: Testing package if a line is uncommented.
    default: type : Cannot find path 'C:\packages\ReadMe.md' because it does not exist.
    default: At C:\tmp\vagrant-shell.ps1:16 char:1
    default: + type c:/packages/ReadMe.md
    default: + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    default:     + CategoryInfo          : ObjectNotFound: (C:\packages\ReadMe.md:String) [
    default:    Get-Content], ItemNotFoundException
    default:     + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCo
    default:    ntentCommand

Manipulating the permissions on the packages folder and files on the host did not resolve the problems. I added full access to Everyone and yet the files can be seen, but can not be read.

In ba95e7d the hyperv provider and box was added. Was the read of local packages in the /packages share tested? If so, are there setup/permission/file requirements to get it to work?

@AJDurant
Copy link

I changed the synced_folder line to a file provision to work around this:
config.vm.provision "file", source: "packages", destination: "/packages"

@flybyray
Copy link

flybyray commented Dec 9, 2022

Have similar problem. Output for the diagnostic commands is a bit different:

vagrant winrm -e -s powershell -c "copy c:/packages/*.* c:/"
no output

vagrant winrm -e -s powershell -c "dir C:/packages/"
output:

dir : The network path was not found.
At C:\windows\temp\winrm-elevated-shell-d086146b-7d47-4016-b515-f4eba2d99125.ps
1:1 char:1
+ dir C:/packages/
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (C:\packages\:String) [Get-ChildItem]
   , IOException
    + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChil
   dItemCommand

@pauby
Copy link
Member

pauby commented Dec 9, 2022

@flybyray Did you try what was suggested above?

@flybyray
Copy link

@flybyray Did you try what was suggested above?

The workaround yes.

But for my overall problem it does not help. Choco Test environment is an outdated platform. Need to create another issue or find the relevant for modern tls connections. I cannot download from Amazon cdn. When I install a modern browser like Firefox in test environment then I can use it to download. But internet-explorer or powershell uses old settings which throw errors.

@pauby
Copy link
Member

pauby commented Dec 10, 2022

Choco Test environment is an outdated platform.

It uses Windows Server 2012 R2 deliberately and for many good reasons.

I cannot download from Amazon cdn. When I install a modern browser like Firefox in test environment then I can use it to download. But internet-explorer or powershell uses old settings which throw errors.

The test environment is intended to be used for testing Chocolatey packages.

@flybyray
Copy link

It uses Windows Server 2012 R2 deliberately and for many good reasons.
That maybe true but the powershell script libraries of choco should recognize short comings of this old platform regarding security updates. TLS1.3 should be no problem out of the box. Why a package maintainer should care of this underlying connection issues?

The test environment is intended to be used for testing Chocolatey packages.

I tested package failures reported by choco moderators.
Actually it is about those https://goteleport.com/download/ . It is works without problem on correct modern OS. But not with this old fashioned test environment.

@pauby
Copy link
Member

pauby commented Dec 12, 2022

But not with this old fashioned test environment.

Again, I want to correct you here. This isn't old-fashioned. It's a fully supported server operating system. I know it's semantics, but it's important.

If the package works and the reason it doesn't work is only due to Windows Server 2012 R2, then you can request a Verifier exemption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants