PowerShell/PowerShellGallery

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

Xiaoyu-Huang opened this issue · 8 comments

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

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.)

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

Hi,

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