Bug #30889
closedAPI errors since upgrade to 2.1.2
Added by Christian Meißner about 4 years ago. Updated almost 4 years ago.
Description
Since we upgrade we get some strange errors. There is no correlation in time or method we call. We get for example `internal server error` when requesting a `compute_profile`:
2020-09-21T11:39:49 [I|app|4202d8c4] Started GET "/api/compute_profiles/23" for 44.128.0.8 at 2020-09-21 11:39:49 +0000
2020-09-21T11:39:49 [I|app|4202d8c4] Processing by Api::V2::ComputeProfilesController#show as JSON
2020-09-21T11:39:49 [I|app|4202d8c4] Parameters: {"apiv"=>"v2", "id"=>"23"}
2020-09-21T11:39:49 [I|app|4202d8c4] Rendering api/v2/compute_profiles/show.json.rabl
2020-09-21T11:39:49 [I|app|4202d8c4] Rendered api/v2/compute_profiles/show.json.rabl (Duration: 19.4ms | Allocations: 4244)
2020-09-21T11:39:49 [W|app|4202d8c4] Action failed
2020-09-21T11:39:49 [I|app|4202d8c4] Rendering api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
2020-09-21T11:39:49 [I|app|4202d8c4] Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 0.7ms | Allocations: 276)
2020-09-21T11:39:49 [I|app|4202d8c4] Completed 500 Internal Server Error in 37ms (Views: 5.0ms | ActiveRecord: 12.8ms | Allocations: 13285)
With the corresponding ansible error:
fatal: [localhost]: FAILED! => {"changed": false, "error": {"message": "undefined method `detect' for #<String:0x00007f5476c41bd0>"}, "msg": "Failed to show resource: 500 Server Error: Internal Server Error for url: https://foreman.example.net/api/compute_profiles/23"}
No idea was went wrong. First of all I think we need some help in debugging this issue to give more input.
Updated by Christian Meißner about 4 years ago
Christian Meißner wrote:
Or we get an error from foreman inventory module:
After a struggle with the code we found a misleading commit which set a wrong user. Sorry for confusion.
Issue with the api calls on `compute_ressources` still exists and effects also `compute_profiles`. On both endpoints some id's produces the above error. The error occurred via cURL and Browser. If we run a while loop with the above query we get faulty and good results.
Updated by Tomer Brisker about 4 years ago
Can you please enable debug logging (https://theforeman.org/manuals/2.1/index.html#7.2Debugging), run the command again and paste the output of `production.log`?
Updated by Christian Meißner about 4 years ago
Tomer Brisker wrote:
Can you please enable debug logging (https://theforeman.org/manuals/2.1/index.html#7.2Debugging), run the command again and paste the output of `production.log`?
We run foreman-server as container not as mature system service. Is there a way to enable debug via environment variable?
Updated by Tomer Brisker about 4 years ago
I believe that `FOREMAN_LOGGING_LEVEL=debug` should work in that case
Updated by Christian Meißner about 4 years ago
Christian Meißner wrote:
Tomer Brisker wrote:
Can you please enable debug logging (https://theforeman.org/manuals/2.1/index.html#7.2Debugging), run the command again and paste the output of `production.log`?
We run foreman-server as container not as mature system service. Is there a way to enable debug via environment variable?
correct. Get debug output now:
2020-09-23T14:16:55 [D|app|a90b4b0a] Backtrace for 'Action failed' error (ActionView::Template::Error): undefined method `detect' for #<String:0x0000563b21eac600>
| /home/foreman/app/models/compute_resources/foreman/model/vmware.rb:674:in `normalize_vm_attrs'
| /home/foreman/app/models/compute_attribute.rb:36:in `normalized_vm_attrs'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/helpers.rb:16:in `data_object_attribute'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:145:in `attribute'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:116:in `block in compile_settings'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `each'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `compile_settings'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:55:in `block in to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:252:in `cache_results'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:51:in `to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:90:in `to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:50:in `block in render'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:385:in `cache_results'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:49:in `render'
| /home/foreman/config/initializers/rabl_init.rb:49:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:129:in `block in merge_engines_into_result'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:121:in `each'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:121:in `merge_engines_into_result'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:57:in `block in to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:252:in `cache_results'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:51:in `to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/multi_builder.rb:27:in `map'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/multi_builder.rb:27:in `to_a'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:92:in `to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:50:in `block in render'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:385:in `cache_results'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:49:in `render'
| /home/foreman/config/initializers/rabl_init.rb:49:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:126:in `block (2 levels) in merge_engines_into_result'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:125:in `each'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:125:in `block in merge_engines_into_result'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:121:in `each'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:121:in `merge_engines_into_result'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:57:in `block in to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:252:in `cache_results'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/builder.rb:51:in `to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:90:in `to_hash'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:103:in `to_dumpable'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:112:in `to_json'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:50:in `block in render'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:385:in `cache_results'
| /home/foreman/vendor/ruby/2.6.0/gems/rabl-0.14.3/lib/rabl/engine.rb:49:in `render'
| /home/foreman/config/initializers/rabl_init.rb:49:in `render'
| /home/foreman/app/views/api/v2/compute_profiles/show.json.rabl:3:in `_fafdc4e142b2a1c8f46da0fa491e46da'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/base.rb:274:in `_run'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/template.rb:185:in `block in render'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:182:in `instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/template.rb:385:in `instrument_render_template'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/template.rb:183:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/deface-1.5.3/lib/deface/action_view_extensions.rb:43:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/template_renderer.rb:58:in `block (2 levels) in render_template'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/abstract_renderer.rb:88:in `block in instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:180:in `block in instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:180:in `instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/abstract_renderer.rb:87:in `instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/template_renderer.rb:57:in `block in render_template'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/template_renderer.rb:65:in `render_with_layout'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/template_renderer.rb:56:in `render_template'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/template_renderer.rb:13:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/rendering.rb:117:in `block in _render_template'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/base.rb:304:in `in_rendering_context'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/rendering.rb:116:in `_render_template'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/streaming.rb:218:in `_render_template'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/rendering.rb:103:in `render_to_body'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/rendering.rb:52:in `render_to_body'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/renderers.rb:142:in `render_to_body'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/abstract_controller/rendering.rb:25:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/rendering.rb:36:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/core_ext/benchmark.rb:14:in `block in ms'
| /usr/share/ruby/benchmark.rb:308:in `realtime'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/core_ext/benchmark.rb:14:in `ms'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:44:in `block in render'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
| /home/foreman/vendor/ruby/2.6.0/gems/activerecord-6.0.3.3/lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:43:in `render'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/implicit_render.rb:35:in `default_render'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/abstract_controller/base.rb:195:in `process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/rendering.rb:30:in `process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
| /home/foreman/app/controllers/api/v2/base_controller.rb:163:in `disable_json_root'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
| /home/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
| /home/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
| /home/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
| /home/foreman/vendor/ruby/2.6.0/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
| /home/foreman/vendor/ruby/2.6.0/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:139:in `run_callbacks'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/abstract_controller/callbacks.rb:41:in `process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/rescue.rb:22:in `process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:180:in `block in instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/notifications.rb:180:in `instrument'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/activerecord-6.0.3.3/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/abstract_controller/base.rb:136:in `process'
| /home/foreman/vendor/ruby/2.6.0/gems/actionview-6.0.3.3/lib/action_view/rendering.rb:39:in `process'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal.rb:190:in `dispatch'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_controller/metal.rb:254:in `dispatch'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/route_set.rb:33:in `serve'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/mapper.rb:48:in `serve'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/journey/router.rb:49:in `block in serve'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/journey/router.rb:32:in `each'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/journey/router.rb:32:in `serve'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/routing/route_set.rb:834:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/apipie-dsl-2.2.10/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/apipie-rails-0.5.18/lib/apipie/static_dispatcher.rb:66:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/apipie-rails-0.5.18/lib/apipie/extractor/recorder.rb:137:in `call'
| /home/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/apipie-rails-0.5.18/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
| /home/foreman/lib/foreman/middleware/catch_json_parse_errors.rb:9:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/conditional_get.rb:27:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
| /home/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/cookies.rb:648:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/callbacks.rb:101:in `run_callbacks'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/railties-6.0.3.3/lib/rails/rack/logger.rb:37:in `call_app'
| /home/foreman/vendor/ruby/2.6.0/gems/railties-6.0.3.3/lib/rails/rack/logger.rb:28:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
| /home/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/request_id.rb:27:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/executor.rb:14:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/static.rb:126:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/actionpack-6.0.3.3/lib/action_dispatch/middleware/host_authorization.rb:76:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/secure_headers-6.3.1/lib/secure_headers/middleware.rb:11:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/railties-6.0.3.3/lib/rails/engine.rb:527:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/railties-6.0.3.3/lib/rails/railtie.rb:190:in `public_send'
| /home/foreman/vendor/ruby/2.6.0/gems/railties-6.0.3.3/lib/rails/railtie.rb:190:in `method_missing'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
| /home/foreman/vendor/ruby/2.6.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/puma-4.3.6/lib/puma/configuration.rb:228:in `call'
| /home/foreman/vendor/ruby/2.6.0/gems/puma-4.3.6/lib/puma/server.rb:713:in `handle_request'
| /home/foreman/vendor/ruby/2.6.0/gems/puma-4.3.6/lib/puma/server.rb:472:in `process_client'
| /home/foreman/vendor/ruby/2.6.0/gems/puma-4.3.6/lib/puma/server.rb:328:in `block in run'
| /home/foreman/vendor/ruby/2.6.0/gems/puma-4.3.6/lib/puma/thread_pool.rb:134:in `block in spawn_thread'
| /home/foreman/vendor/ruby/2.6.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2020-09-23T14:16:55 [I|app|a90b4b0a] Rendering api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
2020-09-23T14:16:55 [I|app|a90b4b0a] Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 0.8ms | Allocations: 278)
2020-09-23T14:16:55 [I|app|a90b4b0a] Completed 500 Internal Server Error in 347ms (Views: 3.9ms | ActiveRecord: 222.3ms | Allocations: 20188)
2020-09-23T14:16:55 [I|app|09bd1f55] Started GET "/api/compute_profiles/23" for 44.128.0.8 at 2020-09-23 14:16:55 +0000
2020-09-23T14:16:55 [I|app|09bd1f55] Processing by Api::V2::ComputeProfilesController#show as JSON
2020-09-23T14:16:55 [I|app|09bd1f55] Parameters: {"apiv"=>"v2", "id"=>"23"}
2020-09-23T14:16:55 [D|app|09bd1f55] Authenticated user admin against INTERNAL authentication source
2020-09-23T14:16:55 [D|app|09bd1f55] Post-login processing for admin
2020-09-23T14:16:55 [I|app|09bd1f55] Authorized user admin(Admin User)
2020-09-23T14:16:55 [D|app|09bd1f55] Post-login processing for admin
2020-09-23T14:16:55 [D|tax|09bd1f55] Current location set to none
2020-09-23T14:16:55 [D|tax|09bd1f55] Current organization set to none
2020-09-23T14:16:55 [D|tax|09bd1f55] Current location set to none
2020-09-23T14:16:55 [D|tax|09bd1f55] Current organization set to none
2020-09-23T14:16:55 [I|app|09bd1f55] Rendering api/v2/compute_profiles/show.json.rabl
2020-09-23T14:16:55 [D|app|09bd1f55] Reading from compute resource cache: folders
2020-09-23T14:16:55 [D|app|09bd1f55] Reading from compute resource cache: clusters
2020-09-23T14:16:55 [D|app|09bd1f55] Reading from compute resource cache: resource_pools-ASH
2020-09-23T14:16:55 [I|app|09bd1f55] Rendered api/v2/compute_profiles/show.json.rabl (Duration: 13.7ms | Allocations: 8827)
2020-09-23T14:16:55 [W|app|09bd1f55] Action failed
Updated by Christian Meißner about 4 years ago
It seems to be a cache problem. If we disable caching for our compute resources (vmware) the api call are slowed down a bit but it seems to work stable.
Updated by Tomer Brisker about 4 years ago
- Description updated (diff)
- Category changed from API to Compute resources - VMware
moving to the vmware component, and cleaned up the description to remove the user issue which turned out to be a configuration error.
Updated by Ondřej Ezr about 4 years ago
Can you please share what caching system do you use?
Updated by Christian Meißner about 4 years ago
Ondřej Ezr wrote:
Can you please share what caching system do you use?
We use redis as caching system.
Updated by Ondřej Ezr about 4 years ago
Hi,
sorry for the delay, I've tried to use a redis cache in all different forms, even changing its config and it seems to be working properly for me.
Could you try to refresh the cache by running `Rails.cache.clear` from `foreman-rake console` if that helps?
Updated by Christian Meißner about 4 years ago
Ondřej Ezr wrote:
Could you try to refresh the cache by running `Rails.cache.clear` from `foreman-rake console` if that helps?
Okay, we're running our installation in different containers. Where exactly we have to run the command? And what is the command intended for?
Updated by Ondřej Ezr about 4 years ago
After bit more digging, I would guess it is caused by:
https://stackoverflow.com/questions/24226413/rails-cache-doesnt-return-as-objects-but-strings
in combination with
https://community.theforeman.org/t/foreman-1-20-2-vmware-sporadic-http-500-when-querying-api-compute-resources-api/13907/21
And I think the possible solution could be https://github.com/fog/fog-vsphere/pull/267
Updated by The Foreman Bot almost 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ondřej Ezr
- Pull request https://github.com/theforeman/foreman/pull/8218 added
Updated by Ondřej Ezr almost 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|ab9fa4a33f1d6333d80096cfe28846f386768bd6.