• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Problem to deploy Next App and Express API as a custom server

heppyAndriawan

New Pleskian
Server operating system version
Ubuntu 20.04.5 LTS
Plesk version and microupdate number
Plesk Obsidian v18.0.46
Hi everyone,

I am really new to Plesk, and I am trying to follow the steps from this link below but it seems still not working.


1. So first, I exported my Next app by typing npm run build, and after completing I convert everything including the .next folder but except the node module folder to a zip file.
2. after login into Plesk, I upload this file to File Manager in the directory "httpdocs/public/" as I read in the other articles that on Linux the node app only works properly from this directory, so then I create it.
3. After that I install the node extension and setup up the new app below:
*Node.js version: 18.12.0​
*package manager: npm​
*Document Root: "httpdocs/public/"​
*application mode: production​
*Application Root: "httpdocs/public/"​
*application launch file: server.js => ("This is an Express API / listening API router")​
*Custom Environment Variables: "some env variable to connect to a database like a host, database name, User name, password"​
4. Next step I press "Enable Node.js" to activate the app and install all dependencies by pressing “NPM install” then after all is installed then I click Application URL to check the website but I got this:

Screenshot 2022-10-31 at 10.10.31.png

if I click "Technical details" then it says I need to run the node app with the environment set to development and/or with the friendly error pages option set to "on" to see all the error details.

5. I change the application mode to development and then this shows up. I feel hopeless, and don't know what to do anymore.
Screenshot 2022-10-31 at 10.22.09.png



Can anyone help me, what should I do? I am completely new to this case, I am really open to suggestions to solve this problem.

Thanks in advance.
 
I can confirm this exact problem with a basic hello world Express app (Express "Hello World" example).

Another app suddenly stopped working (the code wasn’t touched, but Plesk installed automatic updates in the meantime). It can’t be started because of a timeout during the “Initialize language runtime” phase.

Something seems wrong with the latest combination of Plesk, the Phusion Passenger and Node.js?

@heppyAndriawan Did you find a solution?
 
Even better: there is an official example Node.js app provided by Plesk, which I found in this article. You can find the app’s repository here.

Trying this app shows the same result and doesn’t work:

Bildschirm­foto 2022-12-01 um 16.15.35.png


After some page refreshs it turns into this error:

Bildschirm­foto 2022-12-01 um 16.16.41.png
 
@heppyAndriawan Now that I looked at your problem again, it may be different from mine.

First thing I can point out with your setup is that the Application Root should not be the same directory as Document Root. You can put the app into the httpdocs directory (it doesn’t have to be httpdocs/public), but your app needs a child directory, that contains public files (the Document Root)—which is therefore usually named public.

Also, before running the app, you need to install its (production) dependencies by clicking NPM Install.
 
To follow up on this: my problem was solved by setting the system config DefaultTasksMax to a higher number. The default was 60, I changed it to 300 and the Node.js app immediately started to work again.
 
Back
Top