Difference between revisions of "Vim Error E303 and E138 Linux VPS"

From ETCwiki
Jump to navigationJump to search
(Created page with " '''E303: Unable to open swap file for "myfile.txt", recovery impossible "myfile.txt" 27L, 1011C''' '''E138: Can't write viminfo file /root/.viminfo!'''")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
  '''E303: Unable to open swap file for "myfile.txt", recovery impossible
+
This is an error I got out of the blue every time I opened a file in vi or vim text editor via ssh console. Everything else seemed to be working okay somehow, but Vim was apparently unable to create any swap files for documents I was working on, and it could not write to the .viminfo file when I closed Vim. My problem with Vim was actually a bigger problem, my VPS was out of inodes.
  "myfile.txt" 27L, 1011C'''
+
 
 +
  '''E303: Unable to open swap file for "myfile.txt", recovery impossible'''
 +
  "myfile.txt" 27L, 1011C
  
 
  '''E138: Can't write viminfo file /root/.viminfo!'''
 
  '''E138: Can't write viminfo file /root/.viminfo!'''
 +
 +
==E303 E138 Symptoms==
 +
Check for space on your disk, check for available inodes on your VPS
 +
*'''df'''
 +
**Check disk space
 +
*'''df -i'''
 +
**Check inode usage
 +
 +
==E138 E303 Solutions==
 +
'''using too many inodes'''
 +
 +
My source: [http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html] - No space left on device running out of inodes
 +
 +
Inodes are mostly files. If your inodes are at 100% it is probably a program that is writing temp files and not deleting them. My problem happened to be PHP sessions that built up over time with the garbage collection turned off. Locate the files being created, then fix the program creating them. This command I copied from the link above.
 +
$ for i in /*; do echo $i; find $i |wc -l; done
 +
 +
'''Other Solutions'''
 +
If your inodes and disk were not full, you may want to check out some of the links below. E138 in Vim can also come from permission problems on .viminfo, or temp files vim creates in your home directory called .viminf*
 +
 +
==External Links==
 +
*[http://unix.stackexchange.com/questions/134500/vim-error-e138-cant-write-viminfo-file-home-viminfo Stack Exchange E138 cant write viminfo]
 +
*[http://stackoverflow.com/questions/14931233/e138-cant-write-viminfo-file-home-viminfo Stack Overflow E138 cant write viminfo] - related to permissions
 +
*[http://geekswithblogs.net/Daisy/archive/2005/09/29/55462.aspx Daisy Blog - E138 vim ] - remove .viminf* solution
 +
*[http://objectliteral.blogspot.com/2010/03/vim-unable-to-open-swap-file.html Object literal] - Vim, cant write to swap, create new vim swap file
 +
 +
[[Category:Linux]]

Latest revision as of 23:22, 30 March 2016

This is an error I got out of the blue every time I opened a file in vi or vim text editor via ssh console. Everything else seemed to be working okay somehow, but Vim was apparently unable to create any swap files for documents I was working on, and it could not write to the .viminfo file when I closed Vim. My problem with Vim was actually a bigger problem, my VPS was out of inodes.

E303: Unable to open swap file for "myfile.txt", recovery impossible
"myfile.txt" 27L, 1011C
E138: Can't write viminfo file /root/.viminfo!

E303 E138 Symptoms

Check for space on your disk, check for available inodes on your VPS

  • df
    • Check disk space
  • df -i
    • Check inode usage

E138 E303 Solutions

using too many inodes

My source: http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html - No space left on device running out of inodes

Inodes are mostly files. If your inodes are at 100% it is probably a program that is writing temp files and not deleting them. My problem happened to be PHP sessions that built up over time with the garbage collection turned off. Locate the files being created, then fix the program creating them. This command I copied from the link above.

$ for i in /*; do echo $i; find $i |wc -l; done

Other Solutions If your inodes and disk were not full, you may want to check out some of the links below. E138 in Vim can also come from permission problems on .viminfo, or temp files vim creates in your home directory called .viminf*

External Links