ncbo / bioportal-project

Serves to consolidate (in Zenhub) all public issues in BioPortal
BSD 2-Clause "Simplified" License
7 stars 5 forks source link

intermittent errrors with updating user account settings in the UI #320

Closed alexskr closed 1 day ago

alexskr commented 1 month ago

We are seeing intermittent server errors when updating user account settings in the UI. https://bioportal.bioontology.org/accounts/username/edit

UI logs show:

F, [2024-07-24T00:14:50.322039 #2149666] FATAL -- : [db770e67-86f6-4472-a985-be5efd0dee56]
[db770e67-86f6-4472-a985-be5efd0dee56] ActionView::Template::Error (Problem retrieving:
https://data.bioontology.org/users?include=all

Error: undefined method `bytesize' for nil:NilClass
/srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/lz4-ruby-0.3.3/lib/lz4-ruby.rb:21:in `decompress'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/lz4-ruby-0.3.3/lib/lz4-ruby.rb:36:in `uncompress'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/middleware/faraday-object-cache.rb:190:in `cache_read_compressed'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/middleware/faraday-object-cache.rb:155:in `cache_read'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/middleware/faraday-object-cache.rb:50:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/middleware/faraday-last-updated.rb:16:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/middleware/faraday-slices.rb:16:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/middleware/faraday-user-apikey.rb:16:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/faraday-2.7.12/lib/faraday/rack_builder.rb:153:in `build_response'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/faraday-2.7.12/lib/faraday/connection.rb:444:in `run_request'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/faraday-2.7.12/lib/faraday/connection.rb:200:in `get'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/http.rb:66:in `get'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/collection.rb:43:in `entry_point'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/collection.rb:56:in `all'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/collection.rb:70:in `where'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/bundler/gems/ontologies_api_ruby_client-027c749f5de3/lib/ontologies_api_client/collection.rb:79:in `find'
        /srv/ontoportal/bioportal_web_ui/releases/20240723044713/app/helpers/application_helper.rb:41:in `get_username'
        /srv/ontoportal/bioportal_web_ui/releases/20240723044713/app/views/notes/_list.html.haml:57:in `block in _app_views_notes__list_html_haml___798291746972215074_166260'
        /srv/ontoportal/bioportal_web_ui/releases/20240723044713/app/views/notes/_list.html.haml:44:in `each'
        /srv/ontoportal/bioportal_web_ui/releases/20240723044713/app/views/notes/_list.html.haml:44:in `_app_views_notes__list_html_haml___798291746972215074_166260'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/base.rb:244:in `public_send'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/base.rb:244:in `_run'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/template.rb:157:in `block in render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `block in instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/template.rb:361:in `instrument_render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/template.rb:155:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/partial_renderer.rb:251:in `block in render_partial_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `block in instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/partial_renderer.rb:237:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/renderer.rb:27:in `render_to_object'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/renderer.rb:22:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/base.rb:270:in `in_rendering_context'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/helpers/rendering_helper.rb:33:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/haml-5.2.2/lib/haml/helpers/action_view_mods.rb:13:in `block in render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/haml-5.2.2/lib/haml/helpers.rb:93:in `non_haml'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/haml-5.2.2/lib/haml/helpers/action_view_mods.rb:13:in `render'
        /srv/ontoportal/bioportal_web_ui/releases/20240723044713/app/views/ontologies/visualize.html.haml:103:in `_app_views_ontologies_visualize_html_haml__2025469074089105435_166140'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/base.rb:244:in `public_send'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/base.rb:244:in `_run'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/template.rb:157:in `block in render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `block in instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/template.rb:361:in `instrument_render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/template.rb:155:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/template_renderer.rb:65:in `block (2 levels) in render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `block in instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/template_renderer.rb:60:in `block in render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/template_renderer.rb:75:in `block in render_with_layout'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `block in instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/template_renderer.rb:74:in `render_with_layout'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/template_renderer.rb:59:in `render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/template_renderer.rb:11:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/rendering.rb:117:in `block in _render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/base.rb:270:in `in_rendering_context'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/rendering.rb:116:in `_render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/streaming.rb:216:in `_render_template'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/rendering.rb:103:in `render_to_body'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/rendering.rb:158:in `render_to_body'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/renderers.rb:141:in `render_to_body'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/abstract_controller/rendering.rb:27:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/rendering.rb:139:in `render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/instrumentation.rb:22:in `block (2 levels) in render'
        /usr/local/rbenv/versions/3.0.6/lib/ruby/3.0.0/benchmark.rb:308:in `realtime'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/core_ext/benchmark.rb:14:in `ms'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/instrumentation.rb:22:in `block in render'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/instrumentation.rb:91:in `cleanup_view_runtime'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activerecord-7.0.8/lib/active_record/railties/controller_runtime.rb:39:in `cleanup_view_runtime'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/instrumentation.rb:21:in `render'
        /srv/ontoportal/bioportal_web_ui/releases/20240723044713/app/controllers/ontologies_controller.rb:155:in `classes'
        /srv/ontoportal/bioportal_web_ui/releases/20240723044713/app/controllers/ontologies_controller.rb:292:in `show'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/abstract_controller/base.rb:215:in `process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/rendering.rb:165:in `process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/abstract_controller/callbacks.rb:234:in `block in process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actiontext-7.0.8/lib/action_text/rendering.rb:20:in `with_renderer'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actiontext-7.0.8/lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:127:in `instance_exec'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:138:in `run_callbacks'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/abstract_controller/callbacks.rb:233:in `process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/rescue.rb:23:in `process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `block in instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/notifications.rb:206:in `instrument'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/instrumentation.rb:66:in `process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activerecord-7.0.8/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/abstract_controller/base.rb:151:in `process'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionview-7.0.8/lib/action_view/rendering.rb:39:in `process'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal.rb:188:in `dispatch'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_controller/metal.rb:251:in `dispatch'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/routing/route_set.rb:32:in `serve'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/journey/router.rb:50:in `block in serve'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/journey/router.rb:32:in `each'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/journey/router.rb:32:in `serve'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/routing/route_set.rb:852:in `call'
     /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/rack/browser_monitoring.rb:38:in `traced_call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/rack-2.2.8/lib/rack/tempfile_reaper.rb:15:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/rack-2.2.8/lib/rack/etag.rb:27:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/rack-2.2.8/lib/rack/conditional_get.rb:27:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/rack-2.2.8/lib/rack/head.rb:12:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/http/permissions_policy.rb:38:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/http/content_security_policy.rb:36:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:266:in `context'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/rack-2.2.8/lib/rack/session/abstract/id.rb:260:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/middleware/cookies.rb:704:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/newrelic_rpm-9.6.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/actionpack-7.0.8/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
        /srv/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.8/lib/active_support/callbacks.rb:99:in `run_callbacks'
...

[db770e67-86f6-4472-a985-be5efd0dee56]     54:                   - if note.archived
[db770e67-86f6-4472-a985-be5efd0dee56]     55:                     archived
[db770e67-86f6-4472-a985-be5efd0dee56]     56:               %td
[db770e67-86f6-4472-a985-be5efd0dee56]     57:                 = get_username(note.creator)
[db770e67-86f6-4472-a985-be5efd0dee56]     58:               %td
[db770e67-86f6-4472-a985-be5efd0dee56]     59:                 = note.proposal ? get_note_type_text(note.proposal.type) : "Comment"
[db770e67-86f6-4472-a985-be5efd0dee56]     60:               %td
[db770e67-86f6-4472-a985-be5efd0dee56]
[db770e67-86f6-4472-a985-be5efd0dee56] app/helpers/application_helper.rb:41:in `get_username'
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:57
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:44:in `each'
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:44
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/ontologies/visualize.html.haml:103
[db770e67-86f6-4472-a985-be5efd0dee56] app/controllers/ontologies_controller.rb:155:in `classes'
[db770e67-86f6-4472-a985-be5efd0dee56] app/controllers/ontologies_controller.rb:292:in `show'

It appears that UI errors out when API responds with 304 for /users?include=all call:

123.123.123.123 - username [24/Jul/2024:15:32:00 -0700] "GET /users?include=all HTTP/1.0" 304 - 0.8775

and UI doesn't error out when API responds with 200

123.123.123.123 - username [24/Jul/2024:15:33:48 -0700] "GET /users?include=all HTTP/1.0" 304 - 0.6316
123.123.123.123 - username [24/Jul/2024:15:33:48 -0700] "GET /users?include=all HTTP/1.0" 200 20389263 0.5943
alexskr commented 1 month ago

BioPortal has 17K users so getting all users to change a single user is not ideal.

/users API call sends about 20Mb response back to the client; I'm not sure how big that object would be, but it might not get cached on the UI side since memcached is currently configured to cache objects with a size up to 5Mb.

ontologies_api_ruby_client optimizations might be beneficial in dealing with this issue. https://github.com/ontoportal-lirmm/ontologies_api_ruby_client/pull/14

jvendetti commented 1 day ago

This stack trace originates from the get_username method:

[db770e67-86f6-4472-a985-be5efd0dee56] app/helpers/application_helper.rb:41:in `get_username'
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:57
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:44:in `each'
[db770e67-86f6-4472-a985-be5efd0dee56] app/views/notes/_list.html.haml:44

This method is invoked within a loop when rendering notes for a class or ontology. Each time, it issued a separate find call to the ontologies_api_client library to retrieve the author name for each note. However, the find method in the library was inefficient—it fetched all users and then filtered through them to find the requested user.

In version 2.4.0 of the library, this has been refactored to improve performance.

Additionally, the get_username method was updated in this commit to eliminate the unnecessary REST calls.

A similar stack trace occurred when users attempted to update their account settings. This is mitigated by the above mentioned performance improvements in the ontologies_api_client library, and a change to the UsersController to disable a full cache refresh when updating a single user.