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 1.2.x livereload no longer working #2457
Comments
Ah, I recently experienced issues with watchdog + Docker/Kubernetes setups. Basically the observer based on inotify is a bit limited on Docker setups, I did not dig deep into it but it seems the inotify events on directories within a volume are only available to one container. I solved it by using the observer that polls the file system instead. Do you happen to have your docs files in a volume mounted on several containers? |
We mount our source docs to /tmp in the container. We do have several containers that run this way but we observed the issue in a singleton environment (compose down, prune, and a single compose up). Happy to help troubleshoot. LMK. |
Could you try to add "dependencies" (not sure if this is the right term) to your docker-compose configuration so as to make sure the container running MkDocs starts last, and tell us if livereload still does not work? |
I understand now. The docker compose has a single container only. In summary, I see the markdown update but not the HTML file change when observed inside the container with docker exec -it /bin/sh I tested with mkdoc -v serve and saw no output after a change. |
Users of Material for MkDocs are also reporting this new behavior, i.e. |
A quick test would be to patch https://github.com/mkdocs/mkdocs/blob/master/mkdocs/livereload/__init__.py#L65 to use from watchdog.observers.polling import PollingObserver |
@oprypin hi, what's your point of view on this please mate? |
I'm using docker compose with a single container and this patch fixed the issue for me. |
Does reproducing this issue require running MkDocs in Docker on Mac? Or are there perhaps other conditions to this? I don't know how to reproduce it, because just running in Docker on Linux works. |
I saw the issue when running Docker on Windows, with the docs files mounted from the Windows file system. However, using Docker on WSL2 with the docs files mounted from the Linux file system, I'm not able to reproduce the issue. |
I am running Docker on Mac and see this issue too. Some initial logs:
We run the docker container as follows:
The Dockerfile CMD is These are the dependencies we use when building the image:
|
- Re-enable strict mode in the verify docs command now that the latest version of mkdocs-material is available and supports the new Google Analytics layout - Amend mkdocs config to use the new Google Analytics layout - Bump to use latest 1.2 version of mkdocs Note - current issue mkdocs/mkdocs#2457 stops live reload from work in mkdocs 1.2 so developers will need to amend the mkdocs.yml to pin mkdocs to version 1.1.2 Signed-off-by: Steve Richards <srichards@mirantis.com>
…#3073) - Re-enable strict mode in the verify docs command now that the latest version of mkdocs-material is available and supports the new Google Analytics layout - Amend mkdocs config to use the new Google Analytics layout - Bump to use latest 1.2 version of mkdocs Note - current issue mkdocs/mkdocs#2457 stops live reload from work in mkdocs 1.2 so developers will need to amend the mkdocs.yml to pin mkdocs to version 1.1.2 Signed-off-by: Steve Richards <srichards@mirantis.com>
I have a proposed fix in #2477. Please try it and let me know if something's wrong. pip install git+https://github.com/mkdocs/mkdocs.git@refs/pull/2477/head |
@oprypin, I can confirm |
The fix is now included in the latest release. |
Time for mkdocs to move to watchfiles ? 👀 (Admission: watchfiles is me) |
mkdocs==1.2 and latest no longer works
mkdocs==1.1.2 works
MacOS 11.4
Docker version 20.10.7, build f0df350
python:3.8-alpine (3.9.5 and 10-rc same behavior)
I checked the Docker container and the markdown is updating but the generated html is not. This seems to be associated with the 1.2 change with watcher.
LMK what logs/config/diag I can provide to help RCA the issue.
The text was updated successfully, but these errors were encountered: