[GH-ISSUE #707] Exception when using ~ in cache path #402

Closed
opened 2026-02-27 19:30:25 +03:00 by kerem · 3 comments
Owner

Originally created by @snadorp on GitHub (Apr 22, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/707

librespot is throwing an exception when initializing with a ~ sign in the path.

cache_path = "~/.cache/spotify"

Loading config from "/home/user/.config/spotifyd/spotifyd.conf"
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Location: /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/librespot-core-0.1.5/src/cache.rs:30

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Originally created by @snadorp on GitHub (Apr 22, 2021). Original GitHub issue: https://github.com/librespot-org/librespot/issues/707 librespot is throwing an exception when initializing with a `~` sign in the path. cache_path = "~/.cache/spotify" ``` Loading config from "/home/user/.config/spotifyd/spotifyd.conf" The application panicked (crashed). Message: called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" } Location: /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/librespot-core-0.1.5/src/cache.rs:30 Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. ```
kerem closed this issue 2026-02-27 19:30:25 +03:00
Author
Owner

@Johannesd3 commented on GitHub (Apr 23, 2021):

Using ~ in the path works for me. It's probable another problem: Does the directory ~/.cache already exist? Librespot 0.1.5 is not able to create multiple dirs in a row for the cache dir, but this is fixed on the dev branch.

<!-- gh-comment-id:825464255 --> @Johannesd3 commented on GitHub (Apr 23, 2021): Using `~` in the path works for me. It's probable another problem: Does the directory `~/.cache` already exist? Librespot 0.1.5 is not able to create multiple dirs in a row for the cache dir, but this is fixed on the `dev` branch.
Author
Owner

@Johannesd3 commented on GitHub (May 1, 2021):

Please reopen if my explanation is wrong.

<!-- gh-comment-id:830618106 --> @Johannesd3 commented on GitHub (May 1, 2021): Please reopen if my explanation is wrong.
Author
Owner

@damif94 commented on GitHub (Sep 3, 2022):

Hi @Johannesd3 I am having the same error message when running spotifyd --no-daemon.

How is this related to a cache directory?
Can you help me solve it 🙏 ?

<!-- gh-comment-id:1236036208 --> @damif94 commented on GitHub (Sep 3, 2022): Hi @Johannesd3 I am having the same error message when running `spotifyd --no-daemon`. How is this related to a cache directory? Can you help me solve it 🙏 ?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#402
No description provided.