Spawn-fcgi succeeds, but process instantly dies with no output to stderr or logs

Hello all,

I’ve run RT 4.4 on Debian 8 for four years, but problems with the server mean it’s finally time to move RT to a new server. I copied all of /opt/rt4 to the new server (the database is on its own server) and configured Nginx. I had previously wanted to put RT5 on this same server, so it has the Perl dependencies already. I ran /opt/rt4/sbin/rt-server in the terminal, visited the site in a browser, and got a login prompt. Perfect so far.

Now, the problem. Each time I run my spawn-fcgi command, the output is “child spawned successfully”, along with a PID. The thing is, my browser reports an error, and Nginx says it can’t connect. If I try to kill the process spawn-fcgi gave me, Debian says no such process exists.

My conclusion is that spawn-fcgi is working, but something somewhere is then throwing an error that kills the process immediately after it starts. The problem is that I have no idea what that something is. My RT log has nothing other than some warnings that subroutines are redefined; I get nothing in the terminal itself; I can’t find a way to log anything using spawn-fcgi; and syslog has no messages about what I’m trying to do.

As mentioned, I moved this installation from another server, but I’ve installed all the Perl dependencies and other bits RT should need. My only problems according to rt-test-dependencies are a few for mailgate and graphviz.

How can I figure out what the problem is? The man page for spawn-fcgi says nothing about any kind of logging, and I’m doing this from a terminal over SSH, so if there’s anything on stderr, I should have gotten it already. RT’s log and syslog are lacking anything, but since the stand-alone server makes RT work, I don’t expect RT to log any errors. What options do I have? Thanks for any ideas.

does your nginx config look like the examples in the docs?
i’ve never run spawn-fcgi, I would think starting/restarting nginx should be enough (disclaimer I use Apache as my web server)

I’m using the same Nginx file I used on the old server, so I know it works. Besides, when I run rt-server directly, my browser can connect to RT, telling me Nginx is functioning. It’s specifically calling spawn-fcgi that fails.

As a side note, and just for your information, I don’t believe Nginx works the same way as Apache in this context. From what I’ve read, Apache can handle FCGI processes on its own, starting them when it starts and otherwise managing them. Nginx, on the other hand, can’t. It relies on the processes to be running, so users need some other tool to monitor and restart FCGI. On my previous server, I used Monit, but anything similar will work.

I may have solved this. I just discovered the -n switch for spawn-fcgi, which apparently makes the program run in interactive mode. I wish I’d know about this six hours ago, because it told me the problem right away. The permissions on were bad, and the web user I’m using couldn’t access the file. I fixed that, and now things appear to be working correctly.