Error when Delete User in pending approvals list


(Stephen Chung) #1

Discourse version: v2.3.0.beta3 +21

To reproduce:

  1. Pending approvals list with topics from emailed-in staged user.

  2. Press Delete User

  3. Internal Server Error

image

  1. Error messages in console:
Error: Internal Server Error _ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:47244:14

error _application-71b3b8fd3fa7eeb4b7a922b20e95de2b8b82bb3d6f09f5fe58d72d72f11c8cf3.js:10061
  1. Topic remains in pending-approvals list.

  2. Press Delete User again. Pops up Post not found or already updated. which means that the topic has already been deleted.

  3. Go into Pending Approvals list again. It is now empty.

Note: This has not happened for a while until quite recently.


(RĂ©gis Hanol) #2

Are there any errors that could be related to that error in /logs?

The server-side might be more useful to diagnose this issue.


(Stephen Chung) #3

Nope. Doesn’t look like it. It seems to be a pure JavaScript error on the UI side.


(RĂ©gis Hanol) #4

“Internal Server Error” suggests otherwise :wink:


(Stephen Chung) #5

Looks like you’re right! There is an entry in the error log:

Error: Internal Server Error
Url: https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js
Line: 15
Column: 5392
Window Location: https://support.chenhsong.com/queued-posts
a@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:15:5392
s@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:15:5249
o@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:15:5144
trigger@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:18:7364
pe</e.prototype._onError/<@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:18:9365
y</e.prototype.invoke@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:9:11622
y</e.prototype.flush@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:9:10577
v</e.prototype.flush@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:9:12675
q</e.prototype._end@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:9:17455
q</e.prototype.end@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:9:14007
q</e.prototype._run@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:9:17961
q</e.prototype.run@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:9:14643
a@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:4:31591
e/i.error@https://support.chenhsong.com/assets/application-71b3b8fd3fa7eeb4b7a922b20e95de2b8b82bb3d6f09f5fe58d72d72f11c8cf3.js:8:clock1230  
l@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:2:7391
fireWith@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:2:8145 
r@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:3:11586
n/<@https://support.chenhsong.com/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:3:16433

(Stephen Chung) #6

Also this one:

NoMethodError (undefined method `email' for nil:NilClass)
/var/www/discourse/app/models/user.rb:1141:in `email'
/var/www/discourse/app/models/user.rb:1141:in `email'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:99:in `block in attribute'
(eval):7:in `_fast_attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:468:in `rescue in attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:455:in `attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in `_serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:448:in `block in merge_association'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:445:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:445:in `merge_association'
/var/www/discourse/lib/freedom_patches/ams_include_without_root.rb:52:in `include!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:368:in `block in include_associations!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:in `each_key'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:in `include_associations!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:362:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:343:in `as_json'
/var/www/discourse/app/controllers/application_controller.rb:429:in `serialize_data'
/var/www/discourse/app/controllers/application_controller.rb:438:in `render_serialized'
/var/www/discourse/app/controllers/queued_posts_controller.rb:50:in `update'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:194:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/rendering.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:132:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:41:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/rescue.rb:22:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.2/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:134:in `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionview-5.2.2/lib/action_view/rendering.rb:32:in `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.2/lib/mini_profiler/profiling_methods.rb:104:in `block in profile_method'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:191:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:252:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:34:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:48:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:52:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:840:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.5/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:32:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:38:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/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:216:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232:in `context'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:98:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/logster-2.1.2/lib/logster/middleware/reporter.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:28:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:16:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/var/www/discourse/lib/middleware/enforce_hostname.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.2/lib/mini_profiler/profiler.rb:281:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/message_bus-2.2.0/lib/message_bus/rack/middleware.rb:57:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:182:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:524:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/railtie.rb:190:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/railtie.rb:190:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/urlmap.rb:68:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:701:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `<main>'

Didn’t you already remove the email field in favor of multiple emails for users?


(RĂ©gis Hanol) #7

Thanks @schungx for the backtrace.

@maja can you try to reproduce this issue? I would like to understand how we can end up in a state where an user has no primary email.


(Stephen Chung) #9

A staged user? This only happens for pending posts from staged users.