akamac / GitLabProvider

Implements PackageProvider interface for GitLab.
42 stars 8 forks source link

PSGallery Fails to Install: Hash Mismatch #1

Closed michaeltlombardi closed 8 years ago

michaeltlombardi commented 8 years ago

Attempting to install from PSGallery fails. Best I can understand from the error messages is that the hash does not match:

VERBOSE: Hash for package 'GitLabProvider' does not match hash provided from the server.

The command claims it installed, but the provider isn't installed or available on the system.

Full Reproduction

 ¶ Install-PackageProvider -Name gitlabprovider -source psgallery -verbose -Force
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'psgallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='gitlabprovider'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'gitlabprovider'.
VERBOSE: Performing the operation "Install Package" on target "Package 'GitLabProvider' version '1.2.0' from 'PSGallery'".
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'GitLabProvider' with version '1.2.0' from the repository 'https://www.powershellgallery.com/api/v2/'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='GitLabProvider'' for ''.
VERBOSE: InstallPackage' - name='GitLabProvider', version='1.2.0',destination='C:\Users\lombarm\AppData\Local\Temp\879163901'
VERBOSE: DownloadPackage' - name='GitLabProvider', version='1.2.0',destination='C:\Users\lombarm\AppData\Local\Temp\879163901\GitLabProvider\GitLabProvider.nupkg', uri='https://www.powershellgallery.com/api/v2/package/GitLabProvider/1.2.0' VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/GitLabProvider/1.2.0'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/GitLabProvider/1.2.0'.
VERBOSE: Completed downloading 'GitLabProvider'.
VERBOSE: Hash for package 'GitLabProvider' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='GitLabProvider', version='1.2.0',destination='C:\Users\lombarm\AppData\Local\Temp\879163901'
VERBOSE: Module 'GitLabProvider' was installed successfully.
akamac commented 8 years ago

I cannot reproduce. Did you check 'C:\Program Files\WindowsPowerShell\Modules' directory after installing provider?

michaeltlombardi commented 8 years ago

Tested again today, results below:

¶ Install-PackageProvider gitlabprovider -force -verbose -Source PSGallery
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'PSGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='gitlabprovider'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'gitlabprovider'.
VERBOSE: Performing the operation "Install Package" on target "Package 'GitLabProvider' version '1.2.5' from 'PSGallery'.".
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'GitLabProvider' with version '1.2.5' from the repository 'https://www.powershellgallery.com/api/v2/'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='GitLabProvider'' for ''.
VERBOSE: InstallPackage' - name='GitLabProvider', version='1.2.5',destination='C:\Users\username\AppData\Local\Temp\1283757030'
VERBOSE: DownloadPackage' - name='GitLabProvider', version='1.2.5',destination='C:\Users\username\AppData\Local\Temp\1283757030\GitLabProvider\GitLabProvider.nupkg',
uri='https://www.powershellgallery.com/api/v2/package/GitLabProvider/1.2.5'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/GitLabProvider/1.2.5'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/GitLabProvider/1.2.5'.
VERBOSE: Completed downloading 'GitLabProvider'.
VERBOSE: InstallPackageLocal' - name='GitLabProvider', version='1.2.5',destination='C:\Users\username\AppData\Local\Temp\1283757030'
VERBOSE: Catalog file 'GitLabProvider.cat' is not found in the contents of the module 'GitLabProvider' being installed.
VERBOSE: Module 'GitLabProvider' was installed successfully to path 'C:\Program Files\WindowsPowerShell\Modules\GitLabProvider\1.2.5'.

Name                           Version          Source           Summary
----                           -------          ------           -------
GitLabProvider                 1.2.5            PSGallery        GitLab PackageManagement provider
VERBOSE: Importing the package provider gitlabprovider
WARNING: Import-PackageProvider failed. Possibly the provider name is different from the package name 'gitlabprovider'. Try Get-PackageProvider -ListAvailable to identify the associated provider name and run Import-PackageProvider".

¶ Get-PackageProvider -ListAvailable
WARNING: 7zip should be in the PATH

Name                     Version          DynamicOptions
----                     -------          --------------
Chocolatey               2.8.5.130        SkipDependencies, ContinueOnFailure, ExcludeVersion, ForceX86, PackageSaveMode, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFile, SkipValidate
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.206        Destination, ExcludeVersion, Scope, Headers, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFile, SkipValidate
PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, Filter, Tag, Includes, DscResource, RoleCapability, Command, PublishLocation, ScriptSourceL... Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

It looks like maybe GitLab is installed now (no more hash-mismatch), but failing on 7Zip.

After installing 7Zip and updating the path:

¶ gcm 7z

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     7z.exe                                             16.2.0.0   C:\Program Files\7-Zip\7z.exe

¶ Get-PackageProvider -ListAvailable

Name                     Version          DynamicOptions
----                     -------          --------------
Chocolatey               2.8.5.130        SkipDependencies, ContinueOnFailure, ExcludeVersion, ForceX86, PackageSaveMode, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFile, SkipValidate
GitLab                   1.2.5.0          Location, User
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.206        Destination, ExcludeVersion, Scope, Headers, FilterOnTag, Contains, AllowPrereleaseVersions, ConfigFile, SkipValidate
PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, Filter, Tag, Includes, DscResource, RoleCapability, Command, PublishLocation, ScriptSourceL... Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

Since the hash-mismatch seems to be gone, I think this should be closed.