PowerShellGallery icon indicating copy to clipboard operation
PowerShellGallery copied to clipboard

Cannot publish from Azure DevOps

Open apobekiaris opened this issue 6 years ago • 4 comments

I have a pipeline on Azure for publishing my module . For no apparent reason since I made no change to the super simple pipeline script it hangs for several days now.

using the exact same script I can publish the module from my local machine. It always hangs on the message

WARNING: Tag list exceeded 4000 characters and may not be accepted by some Nuget feeds.

$file = "$(System.DefaultWorkingDirectory)\XpandPosh\XpandPosh.psd1"
   $data = Get-Content $file -Raw
   $manifest = Invoke-Expression $data
   $onlineVersion = (Find-Module XpandPosh -Repository PSGallery).Version.ToString()
   if ($manifest.ModuleVersion -ne $onlineVersion){
      New-Item "$(System.DefaultWorkingDirectory)\XpandPosh\Cmdlets\bin" -ItemType Directory
      $publish=dotnet build "$(System.DefaultWorkingDirectory)\XpandPosh\Cmdlets\src\XpandPosh.CmdLets.sln"
      if ($LASTEXITCODE){
          throw   "Fail to publish $assemblyName`r`n`r`n$publish"
      }
      $publish
      Publish-Module -Path $(System.DefaultWorkingDirectory)\XpandPosh -verbose -NugetApiKey $(PSNugetApiKey) -ErrorAction Stop    
   }
##[section]Starting: Publish
==============================================================================
Task         : PowerShell
Description  : Run a PowerShell script on Windows, macOS, or Linux.
Version      : 2.148.0
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
==============================================================================
Generating script.
========================== Starting Command Output ===========================
##[command]"C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'd:\a\_temp\50084464-dc36-4871-8a52-c31db2dbea4e.ps1'"


    Directory: D:\a\1\s\XpandPosh\Cmdlets


Mode                LastWriteTime         Length Name                                                                  
----                -------------         ------ ----                                                                  
d-----         6/5/2019   6:05 AM                bin                                                                   
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for d:\a\1\s\XpandPosh\Cmdlets\src\XpandPosh.Cmdlets\XpandPosh.Cmdlets.csproj...
  Installing NuGet.Versioning 4.2.0.
  Installing NuGet.Frameworks 4.2.0.
  Installing NuGet.Packaging.Core.Types 4.2.0.
  Installing NuGet.Packaging.Core 4.2.0.
  Installing NuGet.Configuration 4.2.0.
  Installing System.Runtime.CompilerServices.Unsafe 4.5.2.
  Installing MimeSharp 1.0.0.
  Installing NuGet.Packaging 4.2.0.
  Installing NuGet.Protocol.Core.Types 4.2.0.
  Installing NuGet.Common 4.2.0.
  Installing JetBrains.Annotations 2019.1.1.
  Installing System.Threading.Tasks.Extensions 4.5.2.
  Installing System.ValueTuple 4.4.0.
  Installing Dynamitey 2.0.9.136.
  Installing NuGet.Protocol.Core.v3 4.2.0.
  Installing System.Reactive 4.1.3.
  Installing morelinq 3.1.0.
  Installing ImpromptuInterface 7.0.1.
  Installing SmartFormat.NET 2.4.2.
  Installing Enums.NET 2.3.2.
  Installing Fasterflect.Netstandard 1.0.9.
  Installing PowerShellAsync 0.1.0.
  Installing DynamicExpressions 1.1.0.
  Installing PowerShellStandard.Library 5.1.0.
  Installing Newtonsoft.Json 12.0.1.
  Installing Octokit 0.32.0.
  Generating MSBuild file d:\a\1\s\XpandPosh\Cmdlets\src\XpandPosh.Cmdlets\obj\XpandPosh.Cmdlets.csproj.nuget.g.props.
  Generating MSBuild file d:\a\1\s\XpandPosh\Cmdlets\src\XpandPosh.Cmdlets\obj\XpandPosh.Cmdlets.csproj.nuget.g.targets.
  Restore completed in 6.33 sec for d:\a\1\s\XpandPosh\Cmdlets\src\XpandPosh.Cmdlets\XpandPosh.Cmdlets.csproj.
  XpandPosh.Cmdlets -> d:\a\1\s\XpandPosh\Cmdlets\bin\XpandPosh.Cmdlets.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:26.20
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 
'False'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 
'False'; IsRegistered = 'True'.
VERBOSE: Publish Location:'https://www.powershellgallery.com/api/v2/package/'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.1 because it is not included in the list of permitted 
versions.
VERBOSE: Loading module from path 'D:\a\1\s\XpandPosh\Cmdlets\bin\XpandPosh.Cmdlets.dll'.
VERBOSE: Loading module from path 'D:\a\1\s\XpandPosh\XpandPosh.psm1'.
VERBOSE: Module 'XpandPosh' was found in 'D:\a\1\s\XpandPosh'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.1 because it is not included in the list of permitted 
versions.
VERBOSE: Loading module from path 
'C:\Users\VssAdministrator\AppData\Local\Temp\535225778\XpandPosh\Cmdlets\bin\XpandPosh.Cmdlets.dll'.
VERBOSE: Loading module from path 'C:\Users\VssAdministrator\AppData\Local\Temp\535225778\XpandPosh\XpandPosh.psm1'.
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/items/psscript' and 
PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 
'https://www.powershellgallery.com/api/v2/items/psscript/FindPackagesById()?id='XpandPosh'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'XpandPosh'.
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='XpandPosh'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'XpandPosh'.
VERBOSE: Performing the operation "Publish-Module" on target "Version '2.9.6' of module 'XpandPosh'".
WARNING: Tag list exceeded 4000 characters and may not be accepted by some Nuget feeds.

apobekiaris avatar Jun 05 '19 06:06 apobekiaris

I am also experiencing hangs on "VERBOSE: Performing the operation "Publish-Module" on target" when executing from Azure Pipelines. I do not experience this hang when executing from local machine. I wonder if this might be Azure infrastructure related issue.

Edit: Ah, it looks like this: https://github.com/PowerShell/PowerShellGet/issues/478

sandersaares avatar Dec 15 '19 07:12 sandersaares

@sandersaares did you manage to solve this one?

Indeed, looks like PowerShell/PowerShellGet#478 and I am struggling right now to package ps core module with several folders/files inside. Commented in the above mentioned issue.

avishnyakov avatar Feb 12 '20 10:02 avishnyakov

@avishnyakov solved might be a too strong word but I worked around it by migrating to use Linux build agents for publishing my PowerShell modules - they do not appear to experience this problem.

sandersaares avatar Feb 12 '20 15:02 sandersaares

And is you tag list maybe not ok? I am publishing to the gallery without any issue. I am using own windows nodes, but publishing from within build agent docker containers.

bormm avatar Oct 23 '20 13:10 bormm