azureazure-devopsoctopus-deployazure-devops-pipelinesoctopus

Azure DevOps - Package Application for Octopus: System.IO.IOException: The parameter is incorrect *


I'm trying to package my application into a zip file, in order to send it to Octopus.

The log looks like this:

2021-05-17T21:15:00.8077153Z D:\a\r1\a>dotnet "C:\hostedtoolcache\windows\octo\7.4.3213\x64\/octo.dll" pack "--id=KFPortal" "--format=Zip" "--version=1.0.19" "--compressionlevel=optimal" "--outFolder=D:\a\r1\a" "--basePath=D:\a\r1\a\_KFPortal-CI\drop\19.zip" "--overwrite=false" 
2021-05-17T21:15:05.3741444Z Setting Zip compression level to Optimal
2021-05-17T21:15:05.3940706Z Packing KFPortal version "1.0.19"...
2021-05-17T21:15:05.4077016Z Saving "KFPortal.1.0.19.zip" to "D:\a\r1\a"...
2021-05-17T21:15:05.4095140Z Adding files from "D:\a\r1\a\_KFPortal-CI\drop\19.zip" matching pattern "**"
2021-05-17T21:15:06.7197552Z 
2021-05-17T21:15:06.7200093Z System.IO.IOException: The parameter is incorrect : 'D:\a\r1\a\_KFPortal-CI\drop\19.zip'
2021-05-17T21:15:06.7200973Z    at System.IO.Enumeration.FileSystemEnumerator`1.GetData()
2021-05-17T21:15:06.7201594Z    at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry()
2021-05-17T21:15:06.7202125Z    at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
2021-05-17T21:15:06.7202656Z    at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
2021-05-17T21:15:06.7203234Z    at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
2021-05-17T21:15:06.7203850Z    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
2021-05-17T21:15:06.7204507Z    at NuGet.Common.PathResolver.PerformWildcardSearch(String basePath, String searchPath, Boolean includeEmptyDirectories, String& normalizedBasePath)
2021-05-17T21:15:06.7205322Z    at NuGet.Common.PathResolver.PerformWildcardSearch(String basePath, String searchPath)
2021-05-17T21:15:06.7206400Z    at Octopus.Cli.Commands.Package.ZipPackageBuilder.BuildPackage(String basePath, IList`1 includes, ManifestMetadata metadata, String outFolder, Boolean overwrite, Boolean verboseInfo) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Commands\Package\ZipPackageBuilder.cs:line 62
2021-05-17T21:15:06.7208001Z    at Octopus.Cli.Commands.Package.PackCommand.<>c__DisplayClass21_0.<Execute>b__0() in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Commands\Package\PackCommand.cs:line 167
2021-05-17T21:15:06.7208829Z    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
2021-05-17T21:15:06.7209379Z --- End of stack trace from previous location where exception was thrown ---
2021-05-17T21:15:06.7209871Z    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
2021-05-17T21:15:06.7210349Z --- End of stack trace from previous location where exception was thrown ---
2021-05-17T21:15:06.7210984Z    at Octopus.Cli.CliProgram.Run(String[] args) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\CliProgram.cs:line 54
2021-05-17T21:15:06.7211497Z Exit code: -3
2021-05-17T21:15:06.7420731Z ##[error]Error: The process 'C:\hostedtoolcache\windows\octo\7.4.3213\x64\octo.cmd' failed with exit code 4294967293
2021-05-17T21:15:06.7437803Z ##[error]Failed to execute octo pack command. The process 'C:\hostedtoolcache\windows\octo\7.4.3213\x64\octo.cmd' failed with exit code 4294967293
2021-05-17T21:15:06.7489404Z ##[section]Finishing: Package KFPortal

And this is my configuration

enter image description here

What am I doing wrong?


Solution

  • I think the real issue is that you did not set the right Sources Path for the project under the hosted agent.

    If your repos's branch has the folder called _KFPortal-CI, then you should set the Sources Path to

    $(System.DefaultWorkingDirectory)/_KFPortal-CI
    

    That is enough and the the drop folder is from artifact task and only exists temporarily in an Artifact Task and it never exists under repos.