1

I'm trying to run MkDocs and getting a StopIteration error when running mkdocs serve. This is on a fresh MkDocs project. I've installed MkDocs, ran mkdocs new my-project and then mkdocs serve.

It appears the file_match variable is empty on line 345 of config_options.py but I can't figure out what populates file_match. Is there an additional step between installing MkDocs and then using it that I'm missing?

Thanks for any help. My full stack trace is below.

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/mkdocs/config/config_options.py", line 345, in walk_docs_dir
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/mkdocs/__main__.py", line 110, in serve_command
    serve.serve(
  File "/usr/local/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 78, in serve
    config = builder()
  File "/usr/local/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 67, in builder
    config = load_config(
  File "/usr/local/lib/python3.8/site-packages/mkdocs/config/base.py", line 151, in load_config
    errors, warnings = cfg.validate()
  File "/usr/local/lib/python3.8/site-packages/mkdocs/config/base.py", line 84, in validate
    self._post_validate()
  File "/usr/local/lib/python3.8/site-packages/mkdocs/config/base.py", line 73, in _post_validate
    config_option.post_validation(self, key_name=key)
  File "/usr/local/lib/python3.8/site-packages/mkdocs/config/config_options.py", line 370, in post_validation
    for filename in self.walk_docs_dir(config['docs_dir']):
RuntimeError: generator raised StopIteration
1
  • Can you add more details, please? Were there any preceding steps, info, or warning? Also, can you add a sample project to reproduce the error with settings similar to yours? What environment do you use what OS, package managers? Commented Sep 24, 2020 at 13:12

1 Answer 1

0

It might be the problem with no support of python 3.7 or newer: https://github.com/mkdocs/mkdocs/pull/1536.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.