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.

Generating techdocs from the provided example doesn't work

See original GitHub issue

Expected Behavior

When clicking on the READ DOCS link that is generated using this example in the Documentation, the docs are properly displayed.

Current Behavior

│ 2021-05-12T15:33:41.388Z techdocs info Step 1 of 3: Preparing docs for entity Component:default/documented-component type=plugin                                                                       │
│ 2021-05-12T15:33:41.390Z backstage info ::ffff:127.0.0.1 - - [12/May/2021:15:33:41 +0000] "GET /api/techdocs/metadata/entity/default/Component/documented-component HTTP/1.1" 200 - "-" "Mozilla/5.0 ( │
│ Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Edg/90.0.818.56" type=incomingRequest                                                      │
│ 2021-05-12T15:33:45.877Z techdocs info Prepare step completed for entity Component:default/documented-component, stored at /tmp/backstage-x4IzEX type=plugin                                           │
│ 2021-05-12T15:33:45.877Z techdocs info Step 2 of 3: Generating docs for entity Component:default/documented-component type=plugin                                                                      │
│ 2021-05-12T15:33:45.887Z techdocs error Build failed with error:  type=plugin                                                                                                                          │
│ 2021-05-12T15:33:45.887Z backstage error Failed to generate docs from /tmp/backstage-x4IzEX into /tmp/techdocs-tmp-vZzFt4 with error spawn mkdocs ENOENT type=errorHandler stack=Error: Failed to gene │
│ rate docs from /tmp/backstage-x4IzEX into /tmp/techdocs-tmp-vZzFt4 with error spawn mkdocs ENOENT                                                                                                      │
│     at TechdocsGenerator.run (/app/node_modules/@backstage/techdocs-common/dist/index.cjs.js:213:13)                                                                                                   │
│     at runMicrotasks (<anonymous>)                                                                                                                                                                     │
│     at processTicksAndRejections (internal/process/task_queues.js:93:5)                                                                                                                                │
│     at async DocsBuilder.build (/app/node_modules/@backstage/plugin-techdocs-backend/dist/index.cjs.js:99:5)                                                                                           │
│     at async /app/node_modules/@backstage/plugin-techdocs-backend/dist/index.cjs.js:214:9                                                                                                              │
│ 2021-05-12T15:33:45.888Z backstage info ::ffff:127.0.0.1 - - [12/May/2021:15:33:45 +0000] "GET /api/techdocs/sync/default/Component/documented-component HTTP/1.1" 500 311 "-" "Mozilla/5.0 (Macintosh │
│ ; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Edg/90.0.818.56" type=incomingRequest

Content from both mentioned directories /tmp/backstage-x4IzEX

total 20
drwxrwxr-x 3 root root 4096 May 12 15:33 .
drwxrwxrwt 1 root root 4096 May 12 15:33 ..
-rw-r--r-- 1 root root  368 May 12 10:54 catalog-info.yaml
drwxrwxr-x 4 root root 4096 May 12 15:33 docs
-rw-r--r-- 1 root root  176 May 12 15:33 mkdocs.yml

/tmp/techdocs-tmp-vZzFt4

total 8
drwx------ 2 root root 4096 May 12 15:33 .
drwxrwxrwt 1 root root 4096 May 12 15:33 ..

Possible Solution

Steps to Reproduce

  1. Create the app using yarn backstage-create-app
  2. Add default example to the locations in app-config.yaml:
    - type: url
      target: https://github.com/backstage/backstage/blob/master/plugins/techdocs-backend/examples/documented-component/catalog-info.yaml
  1. Use local setup:
techdocs:
  builder: 'local' # Alternatives - 'external'
  generators:
    techdocs: 'local' # Alternatives - 'docker'
  publisher:
    type: 'local' # Alternatives - 'googleGcs' or 'awsS3' or 'azureBlobStorage' or 'openStackSwift'. Read documentation for using alternatives.
  1. Build docker image and start it.

Context

See above.

Your Environment

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
OrkoHuntercommented, May 17, 2021

Looking at the error - error spawn mkdocs ENOENT, it could be that your Docker instance is missing mkdocs. This should help

https://github.com/backstage/techdocs-container/blob/5322712e95f654efe9194517a81347f53932681b/Dockerfile#L23

1reaction
OrkoHuntercommented, May 18, 2021

@nadworny Oh yeah - please create a new issue, thanks! Looks like a bug with the URL Reader that is downloading the tree from Azure DevOps. Please also add how the backstage.io/techdocs-ref metadata annotation looks like in the entity’s catalog-info.yaml.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting TechDocs - Backstage.io
First, git clone the target repository locally, then in the root of the repository, run: npx @techdocs/cli serve. For example, if you have...
Read more >
Backstage tech-docs configuration returning "Error: spawn ...
When I try to run Backstage locally, and visiting the Project ... error: Failed to build the docs page: Failed to generate docs...
Read more >
Backstage TechDocs - How it works - Roadie.io
The generator ran this library against the docs directory of the sample-service in order to convert the markdown files located there into HTML, ......
Read more >
Setting up Techdocs on Backstage | Let's Treat Docs Like Code
It's open source software released by Spotify. With TechDocs built into Backstage, all the engineers write their documentation in Markdown ...
Read more >
Plugins - OpenAPI Generator
#Maven. A Maven plugin to support the OpenAPI generator project ... openApiGenerators, Lists generators available via Open API Generators.
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