Preview Hosts HTTP 414 Request-URI Too Long

Problem:
I can’t preview hosts after search query when i want to run a job template.

Expected outcome:
I can preview all hosts.

Foreman and Katello versions:
Foreman 3.4
Katello 4.6

Chrome Debug
I can find “http 414 Request-URI Too Long” when I use chrome debug


My Tries
I increase http “LimitRequestFieldSize” and “LimitRequestFields”.
But it didn’t work for me. The issue still exist now.

[root@foreman-server httpd]# cd /etc/httpd/conf
[root@foreman-server conf]# grep Limit httpd.conf
LimitRequestFieldSize 8190
LimitRequestFields 100
[root@foreman-server conf]# vim httpd.conf
[root@foreman-server conf]# grep Limit httpd.conf
LimitRequestFieldSize 40960
LimitRequestFields 40960


[root@foreman-server conf]# foreman-maintain service restart --only httpd.service
Running Restart Services
================================================================================
Check if command is run as root user:                                 [OK]
--------------------------------------------------------------------------------
Restart applicable services: 

Stopping the following service(s):
httpd.service
| All services stopped                                                          

Starting the following service(s):
httpd.service
/ All services started                                                [OK]      
--------------------------------------------------------------------------------

Hi @Shinefire ,

@MariaAga , have you seen this issue before?

I’ll add that, as of (I believe) Foreman 3.5, we have a new job invocation wizard that should take care of your issue here.

Thanks for the tag, we didnt see this before but it might happen to some users while using the old form. Opened Fixes #36252 - send only necessary fields to preview_hosts by MariaAga · Pull Request #802 · theforeman/foreman_remote_execution · GitHub to fix it. The new wizard is using different code and doesnt have this issue.