Zola 12 Serv slug issue

Serve issue

This is a little difficult to explain but…I have a site that works with Zola 11, when I serv the same site with Zola 12 I get not found errors trying to navigate the a page with a specific slug. When I look in the local public folder for the index.html (it’s missing) but I assumed this is due to the html being rendered from memory now not from disk. When I run a zola build the correct directory is generated with an index.html.

Using zola 12.

C:\Users\Iria\Zola\production (master -> origin)
λ zola --version
zola 0.12.0

Start up a local serv:

C:\Users\Iria\Zola\production (master -> origin)
λ zola serve -i 192.168.1.101 -p 2015 -u 192.168.1.101
Building site...
-> Creating 178 pages (0 orphan), 6 sections, and processing 0 images
Done in 20.0s.

Listening for changes in C:\Users\Iria\Zola\production{config.toml, content, static, templates}
Press Ctrl+C to stop

Web server is available at http://192.168.1.101:2015

Using a known markdown page which has a slug specified:

...
# SLUG: Learning How To Speak English
slug = "learn-how-to-speak-english-1"
...

Which is in a content folder called lessons

Config.toml has slugify settings:

# Various slugification strategies, see below for details
# Defaults to everything being a slug
[slugify]
paths = "on"
taxonomies = "on"
anchors = "on"

Note: I’ve also tried this with the [slugify] section removed, i.e. the default on condition should apply.

I expect output at the following URL:

http://192.168.1.101:2015/lessons/learn-how-to-speak-english-1/

I have the browser cache turned off. This is what I get:

When I build the site

C:\Users\Iria\Zola\production (master -> origin)
λ zola build -u https://adeptenglish.com -o ..\deployment\ZOLA12-SLUG
Building site...
-> Creating 178 pages (0 orphan), 6 sections, and processing 0 images
Done in 25.5s.

And look for this page \ZOLA12-SLUG\lessons\learn-how-to-speak-english-1

... \ZOLA12-SLUG\lessons\learn-how-to-speak-english-1\index.html 

