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

ZFS: Error: Failed to update directories #10

Closed
mingcenwei opened this issue Aug 26, 2022 · 8 comments
Closed

ZFS: Error: Failed to update directories #10

mingcenwei opened this issue Aug 26, 2022 · 8 comments

Comments

@mingcenwei
Copy link

When I run spotify-launcher, the following error will occur:

username> spotify-launcher
[2022-08-26T18:30:21Z INFO  spotify_launcher::config] Loading configuration file at "/etc/spotify-launcher.conf"
[2022-08-26T18:30:21Z INFO  spotify_launcher::apt] Downloading release file...
[2022-08-26T18:30:22Z INFO  spotify_launcher::apt] Downloading signature...
[2022-08-26T18:30:23Z INFO  spotify_launcher::apt] Verifying pgp signature...
[2022-08-26T18:30:23Z INFO  spotify_launcher::apt] Signature verified successfully!
[2022-08-26T18:30:23Z INFO  spotify_launcher::apt] Downloading package index...
[2022-08-26T18:30:24Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
[2022-08-26T18:30:24Z INFO  spotify_launcher::apt] Downloading deb file for "spotify-client_1.1.84.716.gc5f8b819_amd64.deb" version="spotify-client" ("1:1.1.84.716.gc5f8b819")
[2022-08-26T18:30:56Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
[2022-08-26T18:30:59Z INFO  spotify_launcher] Extracting to "/home/username/.local/share/spotify-launcher/install-new"...
[2022-08-26T18:30:59Z INFO  spotify_launcher] Setting new directory active
Error: Failed to update directories "/home/username/.local/share/spotify-launcher/install" and "/home/username/.local/share/spotify-launcher/install-new"

Caused by:
    0: Could not exchange paths: Invalid argument
    1: Invalid argument
@kpcyrd
Copy link
Owner

kpcyrd commented Aug 27, 2022

This seems to be an issue with xch to atomically swap directories:

libxch::xch_non_atomic(&install_path, &new_install_path).with_context(|| {
anyhow!(
"Failed to update directories {:?} and {:?}",
install_path,
new_install_path
)
})?;

Which filesystem are you using? :) The mountpoint for that directory can be shown with df /home/username/.local/share/spotify-launcher.

@mingcenwei
Copy link
Author

mingcenwei commented Aug 28, 2022

I use ZFS:

$USER> df -- ~/.local/share/
Filesystem                               1K-blocks      Used Available Use% Mounted on
pool_name/data/default/home 407179392 180318080 226861312  45% /home

$USER> findmnt -- /home
TARGET SOURCE                                   FSTYPE OPTIONS
/home  pool_name/data/default/home zfs    rw,relatime,xattr,posixacl

@kpcyrd
Copy link
Owner

kpcyrd commented Aug 29, 2022

Thanks, I've filed this as a bug in the xch crate WanzenBug/xch#3 :)

@kpcyrd kpcyrd changed the title Error: Failed to update directories ZFS: Error: Failed to update directories Aug 30, 2022
@lechum2
Copy link

lechum2 commented Jan 19, 2023

Hi, I have stumbled on the similar issue, but not on on ext4. However there is ecrptfs involved.

$ spotify-launcher    
[2023-01-19T09:08:20Z INFO  spotify_launcher::config] Loading configuration file at "/home/lechu/.config/spotify-launcher.conf"
[2023-01-19T09:08:20Z INFO  spotify_launcher::apt] Downloading release file...
[2023-01-19T09:08:20Z INFO  spotify_launcher::apt] Downloading signature...
[2023-01-19T09:08:20Z INFO  spotify_launcher::apt] Verifying pgp signature...
[2023-01-19T09:08:20Z INFO  spotify_launcher::apt] Signature verified successfully!
[2023-01-19T09:08:20Z INFO  spotify_launcher::apt] Downloading package index...
[2023-01-19T09:08:20Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
[2023-01-19T09:08:20Z INFO  spotify_launcher::apt] Downloading deb file for "spotify-client_1.1.84.716.gc5f8b819-2_amd64.deb" version="spotify-client" ("1:1.1.84.716.gc5f8b819-2")
[2023-01-19T09:09:05Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
[2023-01-19T09:09:08Z INFO  spotify_launcher] Extracting to "/home/lechu/.local/share/spotify-launcher/install-new"...
[2023-01-19T09:09:09Z INFO  spotify_launcher] Setting new directory active
Error: Failed to update directories "/home/lechu/.local/share/spotify-launcher/install" and "/home/lechu/.local/share/spotify-launcher/install-new"

Caused by:
    0: Could not exchange paths: Invalid argument
    1: Invalid argument
$ df -- ~/.local/share                                                                                                                                                               [10:14:38]
Filesystem           1K-blocks      Used Available Use% Mounted on
/home/lechu/.Private 354243944 193455908 142720224  58% /home/lechu
$ findmnt -- /home                                                                                                                                                                   [10:15:20]
TARGET SOURCE         FSTYPE OPTIONS
/home  /dev/nvme0n1p7 ext4   rw,relatime
$ findmnt -- /home/lechu                                                                                                                                                             [10:15:26]
TARGET      SOURCE               FSTYPE   OPTIONS
/home/lechu /home/lechu/.Private ecryptfs rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=4c81295950b749ff,ecryptfs_sig=49faa0643ea930d6,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_si

@kpcyrd kpcyrd pinned this issue Jan 19, 2023
@kpcyrd
Copy link
Owner

kpcyrd commented Jan 20, 2023

I've uploaded a 0.5.0 release that tries to do an atomic swap and if this fails it deletes the active install directory and then moves install-new to install. This should work on all filesystems.

Let me know if this works for you. :)

@lechum2
Copy link

lechum2 commented Jan 20, 2023

It shows a warning, but works fine now.

$ spotify-launcher                                                                                                                                                                   [20:54:03]
[2023-01-20T19:54:15Z INFO  spotify_launcher::config] Loading configuration file at "/home/lechu/.config/spotify-launcher.conf"
[2023-01-20T19:54:15Z INFO  spotify_launcher::apt] Downloading release file...
[2023-01-20T19:54:15Z INFO  spotify_launcher::apt] Downloading signature...
[2023-01-20T19:54:15Z INFO  spotify_launcher::apt] Verifying pgp signature...
[2023-01-20T19:54:15Z INFO  spotify_launcher::apt] Signature verified successfully!
[2023-01-20T19:54:15Z INFO  spotify_launcher::apt] Downloading package index...
[2023-01-20T19:54:15Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
[2023-01-20T19:54:15Z INFO  spotify_launcher::apt] Downloading deb file for "spotify-client_1.1.84.716.gc5f8b819-2_amd64.deb" version="spotify-client" ("1:1.1.84.716.gc5f8b819-2")
[2023-01-20T19:54:54Z INFO  spotify_launcher::apt] Verifying with sha256sum hash...
[2023-01-20T19:54:54Z INFO  spotify_launcher::extract] Extracting to "/home/lechu/.local/share/spotify-launcher/install-new"...
[2023-01-20T19:54:57Z INFO  spotify_launcher::extract] Atomically swapping new directory at "/home/lechu/.local/share/spotify-launcher/install-new" with "/home/lechu/.local/share/spotify-launcher/install"...
[2023-01-20T19:54:57Z WARN  spotify_launcher::extract] Failed to swap "/home/lechu/.local/share/spotify-launcher/install-new" with "/home/lechu/.local/share/spotify-launcher/install": Could not exchange paths: Invalid argument: Invalid argument
spotify: /usr/lib/libcurl-gnutls.so.4: no version information available (required by spotify)
/home/lechu/.local/share/spotify-launcher/install/usr/share/spotify/spotify: /usr/lib/libcurl-gnutls.so.4: no version information available (required by /home/lechu/.local/share/spotify-launcher/install/usr/share/spotify/spotify)
/home/lechu/.local/share/spotify-launcher/install/usr/share/spotify/spotify: /usr/lib/libcurl-gnutls.so.4: no version information available (required by /home/lechu/.local/share/spotify-launcher/install/usr/share/spotify/spotify)
[libprotobuf ERROR ../core/vendor/protobuf3/src/google/protobuf/wire_format_lite.cc:577] String field 'spotify.event_sender.proto.DroppedEvents.DroppedEventsBySequenceIdEntry.key' contains invalid UTF-8 data when parsing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes. 
/proc/self/exe: /usr/lib/libcurl-gnutls.so.4: no version information available (required by /proc/self/exe)

@lechum2
Copy link

lechum2 commented Jan 20, 2023

Thanks :)

@kpcyrd
Copy link
Owner

kpcyrd commented Jan 21, 2023

The warning was expected and it's doing a naive non-atomic swap of the directories (rm -rf install && mv install-new install). I just noticed the log output on info level is not ideal.

Anyway closing this for now. :)

@kpcyrd kpcyrd closed this as completed Jan 21, 2023
@kpcyrd kpcyrd unpinned this issue Mar 16, 2023
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