zola
zola copied to clipboard
zola serve fails to rebuild the entire site
Bug Report
Environment
Zola version: 0.12.2
Apologies for a vague bug, but I can't quite pinpoint the reason behind it. If I run zola serve
for my [repository], I see an error on most of rebuilds:
Oct 27 23:36 ❯ zola serve -f
Building site...
-> Creating 83 pages (0 orphan), 53 sections, and processing 0 images
Done in 194ms.
Listening for changes in /home/yacoob/workarea/gcu{config.toml, content, static, templates}
Press Ctrl+C to stop
Web server is available at http://127.0.0.1:1111
Change detected @ 2020-10-27 23:37:14
-> Content changed /home/yacoob/workarea/gcu/content/hg/moon/_index.md
-> Creating 83 pages (0 orphan), 53 sections, and processing 0 images
File exists (os error 17)
Done in 20ms.
Some pages are rebuilt - others disappear and result in a plain text 404 from the server. I wasn't able to pinpoint what kind of changes are problematic and trigger this behaviour. Happy to provide more information if you tell me how :D
FWIW, zola build
completes without any problems, so I'd be guessing that it's some race condition specific to serve
, between cleanup of the old version and generation of the new one.
Cleanup should be the first thing done on rebuild :/ It would be nice if it showed the file/folder name at least.. Something to add on most IO calls.
It should show the filename now at least in 0.13
Re-open the issue if there are still issues in 0.14
I get the same error now on 0.15.3:
Failed to build the site Error: Was not able to copy file /Users/mamcx/Proyectos/malab/static/css/main.css to /Users/mamcx/Proyectos/malab/public Reason: File exists (os error 17)
Hm that's not even a file?
I noted this only happens if is set hard_link_static = true
ah that's an interesting detail!
Can confirm: the issue only happens when using hard_link_static = true
, and happens regardless if you have any static assets or not. It's as easy as this:
- Terminal 1: make sure you have a zola site that is working/building correctly
- Terminal 2:
zola serve
+ whatever args (sans-f
) - Terminal 1: modify an .md file -- literally just open it up in vi, change nothing, and write it
- Terminal 2: Zola begins to report bizarre and unhelpful errors (I sure wish it showed what file/directory it was accessing that resulted in errno EEXIST).
Demonstration of above:
$ zola serve -i 0.0.0.0 -p 1111
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 1 pages (0 orphan) and 1 sections
Done in 124ms.
Listening for changes in /home/jdc/blog20{config.toml, content, sass, static, templates}
Press Ctrl+C to stop
Web server is available at http://0.0.0.0:1111
Change detected @ 2022-05-30 20:38:37
-> Content changed /home/jdc/blog20/content/blog/2022-05-30-welcome-to-dumb.md
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 1 pages (0 orphan) and 1 sections
Failed to build the site
Error: File exists (os error 17)
Done in 6ms.
Since the initial issue is a bit different, I've made https://github.com/getzola/zola/issues/2081 to track the hard_link_static issue