Description of problem: since string length restrictions no longer apply, satellite allows users to create entities of HUGE length. Such entities are not able to be manipulated later on (editing, deleting), due to the fact, that the names of the entities are being used as the GET parameter of the requests. Such requests return 414 (request URI too long). Version-Release number of selected component (if applicable): 6.3 snap6 How reproducible: always Steps to Reproduce: 1. navigate to e.g. Host -> Architectures -> New architecture 2. generate a really huge string (e.g. 10000 chars) (might vary) 3. create a new architecture with generated string as a name. 4. navigate to architectures. 5. try to click (to edit) the new arch or try to delete it Actual results: 414 - request uri too long Expected results: it either works (the id is used in URI instead of a name) or the size restriction should be reintroduced.
Few observation when I looked at it. Validations are based on constrained configured in database. For some reason on 6.3 I can see that constraint is missing on architectures table (and probably elsewhere too) \d+ architectures name | character varying | not null | extended | | on my setup I can see \d+ architectures name | character varying(255) | not null implicit NULL::character varying | extended | | I have no idea why though.
Created redmine issue http://projects.theforeman.org/issues/17850 from this bug
Fix submitted upstream¸ https://github.com/theforeman/foreman/pull/4134 we removed the limit constraints on architectures and usergroups by mistake, by using change_column. Other tables in our db should be fine, I checked for modifications to the :name field and this is all I got -- change_column(:domains, :fullname, :string, {:limit=>254}) -- change_column(:media, :name, :string, {:null=>false, :default=>"", :limit=>255}) -- change_column(:architectures, :name, :string, {:default=>"x86_64", :null=>false, :limit=>255}) -- change_column(:auth_sources, :name, :string, {:null=>false, :default=>"", :limit=>255}) -- change_column(:auth_sources, :attr_firstname, :string, {:limit=>255}) -- change_column(:auth_sources, :attr_lastname, :string, {:limit=>255}) -- change_column(:domains, :fullname, :string, {:limit=>255}) -- change_column(:features, :name, :string, {:limit=>255}) -- change_column(:models, :name, :string, {:null=>false, :limit=>255}) -- change_column(:operatingsystems, :name, :string, {:limit=>255}) -- change_column(:operatingsystems, :release_name, :string, {:limit=>255}) -- change_column(:ptables, :name, :string, {:null=>false, :limit=>255}) -- change_column(:roles, :name, :string, {:limit=>255}) -- change_column(:architectures, :name, :string, {:default=>nil}) -- change_column(:audits, :auditable_name, :text) -- change_column(:usergroups, :name, :string, {:null=>false}) -- change_column_null(:operatingsystems, :name, false) -- change_column(:templates, :job_name, :string, {:default=>"Miscellaneous", :limit=>255}) -- change_column(:discovery_rules, :name, :string, {:limit=>255}) -- change_column(:discovery_rules, :hostname, :string, {:limit=>255})
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17850 has been resolved.
VERIFIED on snap #13 the length restriction is set back to 255 chars: # hammer architecture create --name='x..p' Could not create the architecture: Name is too long (maximum is 255 characters) You have new mail in /var/spool/mail/root
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. > > For information on the advisory, and where to find the updated files, follow the link below. > > If the solution does not work for you, open a new bug report. > > https://access.redhat.com/errata/RHSA-2018:0336