Passenger: internal server error

后端 未结 4 651
南笙
南笙 2020-12-15 21:10

I installed Apache, Passenger and Sinatra and deployed an app. It gives error when trying to access:

An error occurred while starting up the preloader: it di         


        
相关标签:
4条回答
  • 2020-12-15 21:14

    For future reference : I had wrong database credentials in my config, which resulted in the same error.

    0 讨论(0)
  • 2020-12-15 21:16

    To solve this issue, please follow this guide by phusion phassenger https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems

    0 讨论(0)
  • 2020-12-15 21:23

    I found the answer what is causing it in my case. In my config.ru I was redirecting STDOUT like this:

    log = File.new("logs/std.log", "a+")
    STDOUT.reopen(log)
    

    Removing the redirect into the log and it starts up again.

    Looks like passenger needs STDOUT to detect a working "preloader".


    Edit: I'm currently using the following solution to redirect the log into a file and keep passenger happy (basically just duplicating stdout into the log file and not redirecting):

    log = File.new("logs/std.log", "a+")
    def STDOUT.write string
        log.write string
        super
    end
    STDOUT.sync = true
    
    0 讨论(0)
  • 2020-12-15 21:30

    In case the above doesn't solve it for you, I had the exact same error message with a different cause.

    In my case, we were using an external database server and that had gone down.

    Bringing the external db server back up fixed the issue.

    But before we solved this, we spent a bunch of time thinking about recompiling passenger, etc.

    Hope this note saves someone some time.

    0 讨论(0)
提交回复
热议问题