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

PoshRSJob cannot be downloaded due to End of Central Directory record could not be found. #301

Open
3 tasks done
Xiaoyu-Huang opened this issue Jan 16, 2025 · 3 comments
Open
3 tasks done

Comments

@Xiaoyu-Huang
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

I have issues to download PoshRSJob with error End of Central Directory record could not be found. The issue started happening Jan 13.

here is the command
Install-Module -Name PoshRSJob -Force -AllowClobber

I ran below command to see the verbose error
Install-Module -Name PoshRSJob -Verbose

here is the mesage

VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/PoshRSJob/1.7.4.4'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/PoshRSJob/1.7.4.4'.
VERBOSE: Completed downloading 'PoshRSJob'.
VERBOSE: Hash for package 'PoshRSJob' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='PoshRSJob',

Expected behavior

PoshRSJob should be able to download successfully

Actual behavior

PackageManagement\Install-Package : Package 'PoshRSJob' failed to be installed because: End of Central Directory record could not be found.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:9711 char:34
+ ... talledPackages = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (PoshRSJob:String) [Install-Package], Exception
    + FullyQualifiedErrorId : Package '{0}' failed to be installed because: {1},Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

5.1.22621.4391

Visuals

No response

@jberezanski
Copy link

jberezanski commented Jan 18, 2025

I stumbled upon the same problem. Weirdly, if I download the nupkg manually, it seems valid.

As a workaround, I downloaded the module to a local directory and told Install-Module to use that as the source repository:

mkdir C:\TempPackages
Invoke-WebRequest -UseBasicParsing -Uri 'https://www.powershellgallery.com/api/v2/package/PoshRSJob/1.7.4.4' -OutFile 'C:\TempPackages\PoshRSJob.1.7.4.4.nupkg'
Register-PSRepository -Name local -SourceLocation C:\TempPackages -InstallationPolicy Trusted
Install-Module PoshRSJob -Verbose -Scope AllUsers -Repository local

(On the same machine, other modules such as Az, Microsoft.Graph or Posh-ACME install from PSGallery perfectly fine.)

@Xiaoyu-Huang
Copy link
Author

@jberezanski For me, the package installation cmd is part of the deployment script. So I am unable to preinstall the package on machine

@EmilienCourt
Copy link

Hi,

I can confirm I'm affected, using mcr.microsoft.com/powershell:latest in a Docker file.

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

3 participants