question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TechDocs URL Reader Zip Archive Not In Expected State using Azure DevOps Server 2020

See original GitHub issue

Expected 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:

https://github.com/backstage/backstage/blob/d941f6187b6490878cfea67a46ce573130659765/packages/backend-common/src/reading/tree/ZipArchiveResponse.ts#L156

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.

  1. Create a valid catalog-info.yaml file and add it to your repo
  2. In your catalog-info file add a backstage.io/techdocs-ref annotation using the URL Reader format for it’s value: url:https://ados-servername/organization/project/_git/repository
  3. Make sure you have a \docs folder with at least an index.md
  4. Add a mkdocs.yml file 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
  1. Start up Backstage
  2. Register your catalog-info
  3. Navigate to the Docs area
  4. 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:34 (33 by maintainers)

github_iconTop GitHub Comments

2reactions
nadwornycommented, Aug 25, 2021

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?

2reactions
frebencommented, Aug 10, 2021

This is a pretty high value contribution. If you have the time to work on it @nadworny it’d be great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure DevOps Server 2020 Release Notes - Microsoft Learn
We have released a patch for Azure DevOps Server 2020 Update 0.2 that includes fixes for the following. Resolve issue with newly added...
Read more >
ZipDeploy from Azure DevOps task failing in pipeline
My Azure DevOps Pipeline task for ZipDeploy fails for an undisclosed reason and there are no details in the log file explaining the...
Read more >
Endevor® Integrations for Enterprise DevOps | TechDocs
Download Endevor Bridge for Git 2.10.0 as a ZIP file from Broadcom ... Initialize new mappings using Azure DevOps Server Git repository.
Read more >
Azure Administration Guide - FortiOS 7.0 - Amazon AWS
Deploying FortiGate-VM using Azure PowerShell ... The license and config files' SAS URLs are not expired. Once all fields are entered, ...
Read more >
Telegraf Agent Setup for Windows Server - DevOpsSchool.com
For UDP url endpoint database needs to be configured on server ... Each data format has its own unique set of configuration options,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found