Description

 For non-root users, file copy utility tries to transfer jinstall packages to user's home directory even when the destination path is specified as /var/tmp

Symptoms

  For non-root users, file copy utility tries to transfer jinstall packages to user's home directory even when the destination path is specified as /var/tmp

Solution

 

Transferring a file such as a jinstall package as Super user login (not root) from a FTP server, or any other file transfer mode, to the /var/tmp folder of the switch will fail with "filesystem is full" message, and other errors (below).

This example uses the "file copy" command:

juniper@R5_console21> file copy ftp://test:[email protected]/jinstall-ex-4200-11.4R4.5-domestic-signed.tgz /var/tmp
/var/home/juniper/...transferring.file........ 90% of 120 MB 4260 kBps 00m02s
/var: write failed, filesystem is full
/var/home/juniper/...transferring.file........ 92% of 120 MB 4277 kBps 00m02s
fetch: /var/home/juniper/...transferring.file.........XxE4vT/jinstall-ex-4200-11.4R4.5-domestic-signed.tgz: No space left on device
error: file-fetch failed
error: could not fetch local copy of file

{master:0}
juniper@R5_console21>


RESULT:
   - This is expected and this error will be seen for files that are larger than 100MB.  For files less than 100MB they will transfer fine as long as there is adequate space.


REASON:

A non-root user copying a file to the /var/tmp directory automatically attempts to save it to the /var/home/user directory instead, by design.  There is limited access to other directories when a non-root user.  The root cause for this behavior is even though we have specifically provided the path for the file as /var/tmp, it still gets saved in the /var/home/user location, and this has got a capacity of 100Mb.

Hence file transfer above 100MB would show up this error.


ROOT CAUSE:

This behavior is by design, as each file copy involves two operations.

1) To fetch the file from source and store it in home dir of the user
2) To put the file from home dir to the destination

The reason this is needed is to be able to achieve transfers in a general fashion, like when source is ftp server 1 and destination is ftp server 2. There is no way to do that in a single operation.