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

Config and data file creation errors after new install #43

Closed
cleeyv opened this issue Apr 29, 2021 · 4 comments
Closed

Config and data file creation errors after new install #43

cleeyv opened this issue Apr 29, 2021 · 4 comments

Comments

@cleeyv
Copy link
Contributor

cleeyv commented Apr 29, 2021

I uninstalled my old gurk and removed all the old config files to test a fresh install. On the initial run of gurk, I got the following output and error (the qr code displayed correctly and I scanned it):

[USER@HOST ~]$ gurk
Linking new device with device name: gurk@HOST
Config { data_path: "/home/USER/.local/share/gurk/gurk.data.json", signal_db_path: "/home/USER/.local/share/gurk/signal-db", first_name_only: false, user: User { name: "NAME", phone_number: "+###########" } }
Error: failed to init config file

Caused by:
    No such file or directory (os error 2)

This is on Linux. I've been debugging and I think the issue is with this line https://github.com/boxdot/gurk-rs/blob/master/src/config.rs#L42 and that manually creating the directory ~/.config/gurk before the initial run of gurk is a workaround. I'm working on a PR that will hopefully fix the issue.

@gertjanvanzwieten
Copy link

I'm running into the same issue (fresh install, newly linked device) but for me the proposed workaround is not sufficient. While it results in the creation of a (seemingly correct) configuration file ~/.config/gurk/gurk.toml, gurk then fails with Error: failed to load stored data from '/home/USER/.gurk.data.json'. The error message seems off because when I create ~/.local/share/gurk/gurk.data.json the output changes, but I don't know how to hand-craft the missing json data.

@cleeyv
Copy link
Contributor Author

cleeyv commented May 4, 2021

I also encountered this second error after I had resolved the first one. The problem seems to be that when there is no gurk.data.json file present anywhere (ie, on a fresh system that does not already have gurk installed) no empty default data file is created. However, one is expected to be there so when gurk tries to load the non-existent file an error is thrown. I'm about to submit a PR for each problem, for creating the config path dirs, and for creating a default data file when none exists.

@cleeyv cleeyv changed the title Config file creation error after new install Config and data file creation errors after new install May 4, 2021
@gertjanvanzwieten
Copy link

gertjanvanzwieten commented May 4, 2021

I just tried these patches and confirm that they solve both issues. (Afterwards I'm faced with an empty channels box but that is certainly a different issue, if any -- I'm new to gurk so not sure yet how it's supposed to function) (Edit: messages sent after pairing are coming in so everything seems to be in order!)

@boxdot
Copy link
Owner

boxdot commented May 5, 2021

@gertjanvanzwieten Thank you for reporting!
@cleeyv Thank you for fixing it!

@boxdot boxdot closed this as completed May 5, 2021
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

3 participants