montera34 / pageonex

PageOneX. Analyzing front pages
http://pageonex.com
GNU Affero General Public License v3.0
54 stars 13 forks source link

500 Internal Server Error after expanding a thread one day #166

Closed numeroteca closed 10 years ago

numeroteca commented 11 years ago

Not enough memory

elplatt commented 11 years ago

After reproducing the problem, tailing /var/log/apache2/error.log showed this error:

Error opening file for reading: Permission denied

I'm not sure which file was the problem, but after adding read permissions for the entire app, the problem seems to be fixed.

numeroteca commented 11 years ago

I still have the problem when adding days to a thread. I added 1 day to http://pageonex.com/numeroteca/geziparki/ and it gave me the same 500 Internal Server Error.

Then, once I reload twice, it worked. Here is the log:

Started GET "/numeroteca/geziparki/" for 83.60.24.174 at 2013-07-04 01:10:57 +0000 Processing by CodingController#display as HTML Parameters: {"username"=>"numeroteca", "thread_name"=>"geziparki"}

it crashed here, then I reloaded again.

Started GET "/numeroteca/geziparki/" for 83.60.24.174 at 2013-07-04 01:11:23 +0000 Processing by CodingController#display as HTML Parameters: {"username"=>"numeroteca", "thread_name"=>"geziparki"} Rendered coding/_coding_footer.html.erb (0.9ms) Rendered coding/display.html.erb within layouts/application (1854.2ms) Completed 200 OK in 12721ms (Views: 1733.6ms | ActiveRecord: 1691.1ms)

rahulbot commented 10 years ago

I pulled down the production db so I could try this locally. It worked fine, but executed a crazy amount of queries. I reduced many of these by adding some more Rails-like code. That might help the memory issue too.

numeroteca commented 10 years ago

It hasn't crashed so far, in the past days, with very long threads. I guess the change worked. Great!