1

I followed these instructions and enabled the error log within nginx.

I was trying to test the log, I created a syntax error by removing a : at the end of a for loop.

When trying to load the website, it threw a 500 internal server error.

After looking at the log, im pretty lost at what im seeing. I currently have the level set as debug.

How would I configure the settings so that it would tell me that the issue is a syntax error?

heres a sample of what the tail of the error log looks like:

5098 2016/08/06 01:53:05 [debug] 23526#23526: *44 write new buf t:1 f:0 0000559FAC0F0508, pos 0000559FAC0F0508, size: 161 file: 0, size: 0
5099 2016/08/06 01:53:05 [debug] 23526#23526: *44 http write filter: l:0 f:0 s:161
5100 2016/08/06 01:53:05 [debug] 23526#23526: *44 http output filter "/tag/getting-started/?"
5101 2016/08/06 01:53:05 [debug] 23526#23526: *44 http copy filter: "/tag/getting-started/?"
5102 2016/08/06 01:53:05 [debug] 23526#23526: *44 image filter
5103 2016/08/06 01:53:05 [debug] 23526#23526: *44 xslt filter body
5104 2016/08/06 01:53:05 [debug] 23526#23526: *44 http postpone filter "/tag/getting-started/?" 0000559FAC0F06E8
5105 2016/08/06 01:53:05 [debug] 23526#23526: *44 write old buf t:1 f:0 0000559FAC0F0508, pos 0000559FAC0F0508, size: 161 file: 0, size: 0
5106 2016/08/06 01:53:05 [debug] 23526#23526: *44 write new buf t:0 f:0 0000000000000000, pos 0000559FAB989AC0, size: 120 file: 0, size: 0
5107 2016/08/06 01:53:05 [debug] 23526#23526: *44 write new buf t:0 f:0 0000000000000000, pos 0000559FAB98ADA0, size: 62 file: 0, size: 0
5108 2016/08/06 01:53:05 [debug] 23526#23526: *44 http write filter: l:1 f:0 s:343
5109 2016/08/06 01:53:05 [debug] 23526#23526: *44 http write filter limit 0
5110 2016/08/06 01:53:05 [debug] 23526#23526: *44 writev: 343 of 343
5111 2016/08/06 01:53:05 [debug] 23526#23526: *44 http write filter 0000000000000000
5112 2016/08/06 01:53:05 [debug] 23526#23526: *44 http copy filter: 0 "/tag/getting-started/?"
5113 2016/08/06 01:53:05 [debug] 23526#23526: *44 http finalize request: 0, "/tag/getting-started/?" a:1, c:1
5114 2016/08/06 01:53:05 [debug] 23526#23526: *44 event timer add: 12: 5000:1470462790191
5115 2016/08/06 01:53:05 [debug] 23526#23526: *44 http lingering close handler
5116 2016/08/06 01:53:05 [debug] 23526#23526: *44 recv: fd:12 -1 of 4096
5117 2016/08/06 01:53:05 [debug] 23526#23526: *44 recv() not ready (11: Resource temporarily unavailable)
5118 2016/08/06 01:53:05 [debug] 23526#23526: *44 lingering read: -2
5119 2016/08/06 01:53:05 [debug] 23526#23526: *44 event timer: 12, old: 1470462790191, new: 1470462790191
5120 2016/08/06 01:53:05 [debug] 23526#23526: *44 http empty handler
5121 2016/08/06 01:53:05 [debug] 23526#23526: *44 http empty handler
5122 2016/08/06 01:53:05 [debug] 23526#23526: *44 http lingering close handler
5123 2016/08/06 01:53:05 [debug] 23526#23526: *44 recv: fd:12 -1 of 4096
5124 2016/08/06 01:53:05 [info] 23526#23526: *44 recv() failed (104: Connection reset by peer) while sending to client, client: 180.76.15.12, server: chriskoh.io, request: "GET /tag/getting-started/ HTTP/1.1", upstream: "http://127     .0.0.1:2368/tag/getting-started/", host: "sites.bugsplat.info"
5125 2016/08/06 01:53:05 [debug] 23526#23526: *44 lingering read: -1
5126 2016/08/06 01:53:05 [debug] 23526#23526: *44 http request count:1 blk:0
5127 2016/08/06 01:53:05 [debug] 23526#23526: *44 http close request
5128 2016/08/06 01:53:05 [debug] 23526#23526: *44 http log handler
5129 2016/08/06 01:53:05 [debug] 23526#23526: *44 free: 0000559FAC0F8BA0, unused: 0
5130 2016/08/06 01:53:05 [debug] 23526#23526: *44 free: 0000559FAC0EFB70, unused: 881
5131 2016/08/06 01:53:05 [debug] 23526#23526: *44 close http connection: 12
5132 2016/08/06 01:53:05 [debug] 23526#23526: *44 event timer del: 12: 1470462790191
5133 2016/08/06 01:53:05 [debug] 23526#23526: *44 reusable connection: 0
5134 2016/08/06 01:53:05 [debug] 23526#23526: *44 free: 0000559FAC0EE400
5135 2016/08/06 01:53:05 [debug] 23526#23526: *44 free: 0000559FAC0EE1F0, unused: 128
7
  • >After looking at the log, im pretty lost at what im seeing. I currently have the level set as debug Please show what you see. Also don't forget nginx debug-log is overwhelmingly verbose, it can eat your hdd space very fast Commented Aug 6, 2016 at 5:51
  • its like 1k+ lines, i'll cut and paste some of it Commented Aug 6, 2016 at 5:52
  • By the way, what method you're using connecting python with nginx? digitalocean.com/community/questions/… I mean, you may be looking for errors in the wrong log file Commented Aug 6, 2016 at 5:54
  • @strangeqargo its a flask app Commented Aug 6, 2016 at 5:56
  • flask with what? pure cgi-python? uwsgi? flask is just a python app, logs are ruled by middleware Commented Aug 6, 2016 at 5:57

1 Answer 1

1

1) Disable nginx debug mode, it will eat your hdd. Nginx debug mode log purpose is to debug nginx itself, not your application errors.

2) Don't look for errors in the wrong places, nginx error log has nothing to do with your application(flask)/middleware (uwsgi in your case) logs

3) DO faq about uwsgi logs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.