azure PM2错误:app=npm id=0没有pid

des4xlb0  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(136)

Docker文件包含以下步骤,镜像成功构建,如果您检查日志,服务器也会在以下端口上成功启动,但不确定pm2是否会出现此错误,pm2是否会停止引用日志。因此,我们使用azure部署,通过azure我可以看到部署,服务和pod成功创建。一旦服务器启动并连接到mongo,突然pm2试图杀死pid并失败,最终停止有人可以帮助或指出正确的方向或导致此错误的原因吗
Docker文件步骤

FROM node:14.21.2-alpine
# Set the source folder
ARG SOURCE_FOLDER="./"

######################
ENV PYTHONUNBUFFERED=1
RUN apk update && apk add bash
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools

# Create the lscservices.sh for the services start command
RUN touch lscservices.sh && \
 chmod 700 lscservices.sh && \
 echo -e '#!/bin/bash\nlsc services start' > lscservices.sh && \
 mv lscservices.sh /usr/bin/
WORKDIR /labshare/communities-api
ARG NPM_TOKEN
COPY . .
# COPY package.json and project .
RUN echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
RUN apk add --no-cache --virtual .gyp python3 make g++
RUN rm -rf node_modules
RUN rm -rf dist
RUN npm cache clean --force
RUN rm package-lock.json
RUN npm install
RUN npm i pm2@latest -g
RUN npm i bash -g
RUN npm -g config set user root
RUN npm install @labshare/lsc -g
RUN npm install typescript -g
RUN npm run build
RUN rm -f .npmrc

# Run the service using pm2 and the shorcut to lsc start services
CMD ["pm2-docker","lscservices.sh"]
#CMD ["pm2-runtime", "npm", "start" ]
EXPOSE 8000

字符串

2023-06-22T12:37:53: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]stdout            
       2023-06-22T12:37:53: PM2 log: Script /usr/local/bin/npm had too many unstable restarts (16). Stopped. "errored"stdout
       2023-06-22T12:37:55: PM2 log: 0 application online, retry = 3 
 stdout
       2023-06-22T12:37:57: PM2 log: 0 application online, retry = 2 
 stdout
       2023-06-22T12:37:59: PM2 log: 0 application online, retry = 1 
 stdout
       2023-06-22T12:38:01: PM2 log: 0 application online, retry = 0 
stdout
2023-06-22T16:39:46.559Z info: LabShare services listening at http://:::8000  stdout
2023-06-22T12:38:01: PM2 log: Stopping app:npm id:0    stdout
2023-06-22T12:38:01: PM2 error: app=npm id=0 does not have a pid stderr
2023-06-22T12:38:01: PM2 log: PM2 successfully stopped stdout
2023-06-22T12:39:38: PM2 log: Launching in no daemon mode    stdout
2023-06-22T12:39:38: PM2 log: App [lscservices:0] starting in -fork mode-    stdout

2023-06-22T12:39:38: PM2 log: App [lscservices:0] online


一切都很好,我最近面临这个错误,我们正在使用14.2.1阿尔卑斯山的形象为节点,最新版本为pm2

pxyaymoc

pxyaymoc1#

对于NextJS设置,同样的错误,将ecosystem.config.js文件从:

script: "./node_modules/.bin/next",
args: 'start',

字符串

script: "./node_modules/.bin/next start",


帮助

相关问题