部署到弹性beanstalk时出错 - 未知作业:nodejs

时间:2016-07-29 20:42:01

标签: node.js meteor elastic-beanstalk

我正在将一个meteor项目部署到beanstalk应用程序,但我收到了错误:

Script /opt/elasticbeanstalk/hooks/appdeploy/enact/50start.sh 
failed with returncode 1

在/var/log/directory-hooks-executor.log中我找到:

status: Unknown job: nodejs
Failed to find status of job.
Traceback (most recent call last):
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 599, in <module>
main()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 583, in main
nodejs_upstart.start()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 199, in start
raise e
Exception: Failed to run command: None

我正在运行运行Node.js的64位Amazon Linux 2014.03 v1.1.0 知道原因吗?

1 个答案:

答案 0 :(得分:6)

在我的例子中,当我将Json值作为ENV变量传递时产生了这个错误。

这是因为Beanstalk使用“”将所有env变量存储在文件/tmp/deployment/config/#etc#init#nodejs.conf中。

例如:

METEOR_SETTINGS='{ "public": { } }'

将以nodejs.conf编写为

METEOR_SETTINGS="{ "public": { } }"

由于字符串未正确关闭,因此会产生错误。