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

label:"help wanted" "Error Parsing config file: invalid type: string "config.yaml", expected struct YamlConfig Fallbacking to default one ... #921

Open
robbpaulsen opened this issue Nov 10, 2024 · 7 comments

Comments

@robbpaulsen
Copy link

robbpaulsen commented Nov 10, 2024

Compilation versions

  • rustc 1.67.0 (fc594f156 2023-01-24)
  • rustup 1.27.1
  • cargo 1.84.0-nightly (031049782 2024-11-01)
  • navi 2.23.0

Environment Windows 11 WSL2 Debian

I'm having this error:

"Error parsing config file: invalid type: string "/home/user/.config/navi/config.yaml", expected struct YamlConfig
Fallbacking to default one..."

What I've done so far without any succes:

  • Compile using cargo with all features activated
  • Compile using cargo with no extra features indicated to cargo:

cargo install --path .

  • Compile usin the Makefile

make && make install

  • Compile using the locked version

cargo install --locked navi

  • Renamed /home/user/.config/navi/config.yaml file to a ".yml" extension file
  • Format the /home/user/.config/navi/config.yaml with different IDE's in case of bad syntax or YAML/YML syntax structure (Nevoim, Vim, Sublime, VS code. BTW None of them changed a thing to the format so format is good, plus I've have not altered the "config.yaml" that the navi by default created with navi info config-example)

This is not the first time I've compiled the tool, and I had no issues before on my old linux environemnt, but it's the first time under Windows WSL2. By any chance is there some extra declarations or arguments to pass to the compiler that I've missed due to WSL2 env? or what could fix the issue?

Copy link

welcome bot commented Nov 10, 2024

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

@robbpaulsen
Copy link
Author

To my knowledge I've compiled navi to the latest version 2.23.0, and that's what navi -V throws me on screen

@alexis-opolka
Copy link

Hi, can you explain a bit more on when you encounter this issue?
Is it when trying to run navi just after having built it from source?
Is it before renaming config.yaml to config.yml or after?

@robbpaulsen
Copy link
Author

Thanks for replying,

By this point I'm now sure that is a WSL/Windows problem or PowerShell, I never had this problems on linux, anyway, for some reason I compiled via cargo , no issues compiling, but as soon as I created the Conf file every time I run the welcome fnor just regular usage navi/fzf always showed the "parsing error" pointing to the config yml file.

I cleanse the project and uninstalled the binary, proceeded to update my libraries thought I had a old version of some dependencies, and indeed I had, like I stated before I dont know why my rustc version was locked to 1.67 and updates to 1.84.0 stable, recompiled again, but same error kept showing. And no matter if I looked up a command the error message does not let you completely read anything of the info.

Asked GPT, google and stack over flow and they all came with the brilliant idea to just rename the extension from "yml" to "yaml" , and to double check format/indentation of the conf file. But everything on was correctly formatted and indented/spaced.

I cleanse the project again and decided to compile with cargo locked version this time, but same results.

So I gave up and decided to clean my bashrc and profile and when I commented out the widget sourcing from my profile it started to work fine, error message dissapeared, so its resolved, I dont have the "CTRL + G" hot key but its not a big deal.

The error its reproducible, yesterday I uncommented the widget source from my profile and error was back, in case you may want a screenshot.

This are my tooling versions:

rustc 1.84.0
rustup 1.27.1
cargo 1.84.0
navi 2.23.0

@alexis-opolka
Copy link

Hi @robbpaulsen,
Thanks for the details, I'll take a closer look at your issue tomorrow.

@alexis-opolka
Copy link

Hi @robbpaulsen,
After having looked a bit more into your installation process and having reproduced them on a fresh WSL2 Debian install, I cannot reproduce your issue.
Are you able to post your /home/<user>/.config/navi/config.yaml file in this thread?
I think it might be your configuration file that causes an issue.

@robbpaulsen
Copy link
Author

Yes,

And sorry for the delay, I'll try to cover all the scenarios, on bash and zsh, since now its erroring out on zsh too.



On Bash Shell


A Bit of Hardware info

shell

Environment Confirmation of Runnibg Shell

WSL-Specs

The toolchain version of rustup, rustc and cargo

toolchain-version

This is the example configuration file that ships with the repo, check out that first I executed

the pwd command to be sure.

navi-conf-example

And this is my configuration file

my-conf

Even if I just try to read a manual or cheat sheet, the debug bob will arrive today.

YamlConf-Error

Lastly I tried disabling the widget, and stil throw the same error, after thAt I disabled the

widget and implemented the legacy widget file that comes in the repo, but no luck.

widget-function

Thanks for the replay, and hope to hear from you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants