Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.21k stars 3.82k forks source link

The version '1.0.2' of the module 'Az.DataLakeAnalytics' being installed is not catalog signed #22556

Closed Acenl12 closed 1 year ago

Acenl12 commented 1 year ago

Description

When i do: Install-Module Az -Force

I get the following error:

Install-Package: The version '1.0.2' of the module 'Az.DataLakeAnalytics' being installed is not catalog signed. Ensure that the version '1.0.2' of the module
'Az.DataLakeAnalytics' has the catalog file 'Az.DataLakeAnalytics.cat' and signed with the same publisher 'CN=Microsoft Corporation,
O=Microsoft Corporation, L=Redmond, S=Washington, C=US' as the previously-installed module 'Az.DataLakeAnalytics' with version '1.0.2' under    
the directory 'C:\Program Files\WindowsPowerShell\Modules\Az.DataLakeAnalytics\1.0.2'. If you still want to install or update, use
-SkipPublisherCheck parameter.

Issue script & Debug output

DEBUG: 00:01:42.5313997 Catalog file 'Az.DataLakeAnalytics.cat' is not found in the contents of the previously-installed module 'Az.DataLakeAnalytics' with the same name.
DEBUG: 00:01:42.5337262 Using the previously-installed module 'Az.DataLakeAnalytics' with version '1.0.2' under 'C:\Program Files\WindowsPowerShell\Modules\Az.DataLakeAnalytics\1.0.2' for getting the publisher details.
DEBUG: 00:01:42.5346152 Using the 'C:\Program Files\WindowsPowerShell\Modules\Az.DataLakeAnalytics\1.0.2\Az.DataLakeAnalytics.psd1' file for getting the authenticode signature.
DEBUG: 00:01:42.6651610 For publisher validation, using the previously-installed module 'Az.DataLakeAnalytics' with version '1.0.2' under 'C:\Program Files\WindowsPowerShell\Modules\Az.DataLakeAnalytics\1.0.2' with publisher name 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' from root certificate authority 'CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US'. Is this module signed by Microsoft: 'True'.
DEBUG: 00:01:42.6681455 Using the 'Az.DataLakeAnalytics.psd1' file for getting the authenticode signature.
DEBUG: 00:01:42.6721416 For publisher validation, current module 'Az.DataLakeAnalytics' with version '1.0.2' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
DEBUG: 00:01:42.6733665 Previously-installed module publisher: CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US 
DEBUG: 00:01:42.6742102 Current module publisher: 
DEBUG: 00:01:42.6749834 Is previously-installed module signed by Microsoft: True
DEBUG: 00:01:42.6756607 Is current module signed by Microsoft: False
DEBUG: 00:01:42.9201829 PowerShell Script 'PSModule' Function 'Install-Package' returns null.
Install-Package: The version '1.0.2' of the module 'Az.DataLakeAnalytics' being installed is not catalog signed. Ensure that the version '1.0.2' of the module
'Az.DataLakeAnalytics' has the catalog file 'Az.DataLakeAnalytics.cat' and signed with the same publisher 'CN=Microsoft Corporation,
O=Microsoft Corporation, L=Redmond, S=Washington, C=US' as the previously-installed module 'Az.DataLakeAnalytics' with version '1.0.2' under    
the directory 'C:\Program Files\WindowsPowerShell\Modules\Az.DataLakeAnalytics\1.0.2'. If you still want to install or update, use
-SkipPublisherCheck parameter.

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.9.1                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}     
Script     0.13.0                Az.ResourceGraph                    {Search-AzGraph, Get-AzResourceGraphQuery, New-AzResourceGraphQuery, Remo…

Error output

DEBUG: 8:43:47 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.

DEBUG: 8:43:47 PM - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].

   HistoryId: 12

Message        : The version '1.0.2' of the module 'Az.DataLakeAnalytics' being installed is not catalog signed. Ensure that the version        
                 '1.0.2' of the module 'Az.DataLakeAnalytics' has the catalog file 'Az.DataLakeAnalytics.cat' and signed with the same
                 publisher 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' as the previously-installed       
                 module 'Az.DataLakeAnalytics' with version '1.0.2' under the directory 'C:\Program
                 Files\WindowsPowerShell\Modules\Az.DataLakeAnalytics\1.0.2'. If you still want to install or update, use -SkipPublisherCheck   
                 parameter.
StackTrace     : 
Exception      : System.Exception
InvocationInfo : {Install-Package}
Line           :             $installedPackages = PackageManagement\Install-Package @PSBoundParameters

Position       : At C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711 char:34
                 + … talledPackages = PackageManagement\Install-Package @PSBoundParameters
                 +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 12

   HistoryId: 10

Message        : The version '1.0.2' of the module 'Az.DataLakeAnalytics' being installed is not catalog signed. Ensure that the version        
                 '1.0.2' of the module 'Az.DataLakeAnalytics' has the catalog file 'Az.DataLakeAnalytics.cat' and signed with the same
                 publisher 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' as the previously-installed       
                 module 'Az.DataLakeAnalytics' with version '1.0.2' under the directory 'C:\Program
                 Files\WindowsPowerShell\Modules\Az.DataLakeAnalytics\1.0.2'. If you still want to install or update, use -SkipPublisherCheck   
                 parameter.
StackTrace     : 
Exception      : System.Exception
InvocationInfo : {Install-Package}
Line           :             $installedPackages = PackageManagement\Install-Package @PSBoundParameters

Position       : At C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711 char:34
                 + … talledPackages = PackageManagement\Install-Package @PSBoundParameters
                 +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 10

   HistoryId: 7

The Azure PowerShell team is listening, please let us know how we are doing: https://aka.ms/azpssurvey?Q_CHL=ERROR.

DEBUG: 8:43:47 PM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.9.1; CommandName: Resolve-AzError; PSVersion: 7.3.6; IsSuccess: True; Duration: 00:00:00.1264479    
DEBUG: Finish sending metric.
DEBUG: 8:44:09 PM - ResolveError end processing.
isra-fel commented 1 year ago

Hi @Acenl12 we will publish a new version early next month to resolve this issue. At the meantime, please work around it by adding the -SkipPublisherCheck parameter.

BTW I'm wondering have you ever installed the module from somewhere else than the official PowerShell Gallery?

isra-fel commented 1 year ago

On second thought, this error should happen only if the previously installed module was signed... but we never signed Az.DataLakeAnalytics in any official releases. Did you install Azure PowerShell previously via the MSI installer? @Acenl12

A quick way to work around this issue is to make sure you have fully uninstalled Azure PowerShell before installing / updating.