-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
serve command silently fails with build error(s) and then immediately exits #2623
Comments
I have confirmed this without Docker as well: Running the command
|
π Root cause found! π This "extra" configuration for the "social.icon" was miss-spelled as "fontaweseome" instead of "fontawesome". π The output of the "serve" command actually printed the path to this missing icon as ".icons/fontaweseome/brands/github.svg", but never reported an error. It simply exited silently.
|
Thanks for the report. So, as you probably see, the initial title of the issue is not right. This is actually a build error, just that MkDocs reports it in a super strange way. This is the resulting traceback:
And this is why it is being wrongly suppressed: class TemplateNotFound(IOError, LookupError, TemplateError): mkdocs/mkdocs/commands/serve.py Lines 86 to 88 in fd0e9de
|
@oprypin I updated the title based on your comment. |
So, while the "best" solution might be for the jinja project to provide a better error message, it would be immediately actionable for this Something like... # Provide more helpful error messaging
# See: https://github.com/mkdocs/mkdocs/issues/2623
except TemplateNotFound as templateError: # pragma: no cover
# Avoid ugly, unhelpful traceback
raise Abort("Template file not found: " + str(templateError))
except OSError as e: # pragma: no cover
# Avoid ugly, unhelpful traceback
raise Abort(str(e)) Or, possibly improve all cases with better generic error messaging... except OSError as e: # pragma: no cover
# Avoid ugly, unhelpful traceback
raise Abort("Unexpected error: " + str(e)) |
generic errors like TemplateNotFound (mkdocs#2623) are not clear Signed-off-by: Eric Swanson <ericis@users.noreply.github.com>
β bug π
β¬ feature
Description
Calling
mkdocs serve ...
successfully builds the documentation, but never (successfully) starts a server. It just exits.Tip: this could potentially be an issue with the "minidocks/mkdocs:latest" docker image, so I'll follow-up on that.
Steps to reproduce
docker run --rm -it -v $(pwd):/app -w /app --entrypoint="/bin/bash" minidocks/mkdocs:latest
mkdocs serve --livereload --watch-theme -a 0.0.0.0:8000 -v
Files and logs
mkdocs.yml
src/docs/index.md
Output log
ππΌ π₯ The above output stops and so does the
mkdocs serve ...
command. No additional info and no running server.The text was updated successfully, but these errors were encountered: