Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account settings pages intermittently inaccessible #398

Open
jvendetti opened this issue Mar 4, 2025 · 3 comments
Open

Account settings pages intermittently inaccessible #398

jvendetti opened this issue Mar 4, 2025 · 3 comments
Assignees

Comments

@jvendetti
Copy link
Member

Steps to reproduce:

  1. Login to BioPortal (any account type, doesn't have to be an admin)
  2. In the top-right, select your username -> Account settings from the dropdown menu

Notice that BioPortal displays the "We're sorry but something has gone wrong" message -- the result of a 500 internal server error. This is reproducible in production and staging, but not my local development environment. The internal server error happens very frequently, essentially rendering it impossible to view your account settings in BioPortal.

Full stack trace from production log file:

I, [2025-03-04T12:41:06.998537 #4985]  INFO -- : [1f99df64-0464-4f85-8c79-c4b63b59e749] Started GET "/account" for 10.130.27.10 at 2025-03-04 12:41:06 -0800
I, [2025-03-04T12:41:06.999748 #4985]  INFO -- : [1f99df64-0464-4f85-8c79-c4b63b59e749] Processing by HomeController#account as HTML
I, [2025-03-04T12:41:07.009333 #4985]  INFO -- : [1f99df64-0464-4f85-8c79-c4b63b59e749] Completed 500 Internal Server Error in 9ms (ActiveRecord: 0.0ms | Allocations: 6007)
F, [2025-03-04T12:41:07.073570 #4985] FATAL -- : [1f99df64-0464-4f85-8c79-c4b63b59e749]
[1f99df64-0464-4f85-8c79-c4b63b59e749] NoMethodError (Problem retrieving:
https://data.bioontology.org/users?/https://data.bioontology.org/users/vendettiinclude=all

Error: undefined method `bytesize' for nil:NilClass

    in_size = input.bytesize if in_size == nil
                   ^^^^^^^^^
/opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/lz4-ruby-0.3.3/lib/lz4-ruby.rb:21:in `decompress'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/lz4-ruby-0.3.3/lib/lz4-ruby.rb:36:in `uncompress'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-object-cache.rb:190:in `cache_read_compressed'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-object-cache.rb:155:in `cache_read'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-object-cache.rb:50:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-last-updated.rb:16:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-slices.rb:16:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-user-apikey.rb:16:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/rack_builder.rb:152:in `build_response'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/connection.rb:452:in `run_request'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/connection.rb:200:in `get'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/http.rb:68:in `get'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/collection.rb:88:in `get'
        /opt/ontoportal/bioportal_web_ui/releases/20250226005827/app/controllers/home_controller.rb:105:in `account'

Same error, different user account:

I, [2025-03-04T01:49:48.828488 #4964]  INFO -- : [ba5d8b39-bb75-4ef4-ad18-051e2edf0f95] Processing by HomeController#account as HTML
I, [2025-03-04T01:49:48.838331 #4964]  INFO -- : [ba5d8b39-bb75-4ef4-ad18-051e2edf0f95] Completed 500 Internal Server Error in 10ms (ActiveRecord: 0.0ms | Allocations: 5788)
F, [2025-03-04T01:49:48.849633 #4964] FATAL -- : [ba5d8b39-bb75-4ef4-ad18-051e2edf0f95]
[ba5d8b39-bb75-4ef4-ad18-051e2edf0f95] NoMethodError (Problem retrieving:
https://data.bioontology.org/users?/https://data.bioontology.org/users/Natalia1712include=all

Error: undefined method `bytesize' for nil:NilClass

    in_size = input.bytesize if in_size == nil
                   ^^^^^^^^^
/opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/lz4-ruby-0.3.3/lib/lz4-ruby.rb:21:in `decompress'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/lz4-ruby-0.3.3/lib/lz4-ruby.rb:36:in `uncompress'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-object-cache.rb:190:in `cache_read_compressed'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-object-cache.rb:155:in `cache_read'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-object-cache.rb:50:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-last-updated.rb:16:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-slices.rb:16:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/middleware/faraday-user-apikey.rb:16:in `call'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/rack_builder.rb:152:in `build_response'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/connection.rb:452:in `run_request'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/connection.rb:200:in `get'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/http.rb:68:in `get'
        /opt/ontoportal/bioportal_web_ui/shared/bundle/ruby/3.1.0/bundler/gems/ontologies_api_ruby_client-694648f7b6dc/lib/ontologies_api_client/collection.rb:88:in `get'
        /opt/ontoportal/bioportal_web_ui/releases/20250226005827/app/controllers/home_controller.rb:105:in `account'
@jvendetti jvendetti changed the title Account settings pages intermittently inaccessible in production / staging Account settings pages intermittently inaccessible Mar 4, 2025
@syphax-bouazzouni
Copy link
Contributor

in the logs we see this url https://data.bioontology.org/users?/https://data.bioontology.org/users/vendettiinclude=all, maybe the issue is in that link, it should be https://data.bioontology.org/users?/https://data.bioontology.org/users/vendetti?include=all, with ?include=all (the ? was missing).

@alexskr
Copy link
Member

alexskr commented Mar 5, 2025

Shouldn't that API call be https://data.bioontology.org/users/<username>?include=all?

I don't think https://data.bioontology.org/users/?https://data.bioontology.org/users/<username> is a valid call to begin with. The /users endpoint expects a user_id, not an URI of the user.

API also has an issue here, when I make an API call https://data.bioontology.org/users/?https://data.bioontology.org/users/<username>?include-all, I get back all users, which is not what we want. The API should probably return an "invalid request" error instead.

could this be related to #369 where API calls get mingled and unrelated parameter gets injected into the request

@jvendetti
Copy link
Member Author

(the ? was missing)

I had to replace the shovel operator with plus equals in a line in ontologies_api_client that adds a question mark character to an exception message. It was throwing a FrozenError after the upgrade from Ruby 3.0 to 3.1.

@jvendetti jvendetti self-assigned this Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants