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

gcfs: unable to access mount: No such file or directory #275

Closed
platinum55 opened this issue Nov 19, 2018 · 11 comments
Closed

gcfs: unable to access mount: No such file or directory #275

platinum55 opened this issue Nov 19, 2018 · 11 comments

Comments

@platinum55
Copy link

platinum55 commented Nov 19, 2018

hi,

after pushing some data in and umounting, i am now unable to access (again)mounted cipher dir:

gocryptfs googledrive/safe dump
Password:
Decrypting master key
Filesystem mounted and ready.

ls dump/
ls: cannot open directory 'dump/': No such file or directory

I had it before and thought it was a bug from an older version, then updated to the latest release from here. But now the same problem. When creating a new cipherdir, everything works. I also found no debug option to find out more info on whats going wrong - please help me to give you more infos :)

kind regards,
plati

@platinum55 platinum55 changed the title unable to mount: No such file or directory unable to access mount: No such file or directory Nov 19, 2018
@platinum55
Copy link
Author

I used "-fusedebug" and got this output:

Nov 25 03:48:01 spin8 gocryptfs[6472]: go-fuse: Dispatch 2: GETATTR, NodeId: 1. data: {Fh 0}
Nov 25 03:48:01 spin8 gocryptfs[6472]: go-fuse: Serialize 2: GETATTR code: OK value: {A1.000000000 {M040755 SZ=512 L=2 0:0 B14096 i0:450 A 1542730784.720000000 M 1542577706.765000000 C 1542577706.765000000}}
Nov 25 03:48:02 spin8 gocryptfs[6472]: go-fuse: Dispatch 3: STATFS, NodeId: 1.
Nov 25 03:48:02 spin8 gocryptfs[6472]: go-fuse: Serialize 3: STATFS code: OK value: {blocks (18014398408013962,18014398408013962)/18014398509481984 files 18446744073709550947/18446744073709551615 bs512 nl1024 frs512}
Nov 25 03:48:02 spin8 gocryptfs[6472]: go-fuse: Dispatch 4: STATFS, NodeId: 1.
Nov 25 03:48:02 spin8 gocryptfs[6472]: go-fuse: Serialize 4: STATFS code: OK value: {blocks (18014398408013962,18014398408013962)/18014398509481984 files 18446744073709550947/18446744073709551615 bs512 nl1024 frs512}
Nov 25 03:48:07 spin8 gocryptfs[6472]: go-fuse: Dispatch 5: GETATTR, NodeId: 1. data: {Fh 0}
Nov 25 03:48:07 spin8 gocryptfs[6472]: go-fuse: Serialize 5: GETATTR code: OK value: {A1.000000000 {M040755 SZ=512 L=2 0:0 B1
4096 i0:450 A 1542730784.720000000 M 1542577706.765000000 C 1542577706.765000000}}
Nov 25 03:48:07 spin8 gocryptfs[6472]: go-fuse: Dispatch 6: STATFS, NodeId: 1.
Nov 25 03:48:07 spin8 gocryptfs[6472]: go-fuse: Serialize 6: STATFS code: OK value: {blocks (18014398408013962,18014398408013962)/18014398509481984 files 18446744073709550947/18446744073709551615 bs512 nl1024 frs512}
Nov 25 03:48:07 spin8 gocryptfs[6472]: go-fuse: Dispatch 7: STATFS, NodeId: 1.
Nov 25 03:48:07 spin8 gocryptfs[6472]: go-fuse: Serialize 7: STATFS code: OK value: {blocks (18014398408013962,18014398408013962)/18014398509481984 files 18446744073709550947/18446744073709551615 bs512 nl1024 frs512}

I also used strace on "ls dump" but I cannot find any relevant errors there:

