-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
NoMethodError: undefined method rails
for nil
#2386
Comments
hmm interesting because we're already checking
Could you point to some code on your side or in a gem on how this is setup? Maybe that helps me repro. |
I wish, I would have a simple response, but unfortunately I don't. I'll try to provide some pointers and aid in answering your questions as good as possible. The app I observed the issue is CodeOcean, which is fully open source. Within the app, we allow learners to write source code and execute this code remotely (in a secure sandbox). The exception I reported here occurred during the execution of learners' code, specifically while running the During the For the learner, we setup the WebSocket connection using the For the backend service, we use Now, in this complex setup with two WebSocket connections, errors might occur. In most cases, the SDK is able to capture them and report them properly, allowing us to investigate. Still, there are occurrences where this is not the case, as reported here. While investigating for the current issue, I found another indication that the error of this issue might be related with #2378. Do you see a possible "combination", that one issue could be triggered first and the other one is just a consequence? To be very clear: The stack trace of this issue was contained in the server's log. Another error tracing tool we still have for historical reasons, however, shows the same strack trace as I included as a screenshot in #2378. To me, it currently looks like both exceptions occurred during the same request. So far, I don't have any indication yet that a non-library error caused the issue. |
this is very likely the source of the problem but I don't really know how to repro. Either way, I guess we can just add extra guards, not ideal but should hopefully fix the problem. |
Sounds good, thanks! I can also add some further log statements before the respective line, in case you are interested in some specific variables, settings, ... |
Issue Description
In my server logs (but not in Sentry), I found another
NoMethodError
: This time,rails
was called onnil
.Stack Trace of the Issue
Reproduction Steps
Unfortunately, I don't have clear reproduction steps. I know that the error occurred during this trace and doesn't occur regularly.
The issue occurred as part of a WebSocket connection in a Rack
hijack
block.Expected Behavior
No error is generated in Sentry, and
rails
can be called successfully.Actual Behavior
A
NoMethodError
is raised, see above stack trace for detailsRuby Version
3.3.4
SDK Version
5.18.2
Integration and Its Version
Rails 7.1.3.4
Sentry Config
No response
The text was updated successfully, but these errors were encountered: