dre*_*ekk 1 passenger nginx plesk node.js probot
I'm trying to deploy a GitHub Probot App (NodeJS application) to my webserver running Plesk 18.0.27 U1 with the NodeJS Extension 1.3.6-117. When running the probot app on my local machine, the app starts just fine and is accessible via localhost.
Plesk is apparently using the Phusion Passenger application server to serve NodeJS apps.
When accessing the deployed website, I get the following errror:
Screenshot: Passenger problem location
And in /var/log/nginx/error.log:
[ E 2020-05-30 10:06:31.7393 21506/Th age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/vhosts/example.org/node_root: A timeout occurred while spawning an application process.
Error ID: 5f02dec5
Error details saved to: /tmp/passenger-error-y6AeCv.html
[ E 2020-05-30 10:06:31.7466 21506/T5 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is 5f02dec5. Please see earlier logs for details about the error.
Run Code Online (Sandbox Code Playgroud)
passenger_start_timeout 300;PORT="passenger"#!/usr/bin/env node
const { Probot } = require('Probot')
// @ts-ignore
if (typeof(PhusionPassenger) !== 'undefined') {
//@ts-ignore
PhusionPassenger.configure({ autoInstall: false });
}
Probot.run(process.argv)
Run Code Online (Sandbox Code Playgroud)
Is my application failing or is passenger unable to bind the port of the app?
Are there more detailed logs or an option to enable verbose output?
Thanks in advance!
经过长时间的研究,我自己弄清楚了。发布我的解决方案,以防有人遇到同样的问题。
设置乘客日志级别。您可以输入passenger_log_level 7您的 nginx 配置/etc/nginx/conf.d/phusion-passenger.conf(对于 Plesk)
我将应用程序作为独立的乘客服务器启动,并获得了实际的应用程序标准输出输出。示例:cd在您的节点应用程序根文件夹中并运行passenger start --startup-file lib/startup.js --nodejs /opt/plesk/node/12/bin/node --log-level 3 --app-type node.
此时我发现Probot在上面提到的启动脚本中找不到该模块。因此,我更深入地研究了 Probot 应用程序的实际启动方式,并偶然发现了该probot run命令。默认情况下,probot 应用程序不使用node ./lib/index.jsbut运行probot run ./lib/index.js。
passenger_app_start_command "/opt/plesk/node/12/bin/npm start";来设置自定义启动命令以使用启动脚本probot run中定义的命令package.json,而不是node ./lib/startup.js乘客的默认命令我学到了很多关于这些工具的知识,希望这能节省某人的周末:D
| 归档时间: |
|
| 查看次数: |
5416 次 |
| 最近记录: |