简体   繁体   English

AWS 503服务暂时不可用

[英]AWS 503 Service Temporarily Unavailable

My front-end connecting to my server which host in AWS, and from yesterday I getting 503 Service Temporarily Unavailable error. 我的前端连接到托管在AWS中的服务器,从昨天开始,我收到503 Service Temporally Unavailable错误。

In chrome console I have 2 errors : 在Chrome控制台中,我有2个错误:

1 : 1:

http://myServerendpoint.com/getData 503 (Service Temporarily Unavailable)

2 : 2:

Failed to load http://myServerendpoint.com/getData : No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://myFrontEndPoint.com' is therefore not allowed access. The response had HTTP status code 503.

I already apply cors to the server ( it's nodejs ) : 我已经将cors应用于服务器(它是nodejs):

app.use(cors({
   allowedOrigin: ["*"],
   credentials: true
}))

and it was working until yesterday. 一直到昨天。 but from yesterday I keep getting this error and have no clue. 但是从昨天开始,我一直收到此错误,没有任何线索。 in aws logs I getting this : 在aws日志中,我得到这个:

container_linux.go:247: starting container process caused “exec: \“/usr/bin/node\“: stat /usr/bin/node: no such file or directory”

Any idea what is wrong? 知道有什么问题吗?

UPDATE : 更新:

The path was wrong I change it to correct one which is /usr/bin/node but now I getting permission denied error : 路径错误,我将其更改为/ usr / bin / node,但现在我得到了权限拒绝错误:

container_linux.go:247: starting container process caused "exec: \"/usr/bin/node\": permission denied"

my docker file : 我的码头工人文件:

FROM node:6-onbuild

RUN apt-get update && \
  apt-get -y install sudo

RUN mkdir -p /usr/bin/node
RUN chmod -R +x /usr/bin/node
RUN sudo chown -R $USER: /usr/bin/node
WORKDIR /usr/bin/node

COPY package.json /usr/bin/node
RUN npm install
COPY . /usr/bin/node

ENV PORT 80
EXPOSE ${PORT}

CMD [ "npm","run", "start" ]

NEW Update : 新更新:

Even after build with buildkite, the duckerfile config run fine : 即使使用buildkite进行构建,duckerfile配置也可以正常运行:

Removing intermediate container eac44b8f2a3f
Step 3/12 : RUN mkdir -p /usr/bin/node
 ---> Running in 9ac2ac7f960e
 ---> 970134252f9d
Removing intermediate container 9ac2ac7f960e
Step 4/12 : RUN chmod -R +x /usr/bin/node
 ---> Running in 8c54b0e3d813
 ---> 5ca0fe8180f6
Removing intermediate container 8c54b0e3d813
...
...
...
Successfully built 7f189f7e38cc
Successfully tagged 239820024964.dkr.ecr.ap......

So the problem is not before building, its after build, when we send a http request we got this permission denied! 因此,问题不在构建之前,在构建之后,当我们发送http请求时,该权限被拒绝了!

我们发现了问题,以防万一,在我的情况下,我们的ecs任务EntryPoint的节点路径不同,基本上是我们的docker节点路径位于:/ usr / local / bin / node但设置了我们的ecs任务入口点到/ usr / bin / node

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM