Upcoming events shows 500 server error

If I click on “Upcoming events” - I guess this is provided by discourse-events, I got 500 server error:

Started GET "/discourse-post-event/events.json" for 91.37.126.155 at 2022-03-15 19:02:36 +0000
Processing by DiscoursePostEvent::EventsController#index as JSON
  Rendered text template (Duration: 0.0ms | Allocations: 1)
Completed 500 Internal Server Error in 913ms (ActiveRecord: 0.0ms | Allocations: 82862)
NoMethodError (undefined method `>=' for nil:NilClass)
(eval):17:in `_fast_attributes'
app/controllers/application_controller.rb:395:in `block in with_resolved_locale'
app/controllers/application_controller.rb:395:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:355:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:177:in `call'

Using discourse 2.7.12 together with discourse-calender 0.2 and discourse-saml 0.1

Somebody know how to fix the issue?

2 Likes

Can you reproduce on our default release channel (tests-passed) ?

1 Like

Sorry. Unfortunately, I can not reproduce this on another release. This is a production system which will be updated to 2.8.X “soon-ish” :slight_smile:

Maybe someone else can verify/test if this happens with current release version, too. Or someone with great experience in the code can validate that this should not occur.

The interesting thing is, with some user accounts this issue occurs, with some others not. Can not find the cause why.

1 Like

For my part I’m having the error too and I’m on 2.9.0Beta2.
looking in /logs I can find this anytime I’m trying to see the upcoming events:

NoMethodError (undefined method `>=' for nil:NilClass)
(eval):17:in `_fast_attributes'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:358:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:198:in `call'

After testing, I was unable to reproducer this error on the current Discourse release.

Discourse - 2.9.0.beta2
Discourse Calendar - v0.2
Microsoft Windows 10 Pro - Version 10.0.18363 Build 18363
Google Chrome - Version 99.0.4844.74

Navigating to [discourse.example.com]/upcoming-events appears to work correctly and displays the calendar as intended.

2 Likes

Hmm… ok.

I feel like there’s an issue on my instance, like the calendar is searching for a post that, for some reason, is missing.

Is there a way to understand what this NoMethodError (undefined method `>=' for nil:NilClass)
actually means ?

What would be the way to debug from here ?

You could try safe mode [YourSite]/safe-mode with the themes and unofficial plugins disabled and see if that can narrow it down to one of them interfering?

1 Like

I didn’t know about the safe mode, very interesting.

Unfortunately, I still have the error message :frowning:

Just noticed that I’m not facing this issue with Chromium. This could be a workaround for others.
My main browser is Firefox-esr (91.8.0esr) running on debian 11

I’m working together with @sbernhard at the same discourse instance (2.7.12) - as a moderator, I’m not a developer/admin. Until now, the “500 Internal Server Error” appeared at accounts with moderation rights. Normal users seemingly don’t get this error - they can access “Upcoming events” at the same moment, accounts with moderation rights is shown the error (at least, we didn’t receive other error reports yet).

As moderator, I get the error with Firefox 100, Edge 101 and up to date Chromium 101 on Windows 10 Pro, but as well on Ubuntu with Firefox. With a standard user account I don’t get the error on the same systems.

Did you find a solution to this @Sticchio / @sbernhard ?

Currently got a similar issue on one of my sites.

No, unfortunately not. The error still occurs. But we’re still on Discourse 2.8.10. I don’t know, if it was fixed in a later Version.

1 Like

I’m still getting this error

I’m on Discourse 3.2.0.beta1-dev and Chromium 116.

Can anyone else reproduce it?

Yes.
Same version for Discourse and Chromium. Also same issue with Firefox 116

1 Like