Hi, I'd like to thank you for making this awesome plugin, first and foremost! ♥
Bug Description
Every configuration I tried leads to a FileNotFoundError: [Errno 2] No such file or directory:
exception. I can't figure out whether it's my fault or a real bug in the plugin.
Let's assume we have the following, "main" doc site we're trying to build/serve:
site_name: My Docs
nav:
- Home: 'index.md'
- Foo: '!import {url}?branch=docs/mkdocs-bringup'
plugins:
- multirepo
Note: I've intentionally hid the URL, but it's an enterprise Gitlab, if that's of any help. The real name of the project, currently represented as Foo
, is also hidden.
Foo
contains a valid mkdocs.yml
, with Nav
properly defined.
Now, when calling mkdocs build
or mkdocs serve
, I get this: FileNotFoundError: [Errno 2] No such file or directory: PosixPath('/home/timorg/my-docs/temp_dir/Foo')
I also get this when moving the import from the Nav
section to the plugin's config, i.e. listing section
s.
Logs
Here's what I got when running mkdocs build --verbose
:
DEBUG - Loading configuration file: /home/timorg/service-development-docs/mkdocs.yml
DEBUG - Loaded theme configuration for 'mkdocs' from '/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs/themes/mkdocs/mkdocs_theme.yml': {'static_templates': ['404.html'], 'locale':
'en', 'include_search_page': False, 'search_index_only': False, 'highlightjs': True, 'hljs_languages': [], 'hljs_style': 'github', 'navigation_depth': 2, 'nav_style': 'primary', 'analytics':
{'gtag': None}, 'shortcuts': {'help': 191, 'next': 78, 'previous': 80, 'search': 83}}
DEBUG - Config value: 'config_file_path' = '/home/timorg/my-docs/mkdocs.yml'
DEBUG - Config value: 'site_name' = 'Service Development Docs'
DEBUG - Config value: 'nav' = [{'Home': 'index.md'}, {'Datastore': '!import {url}?branch=docs/mkdocs-bringup'}]
DEBUG - Config value: 'pages' = None
DEBUG - Config value: 'site_url' = ''
DEBUG - Config value: 'site_description' = None
DEBUG - Config value: 'site_author' = None
DEBUG - Config value: 'theme' = Theme(name='mkdocs', dirs=['/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs/themes/mkdocs',
'/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs/templates'], static_templates=['404.html', 'sitemap.xml'], locale=Locale(language='en', territory=''),
include_search_page=False, search_index_only=False, highlightjs=True, hljs_languages=[], hljs_style='github', navigation_depth=2, nav_style='primary', analytics={'gtag': None}, shortcuts={'help':
191, 'next': 78, 'previous': 80, 'search': 83})
DEBUG - Config value: 'docs_dir' = '/home/timorg/service-development-docs/docs'
DEBUG - Config value: 'site_dir' = '/home/timorg/service-development-docs/site'
DEBUG - Config value: 'copyright' = None
DEBUG - Config value: 'google_analytics' = None
DEBUG - Config value: 'dev_addr' = Address(host='127.0.0.1', port=8000)
DEBUG - Config value: 'use_directory_urls' = True
DEBUG - Config value: 'repo_url' = ''
DEBUG - Config value: 'repo_name' = ''
DEBUG - Config value: 'edit_uri' = ''
DEBUG - Config value: 'extra_css' = []
DEBUG - Config value: 'extra_javascript' = []
DEBUG - Config value: 'extra_templates' = []
DEBUG - Config value: 'markdown_extensions' = ['toc', 'tables', 'fenced_code']
DEBUG - Config value: 'mdx_configs' = {}
DEBUG - Config value: 'strict' = False
DEBUG - Config value: 'remote_branch' = 'gh-pages'
DEBUG - Config value: 'remote_name' = 'origin'
DEBUG - Config value: 'extra' = {}
DEBUG - Config value: 'plugins' = PluginCollection([('multirepo', <mkdocs_multirepo_plugin.plugin.MultirepoPlugin object at 0x7f3746f10a90>)])
DEBUG - Config value: 'watch' = None
INFO - Multirepo plugin importing docs...
: 0%| | 0/1 [00:00<?, ?it/s]Traceback (most recent call last):
File "/home/timorg/.local/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs/__main__.py", line 192, in build_command
build.build(config.load_config(**kwargs), dirty=not clean)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs/commands/build.py", line 257, in build
config = config['plugins'].run_event('config', config)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs/plugins.py", line 102, in run_event
result = method(item, **kwargs)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs_multirepo_plugin/plugin.py", line 150, in on_config
return self.handle_nav_based_import(config)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs_multirepo_plugin/plugin.py", line 103, in handle_nav_based_import
asyncio_run(batch_import(repos))
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs_multirepo_plugin/util.py", line 115, in asyncio_run
asyncio.run(futures)
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs_multirepo_plugin/structure.py", line 255, in batch_import
repo = await import_async
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/tasks.py", line 611, in _wait_for_one
return f.result() # May raise f.exception().
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs_multirepo_plugin/structure.py", line 237, in import_docs
await execute_bash_script("mv_docs_up.sh", [self.docs_dir.replace("/*", "")], cwd=self.location)
File "/home/timorg/.local/pipx/venvs/mkdocs/lib/python3.9/site-packages/mkdocs_multirepo_plugin/util.py", line 97, in execute_bash_script
process = await asyncio.create_subprocess_exec(
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/subprocess.py", line 236, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/base_events.py", line 1676, in subprocess_exec
transport = await self._make_subprocess_transport(
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/unix_events.py", line 197, in _make_subprocess_transport
transp = _UnixSubprocessTransport(self, protocol, args, shell,
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/base_subprocess.py", line 36, in __init__
self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/asyncio/unix_events.py", line 789, in _start
self._proc = subprocess.Popen(
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/home/timorg/.pyenv/versions/3.9.12/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: PosixPath('/home/timorg/my-docs/temp_dir/Foo')
: 0%|
Note that I've yet again replaced namings in the log to match those defined above. Sorry but it's company-internal info.
Environment
OS: Linux (WSL on top of Windows 10)
Distro: Ubuntu 20.04
Python: 3.9.12 (Built with pyenv)