Created attachment 1939182 [details] production.log Description of problem: When trying to `curl -X POST` to some endpoints, e.g. `/api/hosts` or `/api/users`, without specifying `-H "Content-Type: application/json"`, the call fails with 500 ISE and this backtrace: ``` 2023-01-19T10:59:00 [I|app|59252892] Backtrace for 'Action failed' error (NoMethodError): undefined method `[]=' for nil:NilClass 59252892 | /usr/share/foreman/app/controllers/api/base_controller.rb:277:in `block in assign_lone_taxonomies' 59252892 | /usr/share/foreman/app/controllers/api/base_controller.rb:266:in `each' 59252892 | /usr/share/foreman/app/controllers/api/base_controller.rb:266:in `assign_lone_taxonomies' 59252892 | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda' [...] ``` Version-Release number of selected component (if applicable): Reproduced on Sat 6.13 snap 4.0 and 7.0, Sat 6.12 snap 16.0 and Sat 6.10.5 snap 2.0 => Doesn't seem like a regression How reproducible: Deterministic Steps to Reproduce: 1. # curl -uadmin:changeme -X POST https://$(hostname)/api/users -d '{"name": "test2"}' Actual results: { "error": {"message":"Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs."} } Expected results: { "error": {"message":"Media type in 'Content-Type: application/x-www-form-urlencoded' is unsupported in API v2 for POST and PUT requests. Please use 'Content-Type: application/json'."} } Additional info: Full traceback attached