Deactivated plugin causes Error 500 on post

Since my last discourse upgrade and rebuild I can no longer post anything on my forum:

image

The error log gives me this error:

MiniRacer::RuntimeError (Error: Could not find module `pretty-text/engines/discourse-markdown/bbcode` imported from `lib/discourse-markdown/formatting_bbcode`)
JavaScript at requireFrom (<anonymous>:128:13)

It also has some of these Uncaught TypeError: Cannot read property 'addPreProcessor' of undefined but those I have been seeing for a while, so these are probably not related to what I’m seeing now. I think they are from the doi-resolver plugin which I have long deactivated.

The browser console looks like this:

Any pointers where I should start?

UPDATE: I also just noticed that my installed plugins page is not working (no plugins shown):

1 Like

‘Deactivating’ a plugin won’t necessarily protect against a lot of javascript issues. You could try uninstalling it completely.

Have you tried safe mode?

Anything in the server logs?

2 Likes

Yes, but I’ve had those errors for weeks and everything else was still working, so I’m trying to focus on the new errors first.

Just did and it doesn’t seem to change anything. (What I did is: I entered safe mode (at first only third party plugins then all) and tried to create a new topic. Result: 500 Error)

This seems more promising:

2017/08/04 15:28:47 [crit] 3950#3950: *109357 connect() to unix:/var/discourse/shared/standalone/nginx.http.sock failed (2: No such file or directory) while connecting to upstream, client: 130.241.**.**, server: forum.*********.***, request: "GET /logs/messages.json?filter=0_1_2_3_4_5&after=a74fb09d4601cbadaf2ece3db0d0c657 HTTP/2.0", upstream: "http://unix:/var/discourse/shared/standalone/nginx.http.sock:/logs/messages.json?filter=0_1_2_3_4_5&after=a74fb09d4601cbadaf2ece3db0d0c657", host: "forum.********.***", referrer: "https://forum.********.***logs"

What does it mean?

@david, is it this: Nginx.http.sock bind failed after reboot - #2 by countcb? Should I delete /var/discourse/shared/standalone/nginx.http.sock? And then what?

1 Like

I have the same Problem here since the Update today :frowning:

2 Likes

Do also have an outer NGINX with the same error in your server log?

1 Like

Update: After the Update of the Spoiler Plugin, i can post again.

1 Like

Okay, then you had a different issue. My plugins are all up to date.

Restarting the server changes nothing for me, so your issue is a different one.

1 Like

Oh, thank you. I delete the question

Sorry, outside of my area of expertise I’m afraid. It does look like the same error though, so you could give it a try (after taking backups of course)

1 Like

Since this is outside of discourse, I’m assuming that would be a backup of the entire server? Or what would you back up?

OK, tried by simply backing up /var/discourse/shared/standalone/nginx.http.sock before deleting it. I then restarted the app but to no avail. It’s still connect() to unix:/var/discourse/shared/standalone/nginx.http.sock failed

In my case I only do built-in discourse backups - I know I can follow the 30-minute install guide and get a new server working very quickly should the current one fail.

If you have something other than the standard install you’ll probably want to do more than that.

1 Like

I have a standard install with an outer NGINX reverse proxy.

This is a complete mystery to me. My current reasoning is that since

  • my nginx.http.sock has been freshly created when I restarted the container,
  • I am getting a no such file or directory error even though nginx.http.sock exists,
  • the draft of my post is successfully synced across devices, which means that data does get into the container, i.e. the error is specific to creating a post,

the source of the problem must be inside the container. This also makes sensd because I didn’t make any changes apart from upgrading and rebuilding.

Maybe I should try ./launcher cleanup? Or: how do I check the logs of the internal nginx?

That did nothing either.

I have now changed my setup from unix socket to tcp/ip but I still get error 500 when trying to post. At least we know now that the issue is not with the socket binding.

UPDATE: I noticed that after submitting the post (and clicking OK on the error 500 modal) the post is shown in grey on the actual forum page? Does this mean the text gets transmitted to the server or is this preliminary display of the post done in the browser only?

If it is a 500 error, you can look through /logs for the exact error.

To fix the Javascript errors, @david is right :arrow_down:

1 Like

I uninstalled the doi-resolver plugin completely: no change

As for the logs: everything is pointing to pretty-text/engines/discourse-markdown/bbcode as the source of errors. For example:

Job exception: Error: Could not find module `pretty-text/engines/discourse-markdown/bbcode` imported from `lib/discourse-markdown/formatting_bbcode`

Backtrace:

JavaScript at requireFrom (<anonymous>:128:13)
JavaScript at reify (<anonymous>:106:22)
JavaScript at mod.state (<anonymous>:163:17)
JavaScript at tryFinally (<anonymous>:30:14)
JavaScript at require (<anonymous>:162:5)
JavaScript at <anonymous>:262:22
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:256:in `timeout'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:175:in `block in eval'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:68:in `block in with_lock'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:68:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:68:in `with_lock'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:173:in `eval'
/var/www/discourse/lib/pretty_text.rb:189:in `block in markdown'
/var/www/discourse/lib/pretty_text.rb:390:in `block in protect'
/var/www/discourse/lib/pretty_text.rb:389:in `synchronize'
/var/www/discourse/lib/pretty_text.rb:389:in `protect'
/var/www/discourse/lib/pretty_text.rb:137:in `markdown'
/var/www/discourse/lib/pretty_text.rb:236:in `cook'
/var/www/discourse/lib/email/renderer.rb:23:in `html'
/var/www/discourse/lib/email/sender.rb:50:in `block in send'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:133:in `instance_eval'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:133:in `initialize'
/var/www/discourse/lib/email/sender.rb:48:in `new'
/var/www/discourse/lib/email/sender.rb:48:in `send'
/var/www/discourse/app/jobs/regular/user_email.rb:41:in `execute'
/var/www/discourse/app/jobs/regular/critical_user_email.rb:10:in `execute'
/var/www/discourse/app/jobs/base.rb:153:in `block (2 levels) in perform'

Or this one:

MiniRacer::RuntimeError (Error: Could not find module `pretty-text/engines/discourse-markdown/bbcode` imported from `lib/discourse-markdown/formatting_bbcode`)
JavaScript at requireFrom (<anonymous>:128:13)

Backtrace

JavaScript at requireFrom (<anonymous>:128:13)
JavaScript at reify (<anonymous>:106:22)
JavaScript at mod.state (<anonymous>:163:17)
JavaScript at tryFinally (<anonymous>:30:14)
JavaScript at require (<anonymous>:162:5)
JavaScript at <anonymous>:262:22
JavaScript at Array.forEach (<anonymous>)
JavaScript at setup (<anonymous>:260:36)
JavaScript at buildOptions (<anonymous>:100:36)
JavaScript at <anonymous>:15:17
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:176:in `eval_unsafe'
 /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:176:in `block (2 levels) in eval'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:256:in `timeout'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:175:in `block in eval'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:68:in `block in with_lock'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:68:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:68:in `with_lock'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.11/lib/mini_racer.rb:173:in `eval'
/var/www/discourse/lib/pretty_text.rb:189:in `block in markdown'
/var/www/discourse/lib/pretty_text.rb:390:in `block in protect'
/var/www/discourse/lib/pretty_text.rb:389:in `synchronize'
/var/www/discourse/lib/pretty_text.rb:389:in `protect'
/var/www/discourse/lib/pretty_text.rb:137:in `markdown'
/var/www/discourse/lib/pretty_text.rb:236:in `cook'
/var/www/discourse/plugins/poll/plugin.rb:148:in `extract'
/var/www/discourse/plugins/poll/lib/polls_validator.rb:10:in `validate_polls'
/var/www/discourse/plugins/poll/plugin.rb:322:in `block (2 levels) in activate!'
/var/www/discourse/lib/new_post_manager.rb:151:in `block in perform'
/var/www/discourse/lib/new_post_manager.rb:150:in `any?'
/var/www/discourse/lib/new_post_manager.rb:150:in `perform'
/var/www/discourse/app/controllers/posts_controller.rb:151:in `create'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/abstract_controller/base.rb:198:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal/rendering.rb:10:in `process_action'
 /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:117:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:505:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/notifications.rb:164:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/notifications.rb:164:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/abstract_controller/base.rb:137:in `process'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.9/lib/action_view/rendering.rb:30:in `process'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiling_methods.rb:76:in `block in profile_method'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal.rb:196:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_controller/metal.rb:237:in `block in action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/routing/route_set.rb:43:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/journey/router.rb:30:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/journey/router.rb:30:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/routing/route_set.rb:817:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.6.1/lib/omniauth/builder.rb:63:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/conditionalget.rb:38:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:149:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/flash.rb:260:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/query_cache.rb:36:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.7/lib/logster/middleware/reporter.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/rack/logger.rb:22:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:17:in `call_with_quiet_assets'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.9/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/methodoverride.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/runtime.rb:18:in `call'
 /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/sendfile.rb:113:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/mini_profiler/profiler.rb:171:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.2/lib/message_bus/rack/middleware.rb:62:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:73:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/engine.rb:518:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:165:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/urlmap.rb:66:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/lib/scheduler/defer.rb:85:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:702:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `load'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `d

I also noticed that this is also affecting emails: sidekiq is complaining that emails can no longer be sent. For example, there is a password reset email sitting in the “Retries” table and it has this in the error column:

Jobs::HandledExceptionWrapper: Wrapped MiniRacer::RuntimeError: Error: Could not find module `pretty-text/engines/discourse-markdown/bbcode` imported from `lib/discourse-markdown/formatting_bbcode`

It turns out that the Fomatting Toolbar plugin was the perpetrator. Deleting it from the app.yml solved the problem. It had been deactivated all along so it was not my first suspect. Also, it is a mystery to me how a deactivated plugin with such limited scope can cause so far reaching difficulties.

I shall be more wary of keeping unused plugins in my app.yml In the future.

4 Likes