Since my last discourse upgrade and rebuild I can no longer post anything on my forum:
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.
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"
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)
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.
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?
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?
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)
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.