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

Version 1.1.0 breaks with my docs #66

Closed
gmambro opened this issue May 20, 2022 · 3 comments
Closed

Version 1.1.0 breaks with my docs #66

gmambro opened this issue May 20, 2022 · 3 comments

Comments

@gmambro
Copy link

gmambro commented May 20, 2022

Hello,

my pipeline stopped working as soon as started using 1.1.0.

This is the traceback
Traceback (most recent call last):
  File "xxx/venv/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
  File "xxx//venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "xxx/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "xxx//venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "xxx/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "xxx/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "xxx/venv/lib/python3.10/site-packages/mkdocs/__main__.py", line 192, in build_command
    build.build(config.load_config(**kwargs), dirty=not clean)
  File "xxx/venv/lib/python3.10/site-packages/mkdocs/commands/build.py", line 257, in build
    config = config['plugins'].run_event('config', config)
  File "xxx//venv/lib/python3.10/site-packages/mkdocs/plugins.py", line 102, in run_event
    result = method(item, **kwargs)
  File "/Users/gabriele/jimdo/aws-msk-engineering/venv/lib/python3.10/site-packages/src/core.py", line 49, in on_config
    theme_override = config["theme"].copy()
AttributeError: 'Theme' object has no attribute 'copy'

my mkdocs.yml looks like this

site_name: My docs
site_description: Documentation for my project
plugins:
  - techdocs-core

markdown_extensions:
  - toc:
      permalink: "#"

nav:
 - Overview: overview.md
 - User Guide: user_guide.md

Reverting to 1.0.2 solved the problem

@gavinclarkeuk
Copy link

I think this issue was introduced with ddd8d28

Changing the line

theme_override = config["theme"].copy()

to

theme_override = config["theme"]

locally seemed to fix things, but I'm not enough of a python/techdocs expert to know if that is a safe thing to do

@rmanny
Copy link

rmanny commented May 20, 2022

As a sidenote, I have seen this pipeline error a few times before as well:

caused by unknown error 'Command mkdocs failed, exit code: 1'

Which is obviously not very helpful. Is there any way to bubble the real mkdocs error up? So it's easier to tell if it's a logic error like this

@iamEAP
Copy link
Member

iamEAP commented May 22, 2022

Hey folks! Thanks for your patience, and for reporting.

Just released v1.1.1 with a very narrow fix (and added a workflow to run unit tests that will hopefully help reduce issues like this cropping up again in the future). We have end-to-end tests in the main Backstage monorepo that started failing after 1.1.0, which are now passing again after releasing 1.1.1. So I'm confident bumping will resolve the issue for you!

If you happen to rely on the theme override capabilities introduced in v1.1.0, those may still not be working 100%, but at least the docs generation is working again.

...Is there any way to bubble the real mkdocs error up? So it's easier to tell if it's a logic error like this

@rmanny great point! My guess is that the TechDocs CLI likely treats things differently compared with the log output in Backstage frontend (if you've got it configured to run that way). An issue in the main Backstage monorepo with that detail (whether it's TechDocs CLI or the Backstage UI) would be a good first step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants