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

Error: undefined method relationship for "":String .../lib/jsonapi/path_segment.rb:33:in eql? #1377

Closed
3 of 7 tasks
reachire-smendola opened this issue Nov 15, 2021 · 1 comment

Comments

@reachire-smendola
Copy link

reachire-smendola commented Nov 15, 2021

This issue is a (choose one):

  • Problem/bug report.
  • Feature request.
  • Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.

Checklist before submitting:

  • I've searched for an existing issue.
  • I've asked my question on Gitter and have not received a satisfactory answer.
  • I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

Bug reports:

Occasionally, the server starts giving errors like this:

rails_1      | E, [2020-05-12T14:34:02.613861 #1] ERROR -- : [cbd6c33b-0846-4e3c-8477-1831b935119b] Internal Server Error: undefined method `relationship' for "":String /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/path_segment.rb:33:in `eql?'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:123:in `has_key?'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:123:in `add_join_details'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:179:in `block (2 levels) in perform_joins'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:144:in `each'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:144:in `block in perform_joins'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:143:in `each'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:143:in `perform_joins'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation/join_manager.rb:41:in `join'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation_resource.rb:720:in `apply_joins'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation_resource.rb:695:in `apply_request_settings_to_records'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation_resource.rb:400:in `find_related_monomorphic_fragments'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/active_relation_resource.rb:223:in `find_included_fragments'
rails_1      | /usr/local/bundle/bundler/gems/jsonapi-resources-25911bc19871/lib/jsonapi/processor.rb:441:in `block in load_included'

https://sentry.io/share/issue/b7f7c312a14e43aabd7e8c982613a4c6/

When it starts happening, it seems to continue to happen, but restarting the server clears it up (until it happens again radomly some time later). This has the feel of a caching bug? or perhaps something related to loading?

This started happening after upgrading Ruby from 2.6 to 2.7. Another user reported seeing the same issue on Gitter, and for them it cleared up after downgrading Ruby. I would like to avoid doing that as there are features in 2.7 I'm already using.

@reachire-smendola
Copy link
Author

I see now this is a dupe of #1333 , now fixed.

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

1 participant