-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Error E303: unable to open swap file
if 'directory' has wrong permissions
#20749
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I just observed this in oldtests in TSan CI job:
When I made these changes to the test suite: diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index a6d1cf100..1157fa581 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -179,4 +179,4 @@ newtestssilent: $(NEW_TESTS_RES)
@echo "[OLDTEST] Running" $*
@rm -rf $*.failed test.ok $(RM_ON_RUN)
@mkdir -p $(TMPDIR)
- @/bin/sh runnvim.sh $(ROOT) $(NVIM_PRG) $* $(RUN_VIMTEST) $(NO_INITS) -u NONE --cmd "set shortmess-=F" -S runtest.vim $*.vim
+ @/bin/sh runnvim.sh $(ROOT) $(NVIM_PRG) $* $(RUN_VIMTEST) $(NO_INITS) -u NONE --cmd "source setup.vim" -S runtest.vim $*.vim
diff --git a/src/nvim/testdir/setup.vim b/src/nvim/testdir/setup.vim
index f89528746..fe949ab5d 100644
--- a/src/nvim/testdir/setup.vim
+++ b/src/nvim/testdir/setup.vim
@@ -1,4 +1,6 @@
-if exists('s:did_load')
+let pre_cmd = expand('<stack>') =~# '^pre-vimrc command line'
+
+if pre_cmd || exists('s:did_load')
" Align Nvim defaults to Vim.
set backspace=
set complete=.,w,b,u,t,i
@@ -31,6 +33,10 @@ if exists('s:did_load')
nnoremap Q gQ
endif
+if pre_cmd
+ finish
+endif
+
" Common preparations for running tests.
" Only load this once. https://github.com/neovim/neovim/actions/runs/3330361510/jobs/5508748000 The error doesn't appear in other CI jobs. Maybe there is a data race? |
E303
at start and missing runtime files with v0.8.0E303
at start with v0.8.0
E303
at start with v0.8.0E303: unable to open swap file
at start with v0.8.0
@Nales Do you have |
Thank you @zeetzjq for investigating and reopening the issue.
I changed the owner of So I checked multiple scenarios and here is the full issue. When there is no I suppose I immediately used Do other directories are created this way? This could be a very insidious issue for other users who do the same thing as I did. Should we find a way to prevent this issue? I do not know if this is a good idea to force the creation of this directory as the local user instead of |
It's strange that the directory is not created under |
Actually I use
I checked using I let you close the issue if you think it is a normal behaviour. I think we should find a way to warn the user that he or she has no access to the Anyway, thank you all for the time and the help here! |
Maybe |
StatusImprove checkhealth
👍 Looks like Nvim doesn't provide an easy way to check if directory contents are readable. The closest I can find is from
So this trick can be used (passing
'directory' bug?
This seems to fail if any of the directories the 'directory' list are not accessible. Repro steps:
|
E303: unable to open swap file
at start with v0.8.0E303: unable to open swap file
if 'directory' has wrong permissions
old info
Neovim version (nvim -v)
NVIM v0.8.0-v0.8.0 Build type: RelWithDebInfo
Vim (not Nvim) behaves the same?
No
Operating system/version
Linux Mint 21 Vanessa 64-bit
Terminal name/version
mate-terminal
$TERM environment variable
xterm-256color
Installation
From the debian package in the Releases page and from build
How to reproduce the issue
When I open a file (for example
a.txt
), nvim displays this error at start (see:help E303
):Update: see #20749 (comment)
old info
To check the reason of this issue, I used this command:
I will not paste the whole content of
messages.txt
but here are some suspicious lines (sometimes translated by myself here because I did not manage to launch nvim in English):Here are where nvim configuration is installed:
Let's see for example
matchit.vim
. Here is where it can be found:I have no clues why this
E303
error happens nor why some runtime files cannot be found. Some runtime files are found, for a proof I wrote this issue in a Mardown file and the filetype is correctly detected.This issue happens if I try to open a new file or an already existing file.
Expected behavior
Not displaying a
E303
error message.Actual behavior
See above.
The text was updated successfully, but these errors were encountered: