sunaku/dasht

[win10] disk I/O error when docset is installed on shared drive

patpan001 opened this issue · 4 comments

dasht import python_2
Error: disk I/O error
Error: disk I/O error
dasht: 'import' not found in 1 docsets matching 'python_2'

I get above error when I have setup DASHT_DOCSETS_DIR as shared directory. If I unset it and then try to install python_2/3 docset, it gets installed in default location & searchable by dasht import python_2 command.

I've also tried setting up non shared directory DASHT_DOCSETS_DIR and it works fine.
Other docset, for example ansible,docker,NodeJS etc all works fine.

I am thinking it may be something in docset which is not right however couldn't figure it out.

What OS are you using and how do you share a directory? Is it with group-writable permissions (chmod g+w) or something else (like a network share on Windows, sshfs or NFS in Linux, or something in macOS)?

I am using vagrant on windows. I share directory from windows to ubuntu running by vagrant up. I've set export DASHT_DOCSETS_DIR=/shared directory/docset_folder & export DASHT_CACHE_DIR=/shared directory/cache_folder

drwxrwxrwx  1 vagrant vagrant       4096 Sep 23 19:48 dashtcache
drwxrwxrwx  1 vagrant vagrant       4096 Sep 25 08:51 dashtdocs

Once I install new docsets it gets installed in above location however when I use search command it gives disk io error.

$dasht-query-html 'c - x' css
Error: disk I/O error
Error: disk I/O error

tail of strace shows below:

rt_sigaction(SIGUSR1, {sa_handler=0x55d2fc772200, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f017b94df20}, NULL, 8) = 0
pipe([3, 4])                            = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f017bf18810) = 5857
close(4)                                = 0
stat("/usr/local/sbin/awk", 0x7ffd145f0220) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/awk", 0x7ffd145f0220) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/awk", 0x7ffd145f0220)   = -1 ENOENT (No such file or directory)
stat("/usr/bin/awk", {st_mode=S_IFREG|0755, st_size=658072, ...}) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f017bf18810) = 5858
close(3)                                = 0
close(-1)                               = -1 EBADF (Bad file descriptor)
wait4(-1, Error: disk I/O error
Error: disk I/O error
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5857
--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=5857, si_uid=1000} ---
rt_sigreturn({mask=[]})                 = 5857
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5857, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5857
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5858
exit_group(44)                          = ?
+++ exited with 44 +++

The same happens if you're on WSL (Windows 10) and use a some path in /mnt/c/... as docset directory.

Hmm, it's still unclear to me exactly which command is triggering the I/O error. 😕 From the strace output above, it seems like the error is coming from awk but I'm not certain if this interpretation is correct. 🤷‍♂️

Could you try appending -x to the shebang lines (the very first line that starts with #!/bin/sh) in all dasht* scripts and retry the operation? 🤔 This would help us better locate the source of the I/O error.