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

MkDocs aborts serve if there are warnings for HTTP 404 errors #2557

Closed
prcr opened this issue Sep 1, 2021 · 1 comment · Fixed by #2607
Closed

MkDocs aborts serve if there are warnings for HTTP 404 errors #2557

prcr opened this issue Sep 1, 2021 · 1 comment · Fixed by #2607

Comments

@prcr
Copy link

prcr commented Sep 1, 2021

I was trying out MkDocs 1.2.2 and noticed the following change of behavior from 1.1.2:

When running mkdocs serve with strict mode, MkDocs stops on the first update to a page if there were any warnings for HTTP 404 errors:

$ mkdocs -V
mkdocs, version 1.2.2 from /home/prcr/.local/lib/python3.6/site-packages/mkdocs (Python 3.6)
$ mkdocs serve
INFO     -  Building documentation...
INFO     -  Cleaning site directory
INFO     -  Documentation built in 4.24 seconds
INFO     -  [11:48:31] Serving on http://127.0.0.1:8000/
INFO     -  [11:48:33] Browser connected: http://127.0.0.1:8000/special-thanks/
WARNING  -  [11:48:33] "GET /versions.json HTTP/1.1" code 404
INFO     -  [11:48:45] Detected file changes
INFO     -  Building documentation...
INFO     -  [11:48:50] Reloading browsers
INFO     -  [11:48:50] Browser connected: http://127.0.0.1:8000/special-thanks/
WARNING  -  [11:48:50] "GET /versions.json HTTP/1.1" code 404
INFO     -  [11:49:14] Detected file changes
INFO     -  Building documentation...

Aborted with 2 warnings in strict mode!

MkDocs 1.1.2 ignored the same warnings when also running in strict mode:

$ mkdocs -V
mkdocs, version 1.1.2 from /home/prcr/.local/lib/python3.6/site-packages/mkdocs (Python 3.6)
$ mkdocs serve
INFO    -  Building documentation... 
INFO    -  Cleaning site directory 
INFO    -  Documentation built in 5.50 seconds 
[I 210901 11:51:33 server:335] Serving on http://127.0.0.1:8000
INFO    -  Serving on http://127.0.0.1:8000
[I 210901 11:51:33 handlers:62] Start watching changes
INFO    -  Start watching changes
[W 210901 11:51:34 web:2243] 404 GET /versions.json (127.0.0.1) 6.18ms
WARNING -  404 GET /versions.json (127.0.0.1) 6.18ms
[I 210901 11:51:34 handlers:135] Browser Connected: http://127.0.0.1:8000/
INFO    -  Browser Connected: http://127.0.0.1:8000/
[I 210901 11:51:40 watcher:111] Running task: builder (delay: None)
INFO    -  Running task: builder (delay: None)
INFO    -  Building documentation... 
[I 210901 11:51:45 handlers:95] Reload 1 waiters: /home/prcr/Codacy/git/docs/submodules/chart/docs/maintenance/uninstall.md
INFO    -  Reload 1 waiters: /home/prcr/Codacy/git/docs/submodules/chart/docs/maintenance/uninstall.md
[I 210901 11:51:46 handlers:82] Ignore: /home/prcr/Codacy/git/docs/docs/related-tools/local-analysis/images/run-analysis-through-build-server.png
INFO    -  Ignore: /home/prcr/Codacy/git/docs/docs/related-tools/local-analysis/images/run-analysis-through-build-server.png
[W 210901 11:51:46 web:2243] 404 GET /versions.json (127.0.0.1) 5.92ms
WARNING -  404 GET /versions.json (127.0.0.1) 5.92ms
[I 210901 11:51:46 handlers:135] Browser Connected: http://127.0.0.1:8000/
INFO    -  Browser Connected: http://127.0.0.1:8000/

I wonder if it was a conscious decision to change this behavior in MkDocs 1.2 or if we could go back to the previous behavior of (safely) ignoring the HTTP 404 errors when serving the pages.

@oprypin
Copy link
Contributor

oprypin commented Oct 10, 2021

Worked out a fix in #2607

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

Successfully merging a pull request may close this issue.

2 participants