简体   繁体   中英

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.

In chrome console I have 2 errors :

1 :

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

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 ) :

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 :

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 :

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 :

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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