Getting "Error code: 4 (Failure)" when uploading a file to CentOS using WinSCP

16,867

So it seems that your file system is indeed full: Use% is 100% for file system /dev/vda1, which should be used by the /home/centos path

Share:
16,867

Related videos on Youtube

Vishal
Author by

Vishal

I am a person who love to ride, draw, imagine and wonder around nature. I have a positive attitude towards learning new technologies. Currently working as a Sr. Software Engineer at Wipro Technologies. My positive attitude towards life, help to cop up my daily stress and motivate me to do things which will make my present and future good.

Updated on September 18, 2022

Comments

  • Vishal
    Vishal over 1 year

    I am using WinSCP from last six months almost regularly.

    Suddenly i am facing a issue that is, I am not able to upload a file in server using it.

    Its throwing below error message:

    General failure (server should provide error description).
    Error code: 4
    Error message from server: Failure
    
    Common reasons for the Error code 4 are:
    - Renaming a file to a name of already existing file. 
    - Creating a directory that already exists.
    - Moving a remote file to a different filesystem (HDD).
    - Uploading a file to a full filesystem (HDD).
    - Exceeding a user disk quota.
    

    WinSCP log message:

    . 2017-12-15 18:06:03.081 Cached directory change via ".." to "/home/centos".
    . 2017-12-15 18:06:03.081 Getting current directory name.
    . 2017-12-15 18:06:03.095 Directory content loaded from cache.
    . 2017-12-15 18:06:03.714 Changing directory to "..".
    . 2017-12-15 18:06:03.715 Getting real path for '/home/centos/..'
    > 2017-12-15 18:06:03.715 Type: SSH_FXP_REALPATH, Size: 24, Number: 41232
    < 2017-12-15 18:06:03.723 Type: SSH_FXP_STATUS, Size: 24, Number: 40964
    . 2017-12-15 18:06:03.723 Discarding reserved response
    < 2017-12-15 18:06:04.504 Type: SSH_FXP_NAME, Size: 31, Number: 41232
    . 2017-12-15 18:06:04.504 Real path is '/home'
    . 2017-12-15 18:06:04.504 Trying to open directory "/home".
    > 2017-12-15 18:06:04.504 Type: SSH_FXP_LSTAT, Size: 14, Number: 41479
    < 2017-12-15 18:06:04.791 Type: SSH_FXP_ATTRS, Size: 37, Number: 41479
    . 2017-12-15 18:06:04.791 Getting current directory name.
    . 2017-12-15 18:06:04.791 Listing directory "/home".
    > 2017-12-15 18:06:04.792 Type: SSH_FXP_OPENDIR, Size: 14, Number: 41739
    < 2017-12-15 18:06:05.074 Type: SSH_FXP_HANDLE, Size: 13, Number: 41739
    > 2017-12-15 18:06:05.075 Type: SSH_FXP_READDIR, Size: 13, Number: 41996
    < 2017-12-15 18:06:05.358 Type: SSH_FXP_NAME, Size: 423, Number: 41996
    > 2017-12-15 18:06:05.359 Type: SSH_FXP_READDIR, Size: 13, Number: 42252
    < 2017-12-15 18:06:05.643 Type: SSH_FXP_STATUS, Size: 28, Number: 42252
    < 2017-12-15 18:06:05.643 Status code: 1
    > 2017-12-15 18:06:05.644 Type: SSH_FXP_CLOSE, Size: 13, Number: 42500
    . 2017-12-15 18:06:05.644 ..;d;0;2015-07-07T11:20:17.000Z;3;"root" [0];"root" [0];r-xr-xr-x;0
    . 2017-12-15 18:06:05.644 centos;d;0;2017-12-15T12:24:52.000Z;3;"centos" [1000];"centos" [1000];rwx------;0
    . 2017-12-15 18:06:05.644 nagios;d;0;2016-08-23T12:06:16.000Z;3;"nagios" [1001];"nagios" [1001];rwx------;0
    . 2017-12-15 18:06:08.658 Cached directory change via "centos" to "/home/centos".
    . 2017-12-15 18:06:08.658 Getting current directory name.
    . 2017-12-15 18:06:08.773 Directory content loaded from cache.
    . 2017-12-15 18:06:49.957 Copying 1 files/directories to remote directory "/home/centos/" - total size: 871
    . 2017-12-15 18:06:49.957   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: Yes; Mask: *.*
    . 2017-12-15 18:06:49.957   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
    . 2017-12-15 18:06:49.957   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
    . 2017-12-15 18:06:49.959 File: 'C:\Documents\C_Programs\Bsearch_using_recursion.txt' [2016-05-03T09:58:13.902Z] [871]
    . 2017-12-15 18:06:49.972 Copying "C:\Documents\C_Programs\Bsearch_using_recursion.txt" to remote directory started.
    . 2017-12-15 18:06:49.973 Binary transfer mode selected.
    . 2017-12-15 18:06:49.973 Opening remote file.
    > 2017-12-15 18:06:49.973 Type: SSH_FXP_OPEN, Size: 65, Number: 42755
    < 2017-12-15 18:06:49.973 Type: SSH_FXP_STATUS, Size: 24, Number: 42500
    . 2017-12-15 18:06:49.973 Discarding reserved response
    < 2017-12-15 18:06:50.256 Type: SSH_FXP_STATUS, Size: 24, Number: 42755
    < 2017-12-15 18:06:50.256 Status code: 4, Message: 42755, Server: Failure, Language:  
    . 2017-12-15 18:06:50.256 Cannot create new file "/home/centos/Bsearch_using_recursion.txt", checking if it exists already
    > 2017-12-15 18:06:50.256 Type: SSH_FXP_LSTAT, Size: 49, Number: 43015
    < 2017-12-15 18:06:50.543 Type: SSH_FXP_STATUS, Size: 29, Number: 43015
    < 2017-12-15 18:06:50.543 Status code: 2, Message: 43015, Server: No such file, Language:  
    * 2017-12-15 18:06:50.544 (ETerminal) General failure (server should provide error description).
    * 2017-12-15 18:06:50.544 Error code: 4
    * 2017-12-15 18:06:50.544 Error message from server: Failure
    * 2017-12-15 18:06:50.544 
    * 2017-12-15 18:06:50.544 Common reasons for the Error code 4 are:
    * 2017-12-15 18:06:50.544 - Renaming a file to a name of already existing file.
    * 2017-12-15 18:06:50.544 - Creating a directory that already exists.
    * 2017-12-15 18:06:50.544 - Moving a remote file to a different filesystem (HDD).
    * 2017-12-15 18:06:50.544 - Uploading a file to a full filesystem (HDD).
    * 2017-12-15 18:06:50.544 - Exceeding a user disk quota.
    . 2017-12-15 18:06:50.544 Asking user:
    . 2017-12-15 18:06:50.545 Cannot create remote file '/home/centos/Bsearch_using_recursion.txt'. ("General failure (server should provide error description).
    . 2017-12-15 18:06:50.545 Error code: 4
    . 2017-12-15 18:06:50.545 Error message from server: Failure
    . 2017-12-15 18:06:50.545 
    . 2017-12-15 18:06:50.545 Common reasons for the Error code 4 are:
    . 2017-12-15 18:06:50.545 - Renaming a file to a name of already existing file.
    . 2017-12-15 18:06:50.545 - Creating a directory that already exists.
    . 2017-12-15 18:06:50.545 - Moving a remote file to a different filesystem (HDD).
    . 2017-12-15 18:06:50.545 - Uploading a file to a full filesystem (HDD).
    . 2017-12-15 18:06:50.545 - Exceeding a user disk quota.")
    > 2017-12-15 18:06:52.975 Type: SSH_FXP_OPEN, Size: 65, Number: 43267
    < 2017-12-15 18:06:53.259 Type: SSH_FXP_STATUS, Size: 24, Number: 43267
    < 2017-12-15 18:06:53.260 Status code: 4, Message: 43267, Server: Failure, Language:  
    . 2017-12-15 18:06:53.260 Cannot create new file "/home/centos/Bsearch_using_recursion.txt", checking if it exists already
    > 2017-12-15 18:06:53.260 Type: SSH_FXP_LSTAT, Size: 49, Number: 43527
    < 2017-12-15 18:06:53.543 Type: SSH_FXP_STATUS, Size: 29, Number: 43527
    < 2017-12-15 18:06:53.543 Status code: 2, Message: 43527, Server: No such file, Language:  
    * 2017-12-15 18:06:53.544 (ETerminal) General failure (server should provide error description).
    * 2017-12-15 18:06:53.544 Error code: 4
    * 2017-12-15 18:06:53.544 Error message from server: Failure
    

    I google about the issue and found that it might be due to 100% full filesystem.

    I checked the memory using below command in centos:

    free -m
    

    Output of the command:

                  total        used        free       shared  buff/cache   available
    Mem:          32014       28612         310        1553        3091        1533
    Swap:             0           0           0
    

    It seems like that i have 1533 MP space available. But still i am not able to upload a small 1 Mb file.

    df command output:

    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/vda1       52416860 52416840        20 100% /
    devtmpfs        16374100        0  16374100   0% /dev
    tmpfs           16391320        0  16391320   0% /dev/shm
    tmpfs           16391320  1597928  14793392  10% /run
    tmpfs           16391320        0  16391320   0% /sys/fs/cgroup
    tmpfs            3278268        0   3278268   0% /run/user/1000
    tmpfs            3278268        0   3278268   0% /run/user/0
    

    Can anyone provide any info in this regard.

    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 6 years
      On CentOS run lsblk and then when you find the partition, etc. in question where the files are uploaded on the FTP server, run df /boot for example where /boot will be the actual mountpoint in question. The filesystem and memory or swap is not the same thing. Also be sure something else is not moving files from the server like an internal process as I've seen that sort of thing cause this type of problem if I recall correctly. You can probably just run df -all to see everything on the filesystem.
    • Martin Prikryl
      Martin Prikryl over 6 years
      I have already wrote you on Stack Overflow: When re-posting there [on Super User], make sure you include a main error message (what you have posted are just additional details of the error), or even better a session log file.
    • davidgo
      davidgo over 6 years
      Use the "df" command to show the amount of free disk space. The free command doesn't help as it shows RAM.
    • Vishal
      Vishal over 6 years
      @MartinPrikryl I have added the log,
  • Vishal
    Vishal over 6 years
    Is there any way to can found the main storage file, it can't delete the everything in centos.
  • Kamil Maciorowski
    Kamil Maciorowski over 6 years
    @Vishal This is Q&A site, not a forum. You asked one specific question, you got specific answer; if it answers your question then please accept it (click the tick on the left). If you have another question then ask a separate question. But do your research first; I'm pretty sure there are already questions about investigating disk usage.
  • Vishal
    Vishal over 6 years
    @KamilMaciorowski Thanks for your information