passenger icon indicating copy to clipboard operation
passenger copied to clipboard

Fails to recognise Nestjs app start

Open WTF-Software opened this issue 1 year ago • 2 comments

Issue report

Are you sure this is a bug in Passenger? Yes

Question 1: What is the problem?

Your answer: Problem: Passenger starts my app but fails to recognise that the app is running. Expected behaviour: To report the app is running successfully and hand over control to my app Actual behaviour: Times out with error: 'Web application could not be started' and fails to handover control to the app Reproduction steps: Run a nests application

Question 2: Passenger version and integration mode:

Your answer: SERVER_SOFTWARE=Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f mod_fcgid/2.3.9 Phusion_Passenger/5.0.30

Question 3: OS or Linux distro, platform (including version):

Your answer: Ubuntu Question 4: Passenger installation method:

Your answer:

  • [ ] RubyGems + Gemfile
  • [ ] RubyGems, no Gemfile
  • [ ] Phusion APT repo
  • [ ] Phusion YUM repo
  • [ ] OS X Homebrew
  • [ ] source tarball
  • [x] Other, please specify: Unknown. Passenger is provided by my hosting service provide and I have no control over versions, installation methods etc.

Question 5: Your app's programming language (including any version managers) and framework (including versions):

Your answer: Node v12.22.9 NodeJs

Question 6: Are you using a PaaS and/or containerization? If so which one?

Your answer: Unknown

Question 7: Anything else about your setup that we should know?

Your answer: My app appears to be running according to the logs, but is missing something that Passenger is looking for.

WTF-Software avatar Oct 20 '23 00:10 WTF-Software

You might want to read about port binding and how passenger detects node apps starting: https://www.phusionpassenger.com/docs/advanced_guides/in_depth/node/reverse_port_binding.html there isn't a nest.js example but the problem you need to address is covered there.

CamJN avatar Nov 20 '23 17:11 CamJN

Thanks for the reply, Cam.

I have already tried that without any success.

Nest.js uses Express as the http engine but wraps it which I think is what is masking the call.

Are you able to show an example Nest.js setup similar to the Express example shown in your link?

WTF-Software avatar Nov 20 '23 23:11 WTF-Software