zola icon indicating copy to clipboard operation
zola copied to clipboard

zola serve fails to rebuild the entire site

Open yacoob opened this issue 4 years ago • 9 comments

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

yacoob avatar Oct 27 '20 23:10 yacoob

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.

yacoob avatar Oct 28 '20 01:10 yacoob

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.

Keats avatar Oct 28 '20 09:10 Keats

It should show the filename now at least in 0.13

Keats avatar Jan 09 '21 14:01 Keats

Re-open the issue if there are still issues in 0.14

Keats avatar Jul 19 '21 19:07 Keats

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)

mamcx avatar Mar 14 '22 23:03 mamcx

Hm that's not even a file?

Keats avatar Mar 15 '22 08:03 Keats

I noted this only happens if is set hard_link_static = true

mamcx avatar Mar 15 '22 15:03 mamcx

ah that's an interesting detail!

Keats avatar Mar 15 '22 15:03 Keats

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.

koitsu avatar May 31 '22 03:05 koitsu

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

Keats avatar Jan 20 '23 19:01 Keats