Repository navigation
Closed
Description
Context
No response
Bug description
We have been using a version 8.x of the mkdocs to build our documentation until yesterday. We decided to upgrade to 9.x and all worked well without the insiders version. When the CI tried to build the docs with the insiders plugin, it failed.
It seems an incompatibility has been introduced with the i18n mkdocs and social mkdocs-material plugin. Seems there is some concurrent computing happening, looking at the final error:
RuntimeError: cannot schedule new futures after shutdown
The site build works fine if I do either of the three:
- remove all but the English language in
plugins.i18n.languagesfrommkdocs.yml; - remove the
plugins.socialplugin; - remove the insiders version of mkdocs-material;
What I have tried is to set some extra logging and reducing the concurrency to just 1, but without success:
- social:
# See https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/
concurrency: 1
debug: true
log_level: warn
cards_color:
fill: "#72ad2e"
text: "#FFFFFF"
Related links
Reproduction
I did not add a zip file as I listed the detailed steps to reproduce below.
Steps to reproduce
$ git clone git@github.com:opengisch/QField-docs.git /tmp/qfield-docs && cd /tmp/qfield-docs
$ pip install -r requirements.txt
$ pip freeze | grep mkdocs
mkdocs==1.5.3
mkdocs-material==9.4.6
mkdocs-static-i18n==1.1.1
mkdocs-video==1.5.0
$ mkdocs build &> /dev/null
$ echo $?
0
$ pip install -r requirements-insiders.txt
$ pip freeze | grep mkdocs
mkdocs==1.5.3
mkdocs-material @ git+https://github.com/squidfunk/mkdocs-material-insiders@d566d6c713e43b835808347c10b7bc52ffb603a8
mkdocs-material-extensions==1.3
mkdocs-static-i18n==1.1.1
mkdocs-video==1.5.0
$ mkdocs build &> /dev/null
INFO - The following pages exist in the docs directory, but are not included in the "nav" configuration:
- how-to/itinerary.en.md
INFO - mkdocs_static_i18n: Building 'de' documentation to directory: /home/suricactus/work/opengisch/QField-docs/site/de
INFO - mkdocs_static_i18n: Overriding 'de' config 'site_name' with 'QField Ökosystem Dokumentation'
INFO - The following pages exist in the docs directory, but are not included in the "nav" configuration:
- how-to/itinerary.en.md
ERROR - Error reading page 'index.md': cannot schedule new futures after shutdown
Traceback (most recent call last):
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/__main__.py", line 286, in build_command
build.build(cfg, dirty=not clean)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/commands/build.py", line 354, in build
config.plugins.on_post_build(config=config)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/plugins.py", line 542, in on_post_build
return self.run_event('post_build', config=config)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/plugins.py", line 509, in run_event
result = method(**kwargs)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs_static_i18n/plugin.py", line 195, in on_post_build
build(config, dirty=dirty)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/commands/build.py", line 322, in build
_populate_page(file.page, config, files, dirty)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/commands/build.py", line 171, in _populate_page
page.markdown = config.plugins.on_page_markdown(
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/plugins.py", line 575, in on_page_markdown
return self.run_event('page_markdown', markdown, page=page, config=config, files=files)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/mkdocs/plugins.py", line 507, in run_event
result = method(item, **kwargs)
File "/home/suricactus/.local/share/virtualenvs/QField-docs-gWjwgoS7/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 177, in on_page_markdown
self.card_pool_jobs[page.file.src_uri] = self.card_pool.submit(
File "/home/suricactus/.asdf/installs/python/3.10.13/lib/python3.10/concurrent/futures/thread.py", line 167, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
$ echo $?
1
Browser
No response
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.
Activity
squidfunk commentedon Oct 25, 2023
Thanks for reporting. Please follow our bug reporting guidelines and attach a minimal reproduction.
suricactus commentedon Oct 26, 2023
Ok, here we go with barebones example with the same problem.
mkdocs-material-social.zip
If you try the
requirements_working.txtit is just fine.squidfunk commentedon Oct 27, 2023
Thanks for reporting and providing the reproduction. I think it is safe to move the teardown logic into
on_shutdown, which means the thread pool will be available for the entirety of the build. Fixed in933ea11, which now prints:The social cards are now both generated:
squidfunk commentedon Oct 27, 2023
Released as part of 9.4.7+insiders-4.42.3.