wesbarnett / snap-pac

Pacman hooks that use snapper to create pre/post btrfs snapshots like openSUSE's YaST
GNU General Public License v2.0
183 stars 14 forks source link

error: could not get current working directory #20

Closed NicoHood closed 5 years ago

NicoHood commented 6 years ago
[arch@talloniv kunst]$ pwd
/run/user/1000/gvfs/sftp:host=ftp.mywebsite.de,user=myuser
[arch@talloniv kunst]$ sudo pacman -S gnome-weather 
[sudo] password for arch: 
resolving dependencies...
looking for conflicting packages...

Packages (1) gnome-weather-3.26.0-1

Total Download Size:   4.97 MiB
Total Installed Size:  5.48 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 gnome-weather-3.26.0-1-any                                                                             5.0 MiB  9.94M/s 00:01 [#############################################################################] 100%
(1/1) checking keys in keyring                                                                                                 [#############################################################################] 100%
(1/1) checking package integrity                                                                                               [#############################################################################] 100%
(1/1) loading package files                                                                                                    [#############################################################################] 100%
(1/1) checking for file conflicts                                                                                              [#############################################################################] 100%
(1/1) checking available disk space                                                                                            [#############################################################################] 100%
:: Running pre-transaction hooks...
(1/1) Performing snapper pre snapshots for the following configurations...
error: could not get current working directory
==> root: 9732
:: Processing package changes...
(1/1) installing gnome-weather                                                                                                 [#############################################################################] 100%
:: Running post-transaction hooks...
(1/5) Compiling GSettings XML schema files...
(2/5) Updating icon theme caches...
(3/5) Arming ConditionNeedsUpdate...
(4/5) Updating the desktop file MIME type cache...
(5/5) Performing snapper post snapshots for the following configurations...
==> root: 9733
[arch@talloniv kunst]$ ^C

It seems to happen when you are on a remote login via sshfs/sftp. I dont know if this causes any further problem. Some additional information would be appreciated, and maybe this can be fixed?

wesbarnett commented 6 years ago

Do you still have this problem? Honestly I have no idea.

NicoHood commented 6 years ago

Yes I do.

Steps to reproduce:

wesbarnett commented 6 years ago

It seems weird that it succeeds after that error. Are the snapshots there?

NicoHood commented 6 years ago

Yes it finishes with success. Try it out yourself ;) If you enable ssh on your local system it should be able to mount it via sshfs also.

NicoHood commented 6 years ago

I could not find the error in the code, how is this error triggered?

snapper -c root create --cleanup number

Runs without any errors.

wesbarnett commented 5 years ago

This is a message from pacman. https://git.archlinux.org/pacman.git/tree/src/pacman/conf.c#n245

Uninstall snap-pac and you still get the error.

ShellCode33 commented 1 year ago

Sorry to necrobump this thread, but I'm having this issue as well:

:: Running pre-transaction hooks...
(1/1) Performing snapper pre snapshots for the following configurations...
error: could not get current working directory
==> root: 13

Everything still seems to work just fine though. But I don't like to see red errors when I upgrade my system :-)

The post transaction doesn't have this issue:

(5/6) Performing snapper post snapshots for the following configurations...
==> root: 14

@NicoHood did you figure it out ?

The error is indeed emitted by pacman, I don't know how hooks are being run by pacman, could it be that snap-pac alters pacman's behavior is some way ? Here's the line of the source code where the error is printed out, because the link above is broken.

I don't know what's causing this but I thought I would still comment here so that maybe we can find the root cause of it with other people ending up here (this is one of the first search engine result when you google for pacman could not get current working directory).

Some info regarding my setup:

$ snapper --version
snapper 0.10.5
flags btrfs,lvm,ext4,xattrs,rollback,btrfs-quota,no-selinux
$ pacman -Qi snap-pac | grep -i version
Version         : 3.0.1-2
$ btrfs --version
btrfs-progs v6.3.3
$ uname -a
Linux laptop 6.4.10-hardened1-1-hardened #1 SMP PREEMPT_DYNAMIC Tue, 15 Aug 2023 05:19:15 +0000 x86_64 GNU/Linux