Project

General

Profile

Actions

Bug #2881

closed

Error 431 - oversized request header

Added by Ireng about 6 years ago. Updated about 6 years ago.

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

Description

Hi,

i use lighttpd 1.4.45 from DEBIAN Stretch stable every since without any problems!
After the regular DEBIAN ) upgrade i access my nextcloud13 installation and lighttpd threw at me a 431 error !
Searching the forum I discovered some solutions by changing the server.max-request-size.
However, since day 1 this option is set as follows:

#file upload
server.max-request-size = 20480000
server.network-backend = "writev"

and it worked like a charm, ever since.

my lighttpd.conf looks like:

# required server modules
  server.modules = (
        "mod_auth",
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite",
        "mod_fastcgi",
        "mod_simple_vhost",
        "mod_webdav",
        "mod_status",
        "mod_setenv",
)

server.document-root="/var/www/servers" 
server.upload-dirs=("/var/www//uploads")
server.error-log="/var/log/lighttpd/error.log" 
server.pid-file ="/var/run/lighttpd.pid" 
server.username="www-data" 
server.groupname="www-data" 
server.port= 80

## where to send error-messages to
server.errorlog             = "/var/log/lighttpd/error.log" 

# index-files.names= ("index.php", "index.html","default.htm","index.lighttpd.html","/dir-generator.php")
index-files.names= ("index.php", "index.html","default.htl","index.lighttpd.html")

mimetype.use-xattr = "enable" 

mimetype.assign   = ( ".png"  => "image/png",
                      ".gif"  => "image/gif",
                      ".jpg"  => "image/jpeg",
                      ".jpeg" => "image/jpeg",
                      ".svg"  => "image/svg+xml",
                      ".svgz" => "image/svg+xml",
                      ".html" => "text/html",
                      ".css"  => "text/css",
                      ".js"   => "text/javascript",
                      ".txt"  => "text/plain",
)

url.access-deny =("~", ".inc",".htaccess", ".htpasswd", "password.txt", "username.txt", "login.txt" )                                                                               

# Configuration directives for Davdroid  Installation
#
# URl Redirector für DAVDroid Adressen
url.redirect = (
       "^/.well-known/carddav" => "/nextcloud/remote.php/dav",
       "^/.well-known/caldav" => "/nextcloud/remote.php/dav",
)

#
# Configuration directives for SSL  Installation
#

$SERVER["socket"] == ":443" {
   ssl.engine = "enable" 
   ssl.pemfile = "/etc/lighttpd/server.pem" 
}

# Zugriff von remote auf Status-Meldungen
$HTTP["remoteip"] == "192.168.175.0/24" {
        status.status-url     =  "/server-status" 
        status.statistics-url =  "/server-stats" 
        status.config-url     =  "/server-config" 
#       status.statistics-url =  "/server-counters" 
}
#Location für Virtuelle-Server (Multi-Server Konfiguration)
include_shell "/var/www/config_servers" 

#Directory Listing
# include_shell "/var/www/scripte/dir-generator.php" 

#file upload
server.max-request-size = 20480000
server.network-backend = "writev" 

PHP 7.0

Well, I am happy to receive some advice to resolve this issue at short notice!

Many thanks in advance !

regads, Ireng

Actions #1

Updated by Ireng about 6 years ago

After changing

server.max-request-size = 16777216 i restarted lighttpd and received the following messages in error.log:
(log.c.217) server started
2018-03-28 14:00:29: (mod_fastcgi.c.1485) --- fastcgi spawning local \n\tproc: /usr/bin/php-cgi7.0 \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tmax-procs: 4
2018-03-28 14:00:29: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 0 / 4
2018-03-28 14:00:29: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 1 / 4
2018-03-28 14:00:29: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 2 / 4
2018-03-28 14:00:29: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 3 / 4
2018-03-28 14:00:29: (server.c.1295) WARNING: unknown config-key: server.error-log (ignored)
2018-03-28 14:00:29: (server.c.1295) WARNING: unknown config-key: index-files.names (ignored)
2018-03-28 14:00:29: (server.c.1295) WARNING: unknown config-key: dir-listing.acivate (ignored)
2018-03-28 14:00:35: (connections.c.906) oversized request-header -> sending Status 431
2018-03-28 14:00:36: (connections.c.906) oversized request-header -> sending Status 431
2018-03-28 14:00:37: (connections.c.906) oversized request-header -> sending Status 431
2018-03-28 14:00:37: (connections.c.906) oversized request-header -> sending Status 431

Many thanks for your help !

regards, ireng

Actions #2

Updated by avij about 6 years ago

You mentioned you had been using 1.4.45 for a long time, but left out information on which version you are currently running.

https://redmine.lighttpd.net/boards/2/topics/7686 may be related. The fix is to upgrade to at least 1.4.47.

Actions #3

Updated by gstrauss about 6 years ago

  • Description updated (diff)

avij is on-point. This is probably your issue:

You mentioned you had been using 1.4.45 for a long time, but left out information on which version you are currently running.
https://redmine.lighttpd.net/boards/2/topics/7686 may be related. The fix is to upgrade to at least 1.4.47.

.

Unrelated, you have typos in your config.

2018-03-28 14:00:29: (server.c.1295) WARNING: unknown config-key: server.error-log (ignored)
2018-03-28 14:00:29: (server.c.1295) WARNING: unknown config-key: index-files.names (ignored)
2018-03-28 14:00:29: (server.c.1295) WARNING: unknown config-key: dir-listing.acivate (ignored)

server.errorlog is the correct spelling, which you have in your example above, so where is the misspelled server.error-log coming from?
index-file.names is the correct spelling.
dir-listing.activate is the correct spelling.

Actions #4

Updated by Ireng about 6 years ago

OK, thanks for your support!

I corrected the typos, however Error 431 still prevails!

Tail error.log :

2018-03-28 18:16:02: (log.c.217) server started
2018-03-28 18:16:02: (mod_fastcgi.c.1485) --- fastcgi spawning local \n\tproc: /usr/bin/php-cgi7.0 \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tmax-procs: 4
2018-03-28 18:16:02: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 0 / 4
2018-03-28 18:16:02: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 1 / 4
2018-03-28 18:16:02: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 2 / 4
2018-03-28 18:16:02: (mod_fastcgi.c.1509) --- fastcgi spawning \n\tport: 0 \n\tsocket /run/lighttpd/php.socket \n\tcurrent: 3 / 4
2018-03-28 18:16:13: (connections.c.906) oversized request-header -> sending Status 431

I am running 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3 (2017-12-03) x86_64 GNU/Linux and updeted to the most recent level.

Actions #5

Updated by Ireng about 6 years ago

I increased server.max-request-size to 65536000 ( and restarted lighttpd of course) still no change in the behaviour!

Actions #6

Updated by Ireng about 6 years ago

On my main System I use FF 59.0.2 --->Error 431 UBUNTU N16.04 LTS
On My TV I use FireOS with FF ?? ----> no problem

on my SAMSUNG Tablet ANDROID 6.0.1 incl. FF 59.0.1 ---> no problem
ON my SAMSUNG mobile ANDROID 7.0 FF 59.0.2 ---> no problem

Actions #7

Updated by avij about 6 years ago

What you would need to do is to upgrade lighttpd to 1.4.47 or newer. Current version is 1.4.49. Perhaps you should ask the Debian package maintainer about a possible update.

Actions #8

Updated by Ireng about 6 years ago

Very strange behaviour: accessing from my system my website Error 431......
Accessing from my (3) mobile system NO error at ALL!

Client problem ????

Actions #9

Updated by avij about 6 years ago

Clearing the browser's cache and periodically restarting lighttpd may help in the very short term, but the real fix is to upgrade your lighttpd to 1.4.47 or newer.

Actions #10

Updated by avij about 6 years ago

And if you had bothered reading the link I posted a few messages ago, you would have learned that the parameter that affects this is called server.max-request-field-size. The default is 8192, and setting that to something like 32768 or even higher might make those 431 errors less frequent. However, the real fix is still to upgrade lighttpd to 1.4.47 or newer.

Actions #11

Updated by Ireng about 6 years ago

@avij: many thanks for your advice! I cleared the browser cache and everything is fine again on my major system.
No mor error 431 in the logs. I'll upgrade lighttpd as soon as DEBIAN releases the next najor version.
Currently lighttpd 1.4.49 is available in the testing branch.

Many regards, Ireng

Actions #12

Updated by gstrauss about 6 years ago

  • Status changed from New to Invalid

The answer was provided concisely by @avij in the first response:

You mentioned you had been using 1.4.45 for a long time, but left out information on which version you are currently running.
https://redmine.lighttpd.net/boards/2/topics/7686 may be related. The fix is to upgrade to at least 1.4.47.

Everything else here is noise.

I am marking this ticket as invalid since a) we believe the issue is fixed since lighttpd 1.4.47, and b) even after being asked MANY times, the submitter still has yet to state exactly what version of lighttpd is in use, and from what distro (and version). Since Debian 9 still uses lighttpd 1.4.45, you might consider opening an issue with Debian asking them to upgrade or add a patch.

Actions

Also available in: Atom