MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
186 stars 62 forks source link

[MacOs] Error on task download (sometimes) #108

Closed Panda-Sharp closed 2 years ago

Panda-Sharp commented 2 years ago

Sometimes with a macos agent, the pipeline task fail on download with the following error

Starting download azuredevops-export-wiki-osx to /Users/runner/work/_temp
##[error]Forbidden
##[error]Forbidden
(node:1745) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, chmod '/Users/runner/work/_temp/azuredevops-export-wiki-osx'
Downloaded executable /Users/runner/work/_temp/azuredevops-export-wiki-osx
    at Object.chmodSync (fs.js:1027:3)
Set execute permission on executable /Users/runner/work/_temp/azuredevops-export-wiki-osx
    at /Users/runner/work/_tasks/WikiPdfExportTask_48d40d27-32e1-460e-8ea6-0dfb48abdd6f/2.6.2/ExportFunctions.js:135:20
    at Generator.next (<anonymous>)
    at fulfilled (/Users/runner/work/_tasks/WikiPdfExportTask_48d40d27-32e1-460e-8ea6-0dfb48abdd6f/2.6.2/ExportFunctions.js:5:58)
(node:1745) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1745) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is there any hope for a fix? thanks

MaxMelcher commented 2 years ago

The extension is developed by @rfennell - can you please create an issue in his repo? https://github.com/rfennell/AzurePipelines

rfennell commented 2 years ago

I have seen this problem in my testing. It appears to be an issue with the MAC Agents being unable to download the PDF tool from GitHub, a retry usually fixes it.

The most reliable workaround is to place the azuredevops-export-wiki-osx MAC exe in your own repo and avoid the need to download it from GitHub each time.

FYI: I can't ship the EXE within the Azure DevOps task as it makes the package too big

MaxMelcher commented 2 years ago

@Panda-Sharp is there a specific need to run the conversion in the Mac agent or can you can a second job with windows/Unix?

rfennell commented 2 years ago

No nothing special about running the process on a MAC or any other OS. It is the same code, the only difference being a switch statement to make sure the correct EXE is downloaded and run.

You can do all the rest of your CI/CD process with a MAC agent, but have a job running on Windows/Unix that does the PDF converison.

Panda-Sharp commented 2 years ago

Nothing special, just simplicity, if it would be possible/easy to fix it, would be really nice, if there is no hope, I'll run it on a different job with different agent 🙂

Edit: From the gh app i didn't see your first 2 comments, i think i will first experiment with a retry or download the exe myself. Sorry for creating the issue in tbe wrong repo 😅

Thanks all

MaxMelcher commented 2 years ago

Thanks

rfennell commented 1 year ago

Tracked in https://github.com/rfennell/AzurePipelines/issues/1440

MaxMelcher commented 1 year ago

thanks @rfennell - whats the maximum file size to include it into your task?

rfennell commented 1 year ago

The max size is only 25Mb for custom extensions, so way too small for most tools to be included. Space for just scripts