Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to publish to the Wiki #84

Closed
johlju opened this issue Jun 19, 2021 · 22 comments · Fixed by #87
Closed

Fails to publish to the Wiki #84

johlju opened this issue Jun 19, 2021 · 22 comments · Fixed by #87
Labels
blocking release The issue or pull request is blocking the next release. Higher priority than label 'High priority'.

Comments

@johlju
Copy link
Member

johlju commented Jun 19, 2021

It seems the latest PR that was merged did not work as expected, it failed to publish to the Wiki when dogfooding itself. It will hopefully be resolved by PR #80.

See error https://dev.azure.com/dsccommunity/DscResource.DocGenerator/_build/results?buildId=4801&view=logs&j=5d0a9c4e-8741-5118-af45-406a30fe661c&t=bda0b158-a237-516f-c1d0-31339587c5b5&l=146

Raw output here (if the link above do not work):

2021-06-19T15:25:33.0578840Z Publishing Wiki content.
2021-06-19T15:25:33.2106611Z ERROR: Exception calling "Start" with "0" argument(s): "No such file or directory"
2021-06-19T15:25:33.2107271Z At /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psm1:1402 char:13
2021-06-19T15:25:33.2108430Z +         if ($process.Start() -eq $true)
2021-06-19T15:25:33.2108871Z +             ~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-19T15:25:33.2151472Z At /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102 char:1

Originally posted by @johlju in #80 (comment)

@johlju johlju added blocking release The issue or pull request is blocking the next release. Higher priority than label 'High priority'. help wanted The issue is up for grabs for anyone in the community. labels Jun 19, 2021
@johlju
Copy link
Member Author

johlju commented Jun 26, 2021

https://dev.azure.com/dsccommunity/DscResource.DocGenerator/_build/results?buildId=4854&view=logs&j=5d0a9c4e-8741-5118-af45-406a30fe661c&t=bda0b158-a237-516f-c1d0-31339587c5b5&l=143

