Project

General

Profile

Actions

Bug #290

closed

network_freebsd_senfile.c.176 : senfile: Operation not supported 45

Added by Anonymous over 18 years ago. Updated about 15 years ago.

Status:
Invalid
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

Using FreeBSD-5.4-STABLE and lighttpd-1.4.4
When trying to serve files located on samba mounted share within the docroot i get these errors:

--/snip/--
(response.c.393) -- handling physical path
(response.c.394) Path : /usr/local/www/data/somedir/somefile.bin
(response.c.401) -- file found
(response.c.402) Path : /usr/local/www/data/somedir/somefile.bin
(response.c.524) -- handling subrequest
(response.c.525) Path : /usr/local/www/data/somedir/somefile.bin
(mod_staticfile.c.395) -- handling file as static file
(response.c.536) -- subrequest finished
(network_freebsd_sendfile.c.176) sendfile: Operation not supported 45
(connections.c.498) connection closed: write failed on fd 8

---------------------
seems like freebsd's sendfile() returns EOPNOTSUPP?

the share is mounted in directory with the same owner as the webserver, and can be accessed by other programs or ftp.

-- niki

Actions #1

Updated by Anonymous over 16 years ago

Replying to :

Using FreeBSD-5.4-STABLE and lighttpd-1.4.4
When trying to serve files located on samba mounted share within the docroot i get these errors:

<snip>

(network_freebsd_sendfile.c.176) sendfile: Operation not supported 45
(connections.c.498) connection closed: write failed on fd 8

I'm getting something similar currently, with lighttpd 1.4.18 on Gentoo Linux, also with the web application's source files accessed through a Samba share. I've tried googling for various pieces of my log files, "lighttpd", "samba" and so forth, but so far this ticket is all I've come up with. Example in my case:


2007-12-24 11:50:38: (network_linux_sendfile.c.171) sendfile failed: Value too large for defined data type 7 
2007-12-24 11:50:38: (connections.c.603) connection closed: write failed on fd 7 

Is there maybe some inherent disagreement between samba and lighttpd that makes serving files out of samba shares unworkable? Or maybe there's some system tweak I need to make?

Communication speed between the Samba server and the lighttpd server should be pretty good, they're both blades running in the same chassis.

-- mjinks

Actions #2

Updated by darix over 16 years ago

use write(v) instead.

Actions #3

Updated by stbuehler about 16 years ago

  • Status changed from New to Fixed
  • Resolution set to invalid
Actions #4

Updated by stbuehler over 15 years ago

  • Status changed from Fixed to Invalid
Actions #5

Updated by thorsten about 15 years ago

  • Status changed from Invalid to Reopened
  • Target version set to 1.4.20

Why was the bug closed (set to "invalid") without any explanation?

I can confirm that the problem still exists with lighttpd 1.4.20 (running on Gentoo). Interestingly lighttpd 1.4.20 on Cygwin (connected to the same share on Vista via UNC path) has no problem.

Thorsten

Actions #6

Updated by darix about 15 years ago

  • Status changed from Reopened to Invalid
  • Patch available set to No

you know. lighttpd tells the operating system "use sendfile" and your OS says "i cant" which could just mean that the software you are using to mount your samba share does not support sendfile. therefor it means you have to disable sendfile and use write(v) again. that said ... nothing we can do here.

Actions #7

Updated by thorsten about 15 years ago

Please elaborate: are you referring to "server.network-backend = "writev""?!

According to the lighttpd documentation:
"lighttpd supports all major platform-specific calls:

========== ==========
OS Method ========== ==========
all write
Unix writev
Linux 2.4+ sendfile
Linux 2.6+ sendfile64
Solaris sendfilev
FreeBSD sendfile ========== ==========

The best backend is selected at compile time."

I find it highly unlikely to believe that
a) Gentoo Linux with 2.26.28 kernel and Samba 3.0.33 and mount-cifs 3.0.30 do not support sendfile while
b) Cygwin 1.5.25 does support sendfile (or is compiled with writev)

Unfortunately I'm not a developer and don't have much lighttpd experience so I cannot prove that you're wrong. Again: I find your explanation ("it's the OS or the application's fault") highly unlikely, sorry.

Actions #8

Updated by thorsten about 15 years ago

Okay, I want to change my statement about your explanation of the issue from "highly unlikely" to "not convincing"...

Actions #9

Updated by icy about 15 years ago

  • Priority changed from High to Normal
  • Target version deleted (1.4.20)

sendfile is a highly OS-specific function. It is not in the POSIX standard and has different parameters etc. on different platforms (Linux vs. FreeBSD for example).
Additionally some filesystems may not support sendfile() (on FreeBSD it returns EOPNOTSUPP).

It is unlikely that cygwin even has that function so it is probably not even enabled at compile-time, falling back to writev => no problem.

With linux, sendfile is detected as present and therefor enabled at compile-time. But it can still be not supported by the filesystem returning EINVAL (Descriptor is not valid or locked, or an mmap()-like operation is not available for in_fd.)
From the manpage:
Presently (Linux 2.6.9): in_fd, must correspond to a file which supports mmap()-like operations (i.e., it cannot be a socket); and out_fd must refer to a socket.

Actions #10

Updated by thorsten about 15 years ago

Okay, this explanation is definitely convincing (although I don't understand everything). Thanks!

Actions #11

Updated by the_undefined about 15 years ago

This problem also occurs when serving files from a host FS mount in VirtualBox. But thorsten's comment about using:

server.network-backend = "writev"

Solves the problem.

Actions

Also available in: Atom