Observations

  • I’ve specified I want to use my own slug
  • when the site is built it uses the slug I provided (creating a content directory under lessons using my slug’s name
  • When I run serv, the same page is not navigable to getting error not found

So I expect the built version to server the content (I havent had time to test this yet). Will get back as soon as I have.

Ah might be a bug in the new zola serve handling. If you can create a small repo showing the issue, I should be able to fix it quickly

I’ve created a minimal example, and attached a zip if that helps?

Dropbox download

Updated to include a basic template!

If you run this as serv - the page does not exist, and I cannot browse to it:
zola serve -i 192.168.1.101 -p 2015 -u 192.168.1.101
URL should be: 192.168.1.101:2015/lessons/learn-english-conversation-1/

If you run this as build - the output directory lessons\learn-english-conversation-1\index.html exits.

zola build -u https://adeptenglish.com -o .\ZOLA12-Slug-Serv

So a web server would serve the content fine.

Thanks!
I’ve created Zola 12 RSS Issues to track all the bugs in GH. Seeing the number of bugs, it looks like we’ll need to do a 0.12.1.

Sorry to just list issues one after the other, I’d love to move on to using the new features, which I’m so happy you and the other developers have managed to squeeze in to Zola 12.

It’s just I’ve not been able to get to the good stuff until we can take a view on migrating the existing site from Zola 11 without breaking it.

I really do appreciate the time you and the others have taken.

1 Like

No it’s great that you report them! This way we can actually add tests for them if possible and fix them instead of not knowing about them.

I’m getting

thread '<unnamed>' panicked at 'error binding to 192.168.1.101:2015: error creating server listener: Can't assign requested address (os error 49)', /Users/vincentprouillet/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.13.7/src/server/mod.rs:124:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: WS Error <Io(Os { code: 49, kind: AddrNotAvailable, message: "Can\'t assign requested address" })>', src/cmd/serve.rs:324:44
^C⏎                                                                                                                                                                                                       

so that’s one more bug, there shouldn’t be an unwrap.

Running it with just zola serve does work just fine though :confused:

Curious, it doesn’t crash like that on Windows 10, for me. Maybe you have a firewall or port 2015 is already in use?

Probably but the main thing is that it does work fine without mentioning ip/ports. Can you try a plain zola serve on your machine?

Edit: since you’re on Windows it might also be a Windows issue

Interesting result.

Running just serve:

C:\Users\Iria\Zola\production (master -> origin)
λ zola serve
Building site...
-> Creating 178 pages (0 orphan), 6 sections, and processing 0 images
Done in 24.0s.

Listening for changes in C:\Users\Iria\Zola\production{config.toml, content, static, templates}
Press Ctrl+C to stop

Web server is available at http://127.0.0.1:1111

I had to set the base url in cofig.

# The URL the site will be built for
base_url = "http://127.0.0.1:1111"

Browse to the site. It gets further, the page is rendered but no images for those pages are rendered. Which is weird because the section and main site index all work fine, it’s just pages in lower directories in the content directory structure.

overvations

\ = renders index + images (\content)
\lessons = section + images rendered for (\content\lessons_index.md)
\lessons\article = article text renders but no images (\content\lessons\article\index.md)

Note: However the section (list of articles in a taxonomy fail to load when you click on them).

So for pronunciation taxonomy pages, which should look like this these http://127.0.0.1:1111/english/pronunciation/ won’t render.

Note: After trying to browse a few pages, it looks like the internal sever has crashed as it starts to fail on previously successful pages.

After CTRL+C I ran the server command again. This time it would not serve the pages even with images, it just said same as yesterday not found.

I don’t understand how just running it twice in a row gets a different result, maybe it’s a cache issue? Maybe the serve process is dying/crashing but staying alive on a port/ip?

The site looks OK until you get to content that’s below a section or a taxonomy, then you get inconsistent behavior.

If I get time this afternoon, I will setup the build on linux and/or one of our mac’s, to check if this is something related to our site.

I’ve just knocked up a video of the issue. Which might help explain whats happening a little better.

I have the same issue, but on Windows only. On Linux all works great.

Argh, can someone on Windows try to debug it?

I don’t know if it will be useful but take a look to the port of the websocket server. It’s trying to get ws://127.0.0.1:1024

изображение

I hit what I think is this as well?

While diagnosing I noticed that zola serve doesn’t create all the pages zola build does anymore:

I also noted that the index.md for this page is not created:

Related issue: Some pages not found on Windows in zola serve · Issue #1169 · getzola/zola · GitHub

Yep that’s normal. zola serve now stores the HTML output in a hashmap that the hyper server looks up to. I am guessing the path on Windows is different, resulting in some 404.

Can you try https://github.com/getzola/zola/pull/1175 to see if it solves the issue for you? I really need to add more tests for Windows

I’ve just quickly learned how to build a release based on a PR, in this case PR 1175.
I did this to get the PR

C:\Users\Iria\Zola\zola (master -> origin)
λ git fetch origin pull/1175/head:zola-pr-1175
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 12 (delta 10), reused 12 (delta 10), pack-reused 0
Unpacking objects: 100% (12/12), done.
From https://github.com/getzola/zola
 * [new ref]         refs/pull/1175/head -> zola-pr-1175

I’ve built zola 13 on Windows 10.

C:\Users\Iria\Zola
λ cd zola\

C:\Users\Iria\Zola\zola (zola-pr-1175 -> origin)
λ git status
On branch zola-pr-1175
nothing to commit, working tree clean

C:\Users\Iria\Zola\zola (zola-pr-1175 -> origin)
λ git branch
  master
* zola-pr-1175

C:\Users\Iria\Zola\zola (master -> origin)
λ git checkout zola-pr-1175
Switched to branch 'zola-pr-1175'
C:\Users\Iria\Zola\production (master -> origin)
λ zola --version
zola 0.13.0

C:\Users\Iria\Zola\production (master -> origin)
λ zola serve -i 192.168.1.101 -p 2015 -u 192.168.1.101
Building site...
-> Creating 180 pages (0 orphan), 6 sections, and processing 0 images
Done in 25.2s.

Listening for changes in C:\Users\Iria\Zola\production{config.toml, content, static, templates}
Press Ctrl+C to stop

Web server is available at http://192.168.1.101:2015

From initial testing it seems to work. I mean the nested content is being rendered in Windows by Zola serve.

We’ll test it some more and get back to this thread.

Sorry I built the wrong brunch first time, it works!

@Sgtlria you can clone the single brunch: git clone --single-branch --branch in-memory-paths https://github.com/rune-rs/zola.git