TechDocs URL Reader Zip Archive Not In Expected State using Azure DevOps Server 2020
See original GitHub issueExpected Behavior
TechDocs should still generate using the URL Reader method with Azure DevOps Server 2020
Current Behavior
Once Issue #4357 has been fixed you’ll now get the following error(s) when opening a Docs site using the URL Reader method:
In the UI:
Error: Failed to generate docs from C:\Users\UserName\AppData\Local\Temp\backstage-OCDxtp into C:\Users\UserName\AppData\Local\Temp\techdocs-tmp-6bZilb with error Docker container returned a non-zero exit code (1) at TechdocsGenerator.run (webpack-internal:///…/techdocs-common/src/stages/generate/techdocs.ts:120:13) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async DocsBuilder.build (webpack-internal:///…/…/plugins/techdocs-backend/src/DocsBuilder/builder.ts:94:5) at async eval (webpack-internal:///…/…/plugins/techdocs-backend/src/service/router.ts:151:13)
Then in the backend logs there is also the following messages:
techdocs debug Failed to generate docs from C:\Users\UserName\AppData\Local\Temp\backstage-OCDxtp into C:\Users\UserName\AppData\Local\Temp\techdocs-tmp-6bZilb type=plugin techdocs debug Build failed with error: {“status”:“Pulling from spotify/techdocs”,“id”:“latest”},{“status”:“Digest: sha256:915bbe59e2602882674d8308ff1211c0c7ab8bdb1a48121df22c9c1abc6a55b1”} {“status”:“Status: Image is up to date for spotify/techdocs:latest”},ERROR - Config value: ‘docs_dir’. Error: The path /content/docs isn’t an existing directory.
Possible Solution
Upon walking through the code it looks like the Zip Archive downloaded for the Azure DevOps Server 2020 REST API isn’t in the expected format. Removing the stripTopDirectory function and just using the entry.path as the arg for 'getInnerPath` from this line fixes the issue:
Here is a sample archive of a repo downloaded using the Azure DevOps Server 2020 REST API: SampleRepo.zip
Steps to Reproduce
These steps assume that you are using Azure DevOps Server 2020 and that Issue #4357 has been fixed.
- Create a valid
catalog-info.yamlfile and add it to your repo - In your catalog-info file add a
backstage.io/techdocs-refannotation using the URL Reader format for it’s value:url:https://ados-servername/organization/project/_git/repository - Make sure you have a
\docsfolder with at least anindex.md - Add a
mkdocs.ymlfile in the root of you repo with this as the body of the file:
site_name: 'example-docs'
nav:
- Home: index.md
plugins:
- techdocs-core
- Start up Backstage
- Register your catalog-info
- Navigate to the Docs area
- Then click on the Read Docs button for the repo you setup in the previous steps
Notice that after some time you’ll get the following error in the UI:
Error: Failed to generate docs from C:\Users\UserName\AppData\Local\Temp\backstage-OCDxtp into C:\Users\UserName\AppData\Local\Temp\techdocs-tmp-6bZilb with error Docker container returned a non-zero exit code (1) at TechdocsGenerator.run (webpack-internal:///…/techdocs-common/src/stages/generate/techdocs.ts:120:13) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async DocsBuilder.build (webpack-internal:///…/…/plugins/techdocs-backend/src/DocsBuilder/builder.ts:94:5) at async eval (webpack-internal:///…/…/plugins/techdocs-backend/src/service/router.ts:151:13)
Then in the backend logs there is also the following messages:
techdocs debug Failed to generate docs from C:\Users\UserName\AppData\Local\Temp\backstage-OCDxtp into C:\Users\UserName\AppData\Local\Temp\techdocs-tmp-6bZilb type=plugin techdocs debug Build failed with error: {“status”:“Pulling from spotify/techdocs”,“id”:“latest”},{“status”:“Digest: sha256:915bbe59e2602882674d8308ff1211c0c7ab8bdb1a48121df22c9c1abc6a55b1”} {“status”:“Status: Image is up to date for spotify/techdocs:latest”},ERROR - Config value: ‘docs_dir’. Error: The path /content/docs isn’t an existing directory.
Context
We are currently running Backstage using a fork, we’d really like to move away from that as it is a large amount of overhead to manage the merges. Getting this working would get us to that point.
Your Environment
The key element to this is using Azure DevOps Server 2020
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:34 (33 by maintainers)

Top Related StackOverflow Question
Hi @freben , I’ve just created a PR for it - my first ever for OS project. Do you need to approve it first so that it goes through the ci/cd pipeline?
This is a pretty high value contribution. If you have the time to work on it @nadworny it’d be great!