Skip to content
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

Zola Panics With a Non-Existent Project Root or Config #2250

Closed
ElliotKillick opened this issue Jul 18, 2023 · 3 comments
Closed

Zola Panics With a Non-Existent Project Root or Config #2250

ElliotKillick opened this issue Jul 18, 2023 · 3 comments
Labels

Comments

@ElliotKillick
Copy link

Bug Report

Environment

Zola version: 0.17.2

Expected Behavior

No panic, an error message is printed and Zola exits cleanly.

Current Behavior

Panic.

RUST_BACKTRACE=full ~/Downloads/zola-v0.17.2-x86_64-unknown-linux-gnu/zola -r I_DO_NOT_EXIST build
thread 'main' panicked at 'Could not find canonical path of root dir: I_DO_NOT_EXIST', src/main.rs:32:9
stack backtrace:
   0:     0x64e37e48e1ac - <unknown>
   1:     0x64e37dd5d91e - <unknown>
   2:     0x64e37e464034 - <unknown>
   3:     0x64e37e48f96f - <unknown>
   4:     0x64e37e48f56f - <unknown>
   5:     0x64e37e49060c - <unknown>
   6:     0x64e37e4900c4 - <unknown>
   7:     0x64e37e49002c - <unknown>
   8:     0x64e37e490001 - <unknown>
   9:     0x64e37dad45d2 - <unknown>
  10:     0x64e37dbc3936 - <unknown>
  11:     0x64e37db64413 - <unknown>
  12:     0x64e37dbd19d9 - <unknown>
  13:     0x7136f5b7eb4a - __libc_start_call_main
  14:     0x7136f5b7ec0b - __libc_start_main@@GLIBC_2.34
  15:     0x64e37db38aae - <unknown>
  16:                0x0 - <unknown>

Step to reproduce

zola -r I_DO_NOT_EXIST build

Same error happens with most other commands (e.g. init).

@ElliotKillick ElliotKillick changed the title Zola Panics When Trying to Serve From a Non-Existent Project Root Zola Panics With a Non-Existent Project Root Jul 18, 2023
@ElliotKillick
Copy link
Author

Here's another similar one:

RUST_BACKTRACE=full ~/Downloads/zola-v0.17.2-x86_64-unknown-linux-gnu/zola -c I_DO_NOT_EXIST build
Building site...
thread 'main' panicked at 'could not find directory containing config file', src/main.rs:19:28
stack backtrace:
   0:     0x5738e70271ac - <unknown>
   1:     0x5738e68f691e - <unknown>
   2:     0x5738e6ffd034 - <unknown>
   3:     0x5738e702896f - <unknown>
   4:     0x5738e702856f - <unknown>
   5:     0x5738e702960c - <unknown>
   6:     0x5738e6704699 - <unknown>
   7:     0x5738e66fb61c - <unknown>
   8:     0x5738e665e19a - <unknown>
   9:     0x5738e67592fe - <unknown>
  10:     0x5738e6759c81 - <unknown>
  11:     0x5738e66fd413 - <unknown>
  12:     0x5738e676a9d9 - <unknown>
  13:     0x7b26b372ab4a - __libc_start_call_main
  14:     0x7b26b372ac0b - __libc_start_main@@GLIBC_2.34
  15:     0x5738e66d1aae - <unknown>
  16:                0x0 - <unknown>

@ElliotKillick ElliotKillick changed the title Zola Panics With a Non-Existent Project Root Zola Panics With a Non-Existent Project Root or Config Jul 18, 2023
@Keats
Copy link
Collaborator

Keats commented Jul 19, 2023

We should error instead of panicking here: https://github.com/getzola/zola/blob/master/src/main.rs#L15-L33

@Keats Keats added the bug label Jul 19, 2023
Raymi306 pushed a commit to Raymi306/zola-fork that referenced this issue Jul 29, 2023
@Raymi306
Copy link
Contributor

this was partially fixed on next already, I will fix the other panic indicated by Keats and make a new PR

Raymi306 added a commit to Raymi306/zola-fork that referenced this issue Jul 29, 2023
Keats pushed a commit that referenced this issue Jul 30, 2023
peterprototypes pushed a commit to peterprototypes/zola that referenced this issue Sep 12, 2023
technimad pushed a commit to technimad/zola that referenced this issue Sep 30, 2023
@Keats Keats closed this as completed in 2cd133b Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants