Help needed - A plugin code causing discourse instance crash

(Rahul) #1

I have written a plugin which display latest 5 topics as per the category of topic on topic pages for web spiders but after sometime my discourse instance automatically gets crash and website got down then I have to restart the docker then again it will run for sometime and crash again randomly and there is no error related to my plugin in error logs

I would really thankful if somebody can point out how can I fix this problem, here is my code snipped:

I have created a plugin file under:

My Code Snipped:

(Rahul) #2

@techAPJ could you please suggest why the system is crashing by using above code? Thanks

(Erick Guan) #3

I believe you can find error logs under the shared folder. It seems a file called production.error.log or production.log

(Rahul) #4

I am looking for error at but it does not show any error related to my plugin, the website just gets randomly crash and webpage returns 504 error

(Erick Guan) #5

Nah. You have to go to /var/discourse/shared to look for the actual log file. If the site is broken, it can still generate right log meesages.

(Rahul) #7

@fantasticfears production_errors.log is blank and production.log does not contain any errored log related to my plugin, in all the log entries it is showing Completed 200 OK

(Erick Guan) #8

What about unicorn.log?

(Rahul) #9

unicorn also does not have any error related to my plugin :frowning:

(Rahul) #10

I have added these lines on top of my code:
require 'open-uri’
require ‘net/http’

Now system is not getting down after every 20mins but it is still getting down after 24-30 hrs

Is there any other way I can fetch category wise list of questions apart from what I have used by calling a rest API?