Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileNotFoundException (File too large)

I am getting this exception when trying to download a file

Caused by: java.io.FileNotFoundException: /repository/PWWVFSYWDW0STLHYVEEKHMYBXZTTETGROCQ4FGdsadadaXR1407709207964905350810526.jpg (File too large)
at java.io.FileOutputStream.open(Native Method)

It is clear that file the exists. In addition to that, the same program works properly on my PC, but there is a problem with the server, which is Unix

Any ideas what might be causing this?

like image 672
Poyraz Avatar asked Aug 11 '14 11:08

Poyraz


2 Answers

I think that this is an obscure error that is actually coming from the OS level or the JVM's native code implementation. The message "File too large" is the error message that you would get if the perror C library method was used to render the EFBIG error number.

Now ordinarily, this should not happen. According to the UNIX / Linux manual entries, the various open library calls should not fail with EFBIG.

However, I have seen various error reports that imply that fopen (etcetera) can fail like that on some file systems, and/or when the a C / C++ program has been built with 64bit file size support disabled.


So what does this mean?

It is not clear, but I suspect that it means that you are either:

  • using a flaky implementation of Java,

  • running a flaky release of UNIX / Linux, or

  • you are trying to use some type of file system that is not well supported by your server's OS. (Might it be on a FUSE file system?)

A possibly related Java bug:

  • http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7009975 (Java 7 on Solaris.)
like image 88
Stephen C Avatar answered Oct 14 '22 00:10

Stephen C


So , it is solved. The problem is that, disk is full as a result stream takes long time, I clean up the disk after that there is no problem,

like image 38
Poyraz Avatar answered Oct 13 '22 22:10

Poyraz