Zola: Crash 'internal error: entered unreachable code' on 0.4

Created on 4 Aug 2018  路  9Comments  路  Source: getzola/zola

I am trying out the new 0.4 release of Gutenberg and I am running into a crash. This is on Windows 10 Pro 64 bit, with the exe downloaded from the GitHub releases page.

Steps to reproduce:

  1. Start gutenberg serve
  2. Make a change to content/_index.md (or any other file that will trigger rebuild).
  3. Crash with message:
    `` Change detected @ 2018-08-04 20:47:19 thread 'main' panicked at 'internal error: entered unreachable code: Got a change in an unexpected path: content/_index.md', src\cmd\serve.rs:339:9 note: Run withRUST_BACKTRACE=1` for a backtrace.
    stack backtrace:
    0:
    1:
    2:
    3:
    4: onig_get_encoding
    5:
    6:
    7:
    8: onig_unicode_define_user_property
    9: BaseThreadInitThunk
    10: RtlUserThreadStart
    thread '
    ````
bug good first issue

All 9 comments

Thanks for the report. Looks like a Windows-only issue in https://github.com/Keats/gutenberg/blob/master/src/cmd/serve.rs#L323-L342 because line 326 is replacing \ into "" for some reason. Should be trivial to fix, I'll have a look later unless wants to do it

Seeing exactly the same thing on FreeBSD.

Stuffed a debug println in there which confirmed my suspicion:

detect_change_kind(): pwd: "/home/freaky/code/www/hur.st", path: content/_index.md

You're expecting path to be absolute when it's relative.

So much for my theory :(
Can you try the PR above @Freaky ?

After editing config.toml:

Change detected @ 2018-08-05 00:08:58
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: StripPrefixError(())', libcore/result.rs:945:5

Offending line:

partial_path.push(path.strip_prefix(pwd).unwrap());

Breaks because path is relative. It probably wants to be unwrap_or(path).

Here's my patch, for reference: https://github.com/Freaky/gutenberg/commit/f6a9d650fa995a0d4295a70e3d13b7dac0ae14ca

A more substantive change like @johansigfrids probably is called for - paths should only ever be &str/String for display purposes, not for processing.

I tried zola on windows. Still this issue is appearing.

Change detected @ 2019-03-29 19:07:13
thread 'main' panicked at 'internal error: entered unreachable code: Got a change in an unexpected path: C:\Users\akash.chandra.gurava\Documents\Projects\akashchandra\akashchandra\templates/index.html', src\cmd\serve.rs:489:9

With 0.6?

C:\Users\akash.chandra.gurava\Documents\Projects\akashchandra\akashchandra\templates/index.html

Looking at the path it does look like it's another case of \ vs /

https://github.com/getzola/zola/issues/649 has been created to track it

Was this page helpful?
0 / 5 - 0 ratings