500 Internal Server Error when voting on a poll

When voting on a poll, all users of my instance get a 500 server error.

There’s an error in the logs:

Message (4 copies reported)

ArgumentError (comparison of Integer with nil failed)
app/controllers/application_controller.rb:387:in `block in with_resolved_locale'
app/controllers/application_controller.rb:387: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:356: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'

Backtrace

plugins/poll/lib/poll.rb:318:in `<'
plugins/poll/lib/poll.rb:318:in `validate_votes!'
plugins/poll/lib/poll.rb:19:in `block in vote'
plugins/poll/lib/poll.rb:368:in `block in change_vote'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
activesupport (6.1.4.1) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'

Env

HTTP HOSTS: forum.internet-czas-dzialac.pl

I’m on the recent versions of the software:

discourse 23b75d8a2b
docker_manager e5ff940
discourse-chat-integration 693c7e9
styleguide 23b75d8a

What can I do to troubleshoot it?

2 Likes

Can you reproduce it in a brand new post? Can you repro on meta? What is the Poll markup?

1 Like

Repro on meta (leave out the min attribute)

[poll type=multiple results=always max=2 chartType=bar]
* a
* b
[/poll]
  • a
  • b

0 voters

Caused by this commit, min is not checked for existence here @tgxworld .

6 Likes

Thanks! We will get this sorted early next week.

5 Likes

This will be fixed in

@kuba-orlik Thank you for reporting and @RGJ thank you for debugging.

4 Likes

The error message for the test poll above is now

param is missing or the value is empty: options Did you mean? action post_id controller poll_name

which is a really confusing error.

Can you provide me with the reproduction step? I can’t seem to get the error which you mentioned above.

Sure.

  1. Press the button.

firefox_xbAvsVUYLA

2 Likes

O icic this is a different bug because you’re not allowed to vote on a poll without selecting any options.

This will be fixed in

4 Likes

This topic was automatically closed after 4 days. New replies are no longer allowed.