Size of a request header field exceeds server limit

I’m using Keycloak for SSO using openidc and it’s redirect to Keycloak but once I submit username and password I get below error

Bad Request

Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.

and I can find it redirect alot of cookies too

I added below config in apache2.conf but without any luck
LimitRequestLine 65536
LimitRequestFieldSize 65536

Nextcloud version (eg, 10.0.2): 12.0.0.29
Operating system and version (eg, Ubuntu 16.04): Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.18
PHP version (eg, 5.6): 7.1
Is this the first time you’ve seen this error?: yes

Can you reliably replicate it? (If so, please outline steps):
I'm using Keycloak for SSO using openidc and it's redirect to Keycloak but once I submit username and password I get below error

The issue you are facing:

  Size of a request header field exceeds server limit

The output of your Nextcloud log in Admin > Logging:
nothing in error.log

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
`
<?php
$CONFIG = array (
‘instanceid’ => ‘oc5c*******’,
‘passwordsalt’ => ‘*********************’,
‘secret’ => ‘*********************’,
‘trusted_domains’ =>
array (
0 => ‘DOMAINNAME’,
1 => ‘HOSTNAME’,
),
‘datadirectory’ => ‘/var/www/nextcloud/data’,
‘overwrite.cli.url’ => ‘URL’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘12.0.0.29’,
‘dbname’ => ‘DBNAME’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘DBUSER’,
‘dbpassword’ => ‘PASSWORD’,
‘installed’ => true,
‘loglevel’ => 1,
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.distributed’ => ‘\OC\Memcache\Memcached’,
);

The output of your Apache/nginx/system log in /var/log/____:
nothing appeared in apache error log and get multi GET requests in access.log


Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

1 Like