2021-06-26T13:45:53.5310573Z ===============================================================================
2021-06-26T13:45:53.5313104Z 			PUBLISH GITHUB WIKI CONTENT
2021-06-26T13:45:53.5354665Z This task publishes documentation to a GitHub Wiki repository.
2021-06-26T13:45:53.5356775Z -------------------------------------------------------------------------------
2021-06-26T13:45:53.5360691Z   /publish/Publish_GitHub_Wiki_Content
2021-06-26T13:45:53.5363474Z   /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102
2021-06-26T13:45:53.5364689Z 
2021-06-26T13:45:53.5418939Z 	OutputDirectory       = '/home/vsts/work/1/s/output'
2021-06-26T13:45:53.5481116Z 	Built Module Manifest         = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psd1'
2021-06-26T13:45:53.5515675Z 	Built Module Base             = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0'
2021-06-26T13:45:53.5567424Z 	Module Version                = '0.9.0-preview0006'
2021-06-26T13:45:53.5568160Z 	Module Version Folder         = '0.9.0'
2021-06-26T13:45:53.5569129Z 	Pre-release Tag               = 'preview0006'
2021-06-26T13:45:53.5569487Z 	Project Path                  = /home/vsts/work/1/s
2021-06-26T13:45:53.5569805Z 	Project Name                  = DscResource.DocGenerator
2021-06-26T13:45:53.5571644Z 	Source Path                   = /home/vsts/work/1/s/source
2021-06-26T13:45:53.5572612Z 	Built Module Base             = /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0
2021-06-26T13:45:53.5599817Z Set GitHubConfigUserName to dscbot
2021-06-26T13:45:53.5621623Z Set GitHubConfigUserEmail to [email protected]
2021-06-26T13:45:53.7074666Z ERROR: Exception calling "Start" with "0" argument(s): "No such file or directory"
2021-06-26T13:45:53.7075953Z At /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psm1:2393 char:13
2021-06-26T13:45:53.7077240Z +         if ($process.Start() -eq $true)
2021-06-26T13:45:53.7078126Z +             ~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-26T13:45:53.7112605Z At /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102 char:1
2021-06-26T13:45:53.7113339Z + task Publish_GitHub_Wiki_Content {
2021-06-26T13:45:53.7113882Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-26T13:45:53.7144142Z At /home/vsts/work/1/s/build.ps1:211 char:13
2021-06-26T13:45:53.7145201Z +             task $Workflow $WorkflowItem
2021-06-26T13:45:53.7145744Z +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-26T13:45:53.7258901Z Build FAILED. 4 tasks, 1 errors, 0 warnings 00:00:28.4099807
2021-06-26T13:45:53.7864835Z �[91mException: �[0m/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psm1:2393
2021-06-26T13:45:53.7866832Z �[96mLine |
2021-06-26T13:45:53.7868354Z �[96m2393 | �[0m         if (�[96m$process.Start() -eq $true�[0m)
2021-06-26T13:45:53.7869958Z �[96m     | �[91m             ~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-26T13:45:53.7871166Z �[91m�[96m     | �[91mException calling "Start" with "0" argument(s): "No such file
2021-06-26T13:45:53.7872119Z �[96m     | �[91mor directory"
2021-06-26T13:45:53.7872661Z �[0m
2021-06-26T13:45:53.8042780Z ##[error]PowerShell exited with code '1'.

@johlju
Copy link
Member Author

johlju commented Jun 26, 2021

@phbits could you please look into this? It failed after the recent PR too.

@johlju
Copy link
Member Author

johlju commented Jun 26, 2021

I did a debug branch (main...johlju:debug-publish-wiki) to try to reproduce it to help figure this out.

Below is the output for the debug run.

2021-06-26T15:02:55.2831954Z ##[section]Starting: Run Publish_GitHub_Wiki_Content
2021-06-26T15:02:55.3058866Z ==============================================================================
2021-06-26T15:02:55.3059170Z Task         : PowerShell
2021-06-26T15:02:55.3059450Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2021-06-26T15:02:55.3059735Z Version      : 2.186.0
2021-06-26T15:02:55.3059964Z Author       : Microsoft Corporation
2021-06-26T15:02:55.3060271Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2021-06-26T15:02:55.3060623Z ==============================================================================
2021-06-26T15:02:58.3857055Z Generating script.
2021-06-26T15:02:58.4708129Z ========================== Starting Command Output ===========================
2021-06-26T15:02:58.5127605Z ##[command]"C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\5a6a23e0-1607-42c2-8d32-15d63a85381e.ps1'"
2021-06-26T15:02:59.4344532Z [pre-build] Starting Build Init
2021-06-26T15:02:59.4869940Z [pre-build] Prepending 'D:\a\1\s\output\RequiredModules' folder to PSModulePath
2021-06-26T15:02:59.8105641Z [pre-build] Prepending 'D:\a\1\s\output' folder to PSModulePath
2021-06-26T15:02:59.8190864Z [build] Starting build with InvokeBuild.
2021-06-26T15:03:00.2254069Z [build] Parsing defined tasks
2021-06-26T15:03:00.2316395Z [build] Loading Configuration from D:\a\1\s\build.yaml
2021-06-26T15:03:02.8814066Z Importing tasks from module Sampler.GitHubTasks
2021-06-26T15:03:04.2516714Z 	 Loading New-Release.GitHub.build.Sampler.GitHubTasks.ib.tasks...
2021-06-26T15:03:06.3996502Z Importing tasks from module Sampler
2021-06-26T15:03:06.4239043Z 	 Loading Build-Module.ModuleBuilder.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4240371Z 	 Loading Clean.ModuleBuilder.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4241275Z 	 Loading DeployAll.PSDeploy.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4242419Z 	 Loading DscResource.Test.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4243434Z 	 Loading generateHelp.PlatyPS.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4244196Z 	 Loading GuestConfig.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4244916Z 	 Loading Invoke-Pester.pester.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4246248Z 	 Loading JaCoCo.coverage.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4246927Z 	 Loading release.module.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4247637Z 	 Loading Set-BuildEnvironment.BuildHelpers.build.Sampler.ib.tasks...
2021-06-26T15:03:06.4248299Z 	 Loading Set-SamplerTaskVariable...
2021-06-26T15:03:07.8687715Z Adding Workflow from configuration:
2021-06-26T15:03:07.9577723Z   +-> publish
2021-06-26T15:03:07.9695737Z   +-> pack
2021-06-26T15:03:07.9762363Z   +-> build
2021-06-26T15:03:07.9764016Z   +-> test
2021-06-26T15:03:07.9764904Z   +-> merge
2021-06-26T15:03:07.9767591Z   +-> .
2021-06-26T15:03:07.9836173Z   +-> hqrmtest
2021-06-26T15:03:07.9843486Z [build] Executing requested workflow: Publish_GitHub_Wiki_Content
2021-06-26T15:03:08.0385219Z Build Publish_GitHub_Wiki_Content D:\a\1\s\build.ps1
2021-06-26T15:03:08.0393899Z Redefined task '.'.
2021-06-26T15:03:08.0670953Z 
2021-06-26T15:03:08.0676810Z ===============================================================================
2021-06-26T15:03:08.0821867Z 			PUBLISH GITHUB WIKI CONTENT
2021-06-26T15:03:08.1020313Z This task publishes documentation to a GitHub Wiki repository.
2021-06-26T15:03:08.1022320Z -------------------------------------------------------------------------------
2021-06-26T15:03:08.1023857Z   /Publish_GitHub_Wiki_Content
2021-06-26T15:03:08.1134104Z   D:\a\1\s\source\tasks\Publish_GitHub_Wiki_Content.build.ps1:102
2021-06-26T15:03:08.1134398Z 
2021-06-26T15:03:08.1311750Z 	OutputDirectory       = 'D:\a\1\s\output'
2021-06-26T15:03:08.1606952Z 	Built Module Manifest         = 'D:\a\1\s\output\DscResource.DocGenerator\0.9.0\DscResource.DocGenerator.psd1'
2021-06-26T15:03:08.1631273Z 	Built Module Base             = 'D:\a\1\s\output\DscResource.DocGenerator\0.9.0'
2021-06-26T15:03:08.1815087Z 	Module Version                = '0.9.0-debug'
2021-06-26T15:03:08.1833571Z 	Module Version Folder         = '0.9.0'
2021-06-26T15:03:08.1845630Z 	Pre-release Tag               = 'debug'
2021-06-26T15:03:08.1868880Z 	Project Path                  = D:\a\1\s
2021-06-26T15:03:08.1874445Z 	Project Name                  = DscResource.DocGenerator
2021-06-26T15:03:08.1886378Z 	Source Path                   = D:\a\1\s\source
2021-06-26T15:03:08.1935533Z 	Built Module Base             = D:\a\1\s\output\DscResource.DocGenerator\0.9.0
2021-06-26T15:03:08.1936301Z Set GitHubConfigUserName to dscbot
2021-06-26T15:03:08.1936827Z Set GitHubConfigUserEmail to [email protected]
2021-06-26T15:03:09.1856708Z DEBUG: Invoking Git 'remote get-url origin'.
2021-06-26T15:03:09.2654584Z 	Wiki Output Path              = D:\a\1\s\output\WikiContent
2021-06-26T15:03:09.2657404Z Publishing Wiki content.
2021-06-26T15:03:09.2728800Z VERBOSE: Creating a temporary working directory.
2021-06-26T15:03:09.2872287Z VERBOSE: Cloning the Wiki Git Repository 'https://github.com/dsccommunity/DscResource.DocGenerator.wiki.git'.
2021-06-26T15:03:09.2880544Z DEBUG: Invoking Git 'clone https://github.com/dsccommunity/DscResource.DocGenerator.wiki.git C:\Users\VssAdministrator\AppData\Local\Temp\eocrxt2p.1v5 --quiet'.
2021-06-26T15:03:09.4155084Z VERBOSE: Failed to clone wiki. Ensure the feature is enabled and the first page has been created.
2021-06-26T15:03:09.4170201Z DEBUG: Wiki clone URL 'https://github.com/dsccommunity/DscResource.DocGenerator.wiki.git'
2021-06-26T15:03:09.4188091Z DEBUG: 
2021-06-26T15:03:09.4206652Z DEBUG: 
2021-06-26T15:03:09.4219033Z DEBUG: git exit code: '-1'
2021-06-26T15:03:09.6473614Z ERROR: The process cannot access the file 'C:\Users\VssAdministrator\AppData\Local\Temp\eocrxt2p.1v5' because it is being used by another process.
2021-06-26T15:03:09.6513057Z At D:\a\1\s\output\DscResource.DocGenerator\0.9.0\DscResource.DocGenerator.psm1:3080 char:9
2021-06-26T15:03:09.6529657Z +         Remove-Item -Path $tempPath -Recurse -Force
2021-06-26T15:03:09.6530076Z +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-26T15:03:09.6558876Z At D:\a\1\s\source\tasks\Publish_GitHub_Wiki_Content.build.ps1:102 char:1
2021-06-26T15:03:09.6686548Z + task Publish_GitHub_Wiki_Content {
2021-06-26T15:03:09.6687199Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-26T15:03:09.6712262Z Build FAILED. 1 tasks, 1 errors, 0 warnings 00:00:09.7322536
2021-06-26T15:03:09.7040205Z Remove-Item : The process cannot access the file 'C:\Users\VssAdministrator\AppData\Local\Temp\eocrxt2p.1v5' because it is being used by another process.
2021-06-26T15:03:09.7058430Z At D:\a\1\s\output\DscResource.DocGenerator\0.9.0\DscResource.DocGenerator.psm1:3080 char:9
2021-06-26T15:03:09.7059716Z +         Remove-Item -Path $tempPath -Recurse -Force
2021-06-26T15:03:09.7060199Z +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-26T15:03:09.7065908Z + CategoryInfo          : WriteError: (C:\Users\VssAdminis…l\Temp\eocrxt2p.1v5:DirectoryInfo) [Remove-Item], IOException
2021-06-26T15:03:09.7066660Z + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
2021-06-26T15:03:09.8197796Z ##[error]PowerShell exited with code '1'.
2021-06-26T15:03:09.9003606Z ##[section]Finishing: Run Publish_GitHub_Wiki_Content

phbits added a commit to phbits/DscResource.DocGenerator that referenced this issue Jun 27, 2021
@phbits phbits mentioned this issue Jun 27, 2021
8 tasks
@johlju johlju closed this as completed in #87 Jul 6, 2021
johlju pushed a commit that referenced this issue Jul 6, 2021
- `Invoke-Git`
  - Set `$TimeOut` to Milliseconds (issue 84)
  - `git` commands no longer use `--quiet` to populate returned object.
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Jul 6, 2021
@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

With the latest PR #87 this still fails:

2021-07-06T18:52:05.5037492Z ===============================================================================
2021-07-06T18:52:05.5068620Z 			PUBLISH GITHUB WIKI CONTENT
2021-07-06T18:52:05.5125235Z This task publishes documentation to a GitHub Wiki repository.
2021-07-06T18:52:05.5129473Z -------------------------------------------------------------------------------
2021-07-06T18:52:05.5134451Z   /publish/Publish_GitHub_Wiki_Content
2021-07-06T18:52:05.5142505Z   /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102
2021-07-06T18:52:05.5146142Z 
2021-07-06T18:52:05.5206664Z 	OutputDirectory       = '/home/vsts/work/1/s/output'
2021-07-06T18:52:05.5278727Z 	Built Module Manifest         = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psd1'
2021-07-06T18:52:05.5324829Z 	Built Module Base             = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0'
2021-07-06T18:52:05.5390841Z 	Module Version                = '0.9.0-preview0007'
2021-07-06T18:52:05.5393365Z 	Module Version Folder         = '0.9.0'
2021-07-06T18:52:05.5396875Z 	Pre-release Tag               = 'preview0007'
2021-07-06T18:52:05.5399187Z 	Project Path                  = /home/vsts/work/1/s
2021-07-06T18:52:05.5399836Z 	Project Name                  = DscResource.DocGenerator
2021-07-06T18:52:05.5400481Z 	Source Path                   = /home/vsts/work/1/s/source
2021-07-06T18:52:05.5400874Z 	Built Module Base             = /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0
2021-07-06T18:52:05.5428473Z Set GitHubConfigUserName to dscbot
2021-07-06T18:52:05.5449744Z Set GitHubConfigUserEmail to [email protected]
2021-07-06T18:52:05.6995145Z ERROR: Exception calling "Start" with "0" argument(s): "No such file or directory"
2021-07-06T18:52:05.6996061Z At /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psm1:2393 char:13
2021-07-06T18:52:05.6997888Z +         if ($process.Start() -eq $true)
2021-07-06T18:52:05.6998374Z +             ~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T18:52:05.7038027Z At /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102 char:1
2021-07-06T18:52:05.7038659Z + task Publish_GitHub_Wiki_Content {
2021-07-06T18:52:05.7039076Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T18:52:05.7077844Z At /home/vsts/work/1/s/build.ps1:211 char:13
2021-07-06T18:52:05.7078693Z +             task $Workflow $WorkflowItem
2021-07-06T18:52:05.7079120Z +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T18:52:05.7206946Z Build FAILED. 4 tasks, 1 errors, 0 warnings 00:00:39.2865866
2021-07-06T18:52:05.7963590Z �[91mException: �[0m/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psm1:2393
2021-07-06T18:52:05.7967747Z �[96mLine |
2021-07-06T18:52:05.7968420Z �[96m2393 | �[0m         if (�[96m$process.Start() -eq $true�[0m)
2021-07-06T18:52:05.7968930Z �[96m     | �[91m             ~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T18:52:05.7969482Z �[91m�[96m     | �[91mException calling "Start" with "0" argument(s): "No such file
2021-07-06T18:52:05.7969988Z �[96m     | �[91mor directory"
2021-07-06T18:52:05.7970374Z �[0m
2021-07-06T18:52:05.8232566Z ##[error]PowerShell exited with code '1'.
2021-07-06T18:52:05.8325240Z ##[section]Finishing: Publish Release

@johlju johlju reopened this Jul 6, 2021
@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

@phbits the lates changes did not help. 😕 Do you have tim to look at it again? 🙂

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

It seems it doesn't ger past the first git command.

$gitRemoteResult = Invoke-Git -WorkingDirectory $BuildRoot `
-Arguments @( 'remote', 'get-url', 'origin' )

Because it never outputs this:

$wikiOutputPath = Join-Path -Path $OutputDirectory -ChildPath $WikiContentFolderName
"`tWiki Output Path = $wikiOutputPath"

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

@phbits it seems the error is generated when running on a Linux build worker. It works better on a Windows build worker, but fails with another error there.

Linux:

2021-07-06T19:40:21.6652942Z ===============================================================================
2021-07-06T19:40:21.6685274Z 			PUBLISH GITHUB WIKI CONTENT
2021-07-06T19:40:21.7165480Z This task publishes documentation to a GitHub Wiki repository.
2021-07-06T19:40:21.7167327Z -------------------------------------------------------------------------------
2021-07-06T19:40:21.7169876Z   /Publish_GitHub_Wiki_Content
2021-07-06T19:40:21.7179844Z   /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102
2021-07-06T19:40:21.7182395Z 
2021-07-06T19:40:21.7338727Z 	OutputDirectory       = '/home/vsts/work/1/s/output'
2021-07-06T19:40:21.7466994Z 	Built Module Manifest         = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psd1'
2021-07-06T19:40:21.7519198Z 	Built Module Base             = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0'
2021-07-06T19:40:21.7725385Z 	Module Version                = '0.9.0-debug'
2021-07-06T19:40:21.7726529Z 	Module Version Folder         = '0.9.0'
2021-07-06T19:40:21.7727163Z 	Pre-release Tag               = 'debug'
2021-07-06T19:40:21.7727594Z 	Project Path                  = /home/vsts/work/1/s
2021-07-06T19:40:21.7728030Z 	Project Name                  = DscResource.DocGenerator
2021-07-06T19:40:21.7732460Z 	Source Path                   = /home/vsts/work/1/s/source
2021-07-06T19:40:21.7733050Z 	Built Module Base             = /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0
2021-07-06T19:40:21.7789617Z Set GitHubConfigUserName to dscbot
2021-07-06T19:40:21.7823830Z Set GitHubConfigUserEmail to [email protected]
2021-07-06T19:40:22.8076785Z DEBUG: Invoking Git 'remote get-url origin'.
2021-07-06T19:40:22.9270920Z ERROR: Exception calling "Start" with "0" argument(s): "No such file or directory"
2021-07-06T19:40:22.9272122Z At /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psm1:2393 char:13
2021-07-06T19:40:22.9273547Z +         if ($process.Start() -eq $true)
2021-07-06T19:40:22.9274208Z +             ~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T19:40:22.9385429Z At /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102 char:1
2021-07-06T19:40:22.9386300Z + task Publish_GitHub_Wiki_Content {
2021-07-06T19:40:22.9387177Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T19:40:22.9543974Z Build FAILED. 1 tasks, 1 errors, 0 warnings 00:00:05.3833502
2021-07-06T19:40:23.0529635Z �[91mException: �[0m/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psm1:2393
2021-07-06T19:40:23.0530663Z �[96mLine |
2021-07-06T19:40:23.0531285Z �[96m2393 | �[0m         if (�[96m$process.Start() -eq $true�[0m)
2021-07-06T19:40:23.0531950Z �[96m     | �[91m             ~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T19:40:23.0532726Z �[91m�[96m     | �[91mException calling "Start" with "0" argument(s): "No such file
2021-07-06T19:40:23.0533433Z �[96m     | �[91mor directory"
2021-07-06T19:40:23.0533884Z �[0m
2021-07-06T19:40:23.7704620Z ##[error]PowerShell exited with code '1'.
2021-07-06T19:40:23.7732001Z ##[section]Finishing: Run Publish_GitHub_Wiki_Content'

Windows:

2021-07-06T19:04:01.7151028Z ===============================================================================
2021-07-06T19:04:01.7185363Z 			PUBLISH GITHUB WIKI CONTENT
2021-07-06T19:04:01.7459759Z This task publishes documentation to a GitHub Wiki repository.
2021-07-06T19:04:01.7469816Z -------------------------------------------------------------------------------
2021-07-06T19:04:01.7477509Z   /Publish_GitHub_Wiki_Content
2021-07-06T19:04:01.7489730Z   D:\a\1\s\source\tasks\Publish_GitHub_Wiki_Content.build.ps1:102
2021-07-06T19:04:01.7492784Z 
2021-07-06T19:04:01.7631369Z 	OutputDirectory       = 'D:\a\1\s\output'
2021-07-06T19:04:01.7941295Z 	Built Module Manifest         = 'D:\a\1\s\output\DscResource.DocGenerator\0.9.0\DscResource.DocGenerator.psd1'
2021-07-06T19:04:01.7980791Z 	Built Module Base             = 'D:\a\1\s\output\DscResource.DocGenerator\0.9.0'
2021-07-06T19:04:01.8203922Z 	Module Version                = '0.9.0-debug'
2021-07-06T19:04:01.8205018Z 	Module Version Folder         = '0.9.0'
2021-07-06T19:04:01.8207230Z 	Pre-release Tag               = 'debug'
2021-07-06T19:04:01.8210310Z 	Project Path                  = D:\a\1\s
2021-07-06T19:04:01.8213483Z 	Project Name                  = DscResource.DocGenerator
2021-07-06T19:04:01.8223328Z 	Source Path                   = D:\a\1\s\source
2021-07-06T19:04:01.8226576Z 	Built Module Base             = D:\a\1\s\output\DscResource.DocGenerator\0.9.0
2021-07-06T19:04:01.8348983Z Set GitHubConfigUserName to dscbot
2021-07-06T19:04:01.8375476Z Set GitHubConfigUserEmail to [email protected]
2021-07-06T19:04:02.8329322Z DEBUG: Invoking Git 'remote get-url origin'.
2021-07-06T19:04:02.9476312Z 	Wiki Output Path              = D:\a\1\s\output\WikiContent
2021-07-06T19:04:02.9482030Z Publishing Wiki content.
2021-07-06T19:04:02.9649653Z VERBOSE: Creating a temporary working directory.
2021-07-06T19:04:02.9793158Z VERBOSE: Cloning the Wiki Git Repository 'https://github.com/dsccommunity/DscResource.DocGenerator.wiki.git'.
2021-07-06T19:04:02.9820832Z DEBUG: Invoking Git 'clone https://github.com/dsccommunity/DscResource.DocGenerator.wiki.git C:\Users\VssAdministrator\AppData\Local\Temp\jclel43e.skm'.
2021-07-06T19:04:04.0955680Z VERBOSE: Copying Wiki files from 'D:\a\1\s\output\WikiContent'.
2021-07-06T19:04:04.0989150Z VERBOSE: Copying file 'Home.md' to the Wiki.
2021-07-06T19:04:04.1108888Z VERBOSE: Generating Wiki Sidebar '_Sidebar.md'.
2021-07-06T19:04:04.1182074Z VERBOSE: 	Adding file 'Home.md' to the Wiki Sidebar.
2021-07-06T19:04:04.1312958Z VERBOSE: Configuring local Git settings.
2021-07-06T19:04:04.1325344Z DEBUG: Invoking Git 'config --local user.email [email protected]'.
2021-07-06T19:04:04.1892943Z DEBUG: Invoking Git 'config --local user.name dscbot'.
2021-07-06T19:04:04.2500365Z DEBUG: Invoking Git 'remote set-url origin https://dscbot:***@github.com/dsccommunity/DscResource.DocGenerator.wiki.git'.
2021-07-06T19:04:04.3081983Z VERBOSE: Adding the Wiki Content to the Git Repository.
2021-07-06T19:04:04.3104635Z DEBUG: Invoking Git 'add *'.
2021-07-06T19:04:04.6716062Z VERBOSE: Committing the changes to the Repository and adding build tag '0.9.0-debug'.
2021-07-06T19:04:04.6740148Z DEBUG: Invoking Git 'commit --message "Updating Wiki with the content for module version '0.9.0-debug'."'.
2021-07-06T19:04:04.8458770Z DEBUG: Invoking Git 'tag --annotate 0.9.0-debug --message 0.9.0-debug'.
2021-07-06T19:04:04.9322649Z VERBOSE: Pushing the updated Repository to the Git Wiki.
2021-07-06T19:04:04.9336819Z DEBUG: Invoking Git 'push origin'.
2021-07-06T19:04:07.3501743Z DEBUG: Invoking Git 'push origin 0.9.0-debug'.
2021-07-06T19:04:09.8494879Z VERBOSE: Publish Wiki Content complete.
2021-07-06T19:04:09.9423783Z ERROR: Cannot remove the item at 'C:\Users\VssAdministrator\AppData\Local\Temp\jclel43e.skm' because it is in use.
2021-07-06T19:04:09.9424990Z At D:\a\1\s\output\DscResource.DocGenerator\0.9.0\DscResource.DocGenerator.psm1:3080 char:9
2021-07-06T19:04:09.9425565Z +         Remove-Item -Path $tempPath -Recurse -Force
2021-07-06T19:04:09.9426012Z +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T19:04:09.9570362Z At D:\a\1\s\source\tasks\Publish_GitHub_Wiki_Content.build.ps1:102 char:1
2021-07-06T19:04:09.9571179Z + task Publish_GitHub_Wiki_Content {
2021-07-06T19:04:09.9576026Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T19:04:09.9773464Z Build FAILED. 1 tasks, 1 errors, 0 warnings 00:00:20.7230275
2021-07-06T19:04:10.0145328Z Remove-Item : Cannot remove the item at 'C:\Users\VssAdministrator\AppData\Local\Temp\jclel43e.skm' because it is in use.
2021-07-06T19:04:10.0146638Z At D:\a\1\s\output\DscResource.DocGenerator\0.9.0\DscResource.DocGenerator.psm1:3080 char:9
2021-07-06T19:04:10.0147638Z +         Remove-Item -Path $tempPath -Recurse -Force
2021-07-06T19:04:10.0149057Z +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-06T19:04:10.0149928Z + CategoryInfo          : InvalidOperation: (:) [Remove-Item], PSInvalidOperationException
2021-07-06T19:04:10.0151941Z + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.RemoveItemCommand
2021-07-06T19:04:10.1607640Z ##[error]PowerShell exited with code '1'.
2021-07-06T19:04:10.2252153Z ##[section]Finishing: Run Publish_GitHub_Wiki_Content

@johlju johlju added the help wanted The issue is up for grabs for anyone in the community. label Jul 6, 2021
@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

So first issue on Linux is that we try to start git.exe which obviously does not work, sending in a PR that changes to just git.

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

And the error on Windows might be a left over Set-Location that keeps the folder we want to remove locked. Sent in fix in PR #89.

@phbits
Copy link
Contributor

phbits commented Jul 6, 2021

Wow, you're fast! Just got a debug pipeline up and running only to come back and find you've fixed it! 😲

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

I had some time to kill in front of the TV. Not sure I fixed anything yet. 😉 But first issue should be solved though, not sure about the other one.
Please try them out in your pipeline to see if it works. Or if there is other issues. 🙂

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

Azure Pipelines is extremely slow tonight so take a while for things to run. :/

@phbits
Copy link
Contributor

phbits commented Jul 6, 2021

Applied the debug pipeline you setup earlier to the new PR branch and I'm at >15min and counting for build & package. :sigh:

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

Yeah it seems it is getting worse. The first build phase took 22 minutes, and the tests have not even started after 35 minutes.

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

I might not be able to merge the PR i sent in before I need to go to sleep, if so I merge it tomorrow morning.

@johlju
Copy link
Member Author

johlju commented Jul 6, 2021

I merged the changes so you can test the pipeline with all changes in main now.

@phbits
Copy link
Contributor

phbits commented Jul 6, 2021

Wahoo, that worked! Great job! 🥳

MS posted an Azure Pipelines incident: https://status.dev.azure.com/_event/249267909

@johlju
Copy link
Member Author

johlju commented Jul 7, 2021

@phbits it seems there are still issues left (or at least one) because the WIki was not updated. The task passed, but the Wiki did not update the version number or the latest commit is not yesterday. See here: https://github.com/dsccommunity/DscResource.DocGenerator/wiki

@johlju
Copy link
Member Author

johlju commented Jul 7, 2021

I added issue #90 which could help determine what is going on? Maybe we need error handling throughout for all the git calls?

@phbits if you have time to look into this I would appreciate it, I won't have time until next week.

@johlju
Copy link
Member Author

johlju commented Jul 8, 2021

I had a few minute to look this over. Seems we have a bug in this row. The last $tempPath should be $tempPath.FullName.

$gitCloneResult = Invoke-Git -WorkingDirectory $tempPath.FullName `
-Arguments @( 'clone', $wikiRepoName, $tempPath )

I will send in a PR shortly. I think we should make it easier and just set $tempPath.FullName to a variable and use that throughout instead.

@johlju
Copy link
Member Author

johlju commented Jul 8, 2021

So that was not it... Added debug output to the pipeline by adding the following to build.yml

DscResource.DocGenerator:
  Publish_GitHub_Wiki_Content:
    Debug: true

It shows that the URL contain a newline (see below) - so I have sent in another PR that resolves this in Invoke-Git by removing any trailing new lines.

2021-07-08T12:24:48.4223492Z ===============================================================================
2021-07-08T12:24:48.4224107Z 			PUBLISH GITHUB WIKI CONTENT
2021-07-08T12:24:48.4253782Z This task publishes documentation to a GitHub Wiki repository.
2021-07-08T12:24:48.4255649Z -------------------------------------------------------------------------------
2021-07-08T12:24:48.4258764Z   /publish/Publish_GitHub_Wiki_Content
2021-07-08T12:24:48.4262536Z   /home/vsts/work/1/s/source/tasks/Publish_GitHub_Wiki_Content.build.ps1:102
2021-07-08T12:24:48.4263038Z 
2021-07-08T12:24:48.4398182Z Running task with debug information.
2021-07-08T12:24:48.4406899Z 	OutputDirectory       = '/home/vsts/work/1/s/output'
2021-07-08T12:24:48.4484950Z 	Built Module Manifest         = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0/DscResource.DocGenerator.psd1'
2021-07-08T12:24:48.4524562Z 	Built Module Base             = '/home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0'
2021-07-08T12:24:48.4621784Z 	Module Version                = '0.9.0-preview0012'
2021-07-08T12:24:48.4623611Z 	Module Version Folder         = '0.9.0'
2021-07-08T12:24:48.4626290Z 	Pre-release Tag               = 'preview0012'
2021-07-08T12:24:48.4626659Z 	Project Path                  = /home/vsts/work/1/s
2021-07-08T12:24:48.4634554Z 	Project Name                  = DscResource.DocGenerator
2021-07-08T12:24:48.4634917Z 	Source Path                   = /home/vsts/work/1/s/source
2021-07-08T12:24:48.4635302Z 	Built Module Base             = /home/vsts/work/1/s/output/DscResource.DocGenerator/0.9.0
2021-07-08T12:24:48.4894687Z Set GitHubConfigUserName to dscbot
2021-07-08T12:24:48.4920399Z Set GitHubConfigUserEmail to [email protected]
2021-07-08T12:24:48.6036135Z DEBUG: Invoking Git 'remote get-url origin'.
2021-07-08T12:24:48.6225568Z DEBUG: Invoke-Git: git exit code: '0'
2021-07-08T12:24:48.6244045Z DEBUG: Invoke-Git: git standard output: 'https://github.com/dsccommunity/DscResource.DocGenerator
2021-07-08T12:24:48.6244973Z '
2021-07-08T12:24:48.6261583Z DEBUG: Invoke-Git: git standard error: ''
2021-07-08T12:24:48.6271418Z 	Wiki Output Path              = /home/vsts/work/1/s/output/WikiContent
2021-07-08T12:24:48.6284809Z Publishing Wiki content.
2021-07-08T12:24:48.6384593Z VERBOSE: Creating a temporary working directory.
2021-07-08T12:24:48.6481513Z VERBOSE: Cloning the Wiki Git Repository 'https://github.com/dsccommunity/DscResource.DocGenerator
2021-07-08T12:24:48.6482601Z .wiki.git'.
2021-07-08T12:24:48.6493862Z DEBUG: Invoking Git 'clone https://github.com/dsccommunity/DscResource.DocGenerator
2021-07-08T12:24:48.6495142Z .wiki.git /tmp/05u3lcm0.ha0'.
2021-07-08T12:24:48.6618164Z DEBUG: Invoke-Git: git exit code: '128'
2021-07-08T12:24:48.6620262Z DEBUG: Invoke-Git: git standard output: ''
2021-07-08T12:24:48.6622098Z DEBUG: Invoke-Git: git standard error: 'Cloning into '/tmp/05u3lcm0.ha0'...
2021-07-08T12:24:48.6622853Z warning: url contains a newline in its path component: https://github.com/dsccommunity/DscResource.DocGenerator
2021-07-08T12:24:48.6623420Z .wiki.git/
2021-07-08T12:24:48.6623945Z fatal: credential url cannot be parsed: https://github.com/dsccommunity/DscResource.DocGenerator
2021-07-08T12:24:48.6624461Z .wiki.git/
2021-07-08T12:24:48.6625000Z '
2021-07-08T12:24:48.6636221Z VERBOSE: Failed to clone wiki. Ensure the feature is enabled and the first page has been created.
2021-07-08T12:24:48.6646494Z DEBUG: Wiki clone URL 'https://github.com/dsccommunity/DscResource.DocGenerator
2021-07-08T12:24:48.6647744Z .wiki.git'
2021-07-08T12:24:48.6660497Z DEBUG: 
2021-07-08T12:24:48.6668083Z DEBUG: 
2021-07-08T12:24:48.6669930Z DEBUG: git exit code: '128'
2021-07-08T12:24:48.6687004Z Done /publish/Publish_GitHub_Wiki_Content 00:00:00.2491240

@johlju
Copy link
Member Author

johlju commented Jul 8, 2021

The lates fix seems to have solved the issue, it now published the wiki, a new commit was pushed and the version number was changed on the first page.
https://github.com/dsccommunity/DscResource.DocGenerator/wiki

@phbits thanks for the time you put on this! Appreciate very much your help to resolve this. 🙂 We still need to add error handling so the task fail, but we can track and fix that in issue #90.

It is hard to find these error in the review, and without proper integration tests they are not caught - but not sure how to create "real-world" integration test. 🤔

@johlju johlju closed this as completed Jul 8, 2021
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking release The issue or pull request is blocking the next release. Higher priority than label 'High priority'.
Projects
None yet
2 participants