Can't reply to topics in 2.5.0.beta2 ( c97244ca11 )

In my forum https://forum.rclone.org/ it appears that we can’t reply to topics

This has a relatively plain install with 3 official plugins.

The backtrace is

NoMethodError (undefined method >' for nil:NilClass) /var/www/discourse/lib/post_creator.rb:473:in update_topic_auto_close’

/var/www/discourse/lib/post_creator.rb:473:in `update_topic_auto_close'
/var/www/discourse/lib/post_creator.rb:183:in `block in create'
/var/www/discourse/lib/post_creator.rb:366:in `block (2 levels) in transaction'
activerecord-6.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:281:in `block in transaction'
activerecord-6.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/usr/local/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
activerecord-6.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
activerecord-6.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:281:in `transaction'
activerecord-6.0.1/lib/active_record/transactions.rb:212:in `transaction'
/var/www/discourse/lib/post_creator.rb:365:in `block in transaction'
/var/www/discourse/lib/distributed_mutex.rb:33:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:29:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:29:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:14:in `synchronize'
/var/www/discourse/lib/post_creator.rb:364:in `transaction'
/var/www/discourse/lib/post_creator.rb:174:in `create'
/var/www/discourse/lib/new_post_manager.rb:271:in `perform_create_post'
/var/www/discourse/lib/new_post_manager.rb:209:in `perform'
/var/www/discourse/app/controllers/posts_controller.rb:179:in `create'
actionpack-6.0.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack-6.0.1/lib/abstract_controller/base.rb:196:in `process_action'
actionpack-6.0.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack-6.0.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport-6.0.1/lib/active_support/callbacks.rb:135:in `run_callbacks'
actionpack-6.0.1/lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack-6.0.1/lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack-6.0.1/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport-6.0.1/lib/active_support/notifications.rb:180:in `block in instrument'
activesupport-6.0.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport-6.0.1/lib/active_support/notifications.rb:180:in `instrument'
actionpack-6.0.1/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack-6.0.1/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord-6.0.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack-6.0.1/lib/abstract_controller/base.rb:136:in `process'
actionview-6.0.1/lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler-2.0.1/lib/mini_profiler/profiling_methods.rb:104:in `block in profile_method'
actionpack-6.0.1/lib/action_controller/metal.rb:191:in `dispatch'
actionpack-6.0.1/lib/action_controller/metal.rb:252:in `dispatch'
actionpack-6.0.1/lib/action_dispatch/routing/route_set.rb:51:in `dispatch'
actionpack-6.0.1/lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack-6.0.1/lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack-6.0.1/lib/action_dispatch/journey/router.rb:32:in `each'
actionpack-6.0.1/lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack-6.0.1/lib/action_dispatch/routing/route_set.rb:837:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:68:in `call'
rack-2.0.8/lib/rack/tempfile_reaper.rb:15:in `call'
rack-2.0.8/lib/rack/conditional_get.rb:38:in `call'
rack-2.0.8/lib/rack/head.rb:12:in `call'
/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:318:in `call'
rack-2.0.8/lib/rack/session/abstract/id.rb:259:in `context'
rack-2.0.8/lib/rack/session/abstract/id.rb:253:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/cookies.rb:648:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport-6.0.1/lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack-6.0.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
logster-2.7.1/lib/logster/middleware/reporter.rb:43:in `call'
railties-6.0.1/lib/rails/rack/logger.rb:38:in `call_app'
railties-6.0.1/lib/rails/rack/logger.rb:28:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:18:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:31:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/var/www/discourse/lib/middleware/enforce_hostname.rb:22:in `call'
rack-2.0.8/lib/rack/method_override.rb:22:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
rack-2.0.8/lib/rack/sendfile.rb:111:in `call'
actionpack-6.0.1/lib/action_dispatch/middleware/host_authorization.rb:77:in `call'
rack-mini-profiler-2.0.1/lib/mini_profiler/profiler.rb:312:in `call'
message_bus-2.2.3/lib/message_bus/rack/middleware.rb:57:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:181:in `call'
railties-6.0.1/lib/rails/engine.rb:526:in `call'
railties-6.0.1/lib/rails/railtie.rb:190:in `public_send'
railties-6.0.1/lib/rails/railtie.rb:190:in `method_missing'
rack-2.0.8/lib/rack/urlmap.rb:68:in `block in call'
rack-2.0.8/lib/rack/urlmap.rb:53:in `each'
rack-2.0.8/lib/rack/urlmap.rb:53:in `call'
unicorn-5.5.3/lib/unicorn/http_server.rb:605:in `process_client'
unicorn-5.5.3/lib/unicorn/http_server.rb:700:in `worker_loop'
unicorn-5.5.3/lib/unicorn/http_server.rb:548:in `spawn_missing_workers'
unicorn-5.5.3/lib/unicorn/http_server.rb:144:in `start'
unicorn-5.5.3/bin/unicorn:128:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `<main>'
infobacktraceenv Solve  Remove  Protect  Copy Share
 Debug
 Info
  Warning
  Error
  Fatal

The first code link is to discourse/post_creator.rb at c97244ca115c6e8d287d9c4e6033bf3e1d084f70 · discourse/discourse · GitHub which appears that topic_timer.duration is nil.

I think this might have happened at a recent upgrade

I tried rebuilding the app from the command line but it didn’t change anything.

Any help much appreciated!

1 Like

Just noticed that this doesn’t occur on all topics, but the ones it does occur on say at the bottom “This topic will close a few seconds after the last reply.”

“A few seconds after the last reply”? That looks like a setup issue to me, these topics would be closed extremely quickly, so it’s not surprising you can’t post a reply?

2 Likes

We’ve had the same settings for months and the only change was the update that was done today.

1 Like

I tried chaning the auto close timers in the top settings but no change.

I just noticed the little trash can saying delete timer next to the “A few seconds after the last reply”

Clicking that then makes posting OK.

I think this must be a bug… This has been working fine for ages and stopped working after the update to 2.5.0.beta2 today.

1 Like

Anyone have any ideas on how to fix this? A bit of DB massaging maybe?

Might be related to @vinothkannans recent changes?

2 Likes

Yes, we already have a fix in the below open PR. It will be merged on Monday.

3 Likes

Thank you for that!

I fixed our db up with the SQL from the above. So be precise I did

Enter the postgres command line

cd /var/discourse
./launcher enter app
sudo -u postgres psql discourse

at the postgres prompt enter the SQL from the above migration. I didn’t do the first SQL part as there weren’t any matching entries.

UPDATE topic_timers SET duration = EXTRACT(EPOCH FROM execute_at - created_at) / 3600 WHERE duration IS NULL AND execute_at IS NOT NULL AND created_at IS NOT NULL;

This fixed the problems!

Thank you for your help

4 Likes