execve("/bin/ls", ["ls", "dump"], [/* 26 vars /]) = 0
brk(NULL) = 0x56437b162000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6eea0e0000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=93295, ...}) = 0
mmap(NULL, 93295, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6eea0c9000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000k\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=155400, ...}) = 0
mmap(NULL, 2259664, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6ee9c98000
mprotect(0x7f6ee9cbd000, 2093056, PROT_NONE) = 0
mmap(0x7f6ee9ebc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x24000) = 0x7f6ee9ebc000
mmap(0x7f6ee9ebe000, 6864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6ee9ebe000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\4\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1689360, ...}) = 0
mmap(NULL, 3795296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6ee98f9000
mprotect(0x7f6ee9a8e000, 2097152, PROT_NONE) = 0
mmap(0x7f6ee9c8e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x195000) = 0x7f6ee9c8e000
mmap(0x7f6ee9c94000, 14688, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6ee9c94000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpcre.so.3", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\25\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=468920, ...}) = 0
mmap(NULL, 2564360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6ee9686000
mprotect(0x7f6ee96f8000, 2093056, PROT_NONE) = 0
mmap(0x7f6ee98f7000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x71000) = 0x7f6ee98f7000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14640, ...}) = 0
mmap(NULL, 2109680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6ee9482000
mprotect(0x7f6ee9485000, 2093056, PROT_NONE) = 0
mmap(0x7f6ee9684000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f6ee9684000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0Pa\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=135440, ...}) = 0
mmap(NULL, 2212936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6ee9265000
mprotect(0x7f6ee927d000, 2093056, PROT_NONE) = 0
mmap(0x7f6ee947c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f6ee947c000
mmap(0x7f6ee947e000, 13384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6ee947e000
close(3) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6eea0c7000
arch_prctl(ARCH_SET_FS, 0x7f6eea0c83c0) = 0
mprotect(0x7f6ee9c8e000, 16384, PROT_READ) = 0
mprotect(0x7f6ee947c000, 4096, PROT_READ) = 0
mprotect(0x7f6ee9684000, 4096, PROT_READ) = 0
mprotect(0x7f6ee98f7000, 4096, PROT_READ) = 0
mprotect(0x7f6ee9ebc000, 4096, PROT_READ) = 0
mprotect(0x56437a59d000, 4096, PROT_READ) = 0
mprotect(0x7f6eea0e3000, 4096, PROT_READ) = 0
munmap(0x7f6eea0c9000, 93295) = 0
set_tid_address(0x7f6eea0c8690) = 7954
set_robust_list(0x7f6eea0c86a0, 24) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f6ee926abd0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f6ee92760c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f6ee926ac60, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f6ee92760c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192
1024, rlim_max=RLIM64_INFINITY}) = 0
statfs("/sys/fs/selinux", 0x7ffecc7715f0) = -1 ENOENT (No such file or directory)
statfs("/selinux", 0x7ffecc7715f0) = -1 ENOENT (No such file or directory)
brk(NULL) = 0x56437b162000
brk(0x56437b183000) = 0x56437b183000
open("/proc/filesystems", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tr"..., 1024) = 343
read(3, "", 1024) = 0
close(3) = 0
access("/etc/selinux/config", F_OK) = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3561008, ...}) = 0
mmap(NULL, 3561008, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6ee8eff000
close(3) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=66, ws_col=271, ws_xpixel=0, ws_ypixel=0}) = 0
stat("dump", {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
open("dump", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(2, "ls: ", 4ls: ) = 4
write(2, "cannot open directory 'dump'", 28cannot open directory 'dump') = 28
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
) = 1
close(1) = 0
close(2) = 0
exit_group(2) = ?
+++ exited with 2 +++

@rfjakob
Copy link
Owner

rfjakob commented Nov 25, 2018

Hi! Can you run

gocryptfs -fsck googledrive/safe

an post the output? Note: You need gocryptfs 1.6 for -fsck to work.

@platinum55
Copy link
Author

Hello,

thanks for your response, I did:

gocryptfs -fsck gdrive/safe
Password:
Decrypting master key
fsck: error listing xattrs on "": 95=operation not supported
fsck: error opening dir "": 2=no such file or directory
fsck summary: 2 corrupt files

Could this happen because I accessed the gocryptfs folder from different servers?

kind regards

@rfjakob
Copy link
Owner

rfjakob commented Nov 25, 2018

I think the gocryptfs.diriv file is missing. You can check by looking into the encrypted folder, it should be next to gocryptfs.conf.

This file is created on "gocryptfs -init" and never modified again, so I'm not sure how that can happen.

@rfjakob
Copy link
Owner

rfjakob commented Nov 25, 2018

PS: if you look at syslog (journalctl -f), you will probably see a message related to the missing file.

@platinum55
Copy link
Author

platinum55 commented Nov 25, 2018

I see the two files in the encrypted folder, they havent been touched since creation:

1 -rwxr-xr-x 2 root root 384 Nov 18 22:48 gocryptfs.conf
1 -rwxr-xr-x 2 root root 16 Nov 18 22:48 gocryptfs.diriv.19

How to access the crypted data again? Is there any way? :)

thanks alot for your assistance

@platinum55
Copy link
Author

platinum55 commented Nov 25, 2018

I just noticed that the "gocryptfs.diriv.19" file is named just "gocryptfs.diriv" in a fresh setup. I renamed it and the mount is working again! I dont know how it got renamed, maybe a bug? Thanks for your hints so far! :) 🥇

edit: after some testing with a fresh setup, there is again this renaming failure - also in all subdirectories. I use precompiled version 1.6 and will now try to compile myself and see if the problems persist.

edit2: on my local box I cannot reproduce the problem, only via GCSF(google drive) - I guess it could have to do with the way googledrive/GCSF works - the diriv is not accessible blockwise, it needs to get downloaded and uploaded - maybe thats why the file has an attached number - I only know that from existing files

@rfjakob
Copy link
Owner

rfjakob commented Nov 26, 2018

Does it always get the ".19" extension?

@platinum55
Copy link
Author

no, some subfolder IV's got .12 and other numbers. I posted the issue on GCSF in hope for help there, it doesnt seem to be related to gocryptfs! :-)

@platinum55
Copy link
Author

platinum55 commented Dec 4, 2018

solution one: is it somehow possible to use one global diriv for all (sub)folders?
solution two: is it somehow possible that gocryptfs looks for files with numbers at their end?

both would solve the problem (workaround)

thanks in advance for your help mate!

@rfjakob rfjakob changed the title unable to access mount: No such file or directory gcfs: unable to access mount: No such file or directory Dec 15, 2018
@rfjakob
Copy link
Owner

rfjakob commented Dec 15, 2018

  1. The only thing you could do is to disable file name encryption with plaintextnames. Then no diriv files are used at all.

  2. Hehe, this should really be fixed in gcfs ;)

So the idea I had what could be causing the problem for gcfs is that the diriv file is created as UNWRITABLE from the start. This seems confusing, but when a file is first created, you can create it without write permissions but still write to it, and this is what gocryptfs does to protect the diriv files from modification. The test is simple:

umask 0777
echo foo > bar

But this seems to work OK on gcfs and I don't get a .number postfix:

$ ls -l
total 1587
-rwxr--r--. 0 jakob jakob       4 Jan  1  1970  bar
-rwxr-xr-x. 2 root  root  1560010 Nov 14  2016 'Getting started'
drwxr-xr-x. 2 root  root      512 Jan  1  1970 'Shared with me'
drwxr-xr-x. 2 root  root      512 Jan  1  1970  Trash

@rfjakob rfjakob closed this as completed Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants