Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one debug a fastcgi application?

How does one debug a FastCGI application? I've got an app that's dying but I can't figure out why, even though it's likely throwing a stack trace on stderr. Running it from the commandline results in an error saying:

RuntimeError: No FastCGI Environment: 88 - Socket operation on non-socket

How do I set up a 'FastCGI Environtment' for debugging purposes? It's not my app - it's a 3rd party open source app - so I'd rather avoid adding in a bunch of logging to figure out what's going wrong.

If it matters, the app is Python, but FastCGI is FastCGI, right? Is there a shim or something to let you invoke a fastcgi program from the commandline and hook it up to the terminal so you can see its stdout/stderr?

like image 270
pjz Avatar asked Mar 13 '26 21:03

pjz


1 Answers

It does matter that the application is Python; your question is really "how do I debug Python when I'm not starting the script myself".

You want to use a remote debugger. The excellent WinPDB has some documentation on embedded debugging which you should be able to use to attach to your FastCGI application and step through it.

like image 85
Glyph Avatar answered Mar 16 '26 11:03

Glyph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!