server icon indicating copy to clipboard operation
server copied to clipboard

Deploying to Google App Engine - 502 Bad Gateway

Open lonormaly opened this issue 4 years ago • 0 comments

Hey all, thank you for this wonderful project.

When I deploy to my App Engine service, when I try to connect to my domain I get your url is: undefined. My goal is to have a static localtunnal server from this address: my-project.uc.r.appspot.com that's why I set the --domain option, and to serve it with https that's why I set the --secure option.

That's my DockerFile:

FROM node:10.1.0-alpine

WORKDIR /app

COPY package.json /app/
COPY yarn.lock /app/

RUN yarn install --production && yarn cache clean

COPY . /app

ENV NODE_ENV production
ENTRYPOINT ["node", "-r", "esm", "./bin/server", "--domain", "my-project.uc.r.appspot.com", "--secure"]

That's my app.yaml:

# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gae_flex_quickstart_yaml]
runtime: custom
env: flex
entrypoint: node -r esm ./bin/server --domain my-project.uc.r.appspot.com --secure

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

# [END gae_flex_quickstart_yaml]

When I try to use some of the api calls such as /api/status, I get 404.

Here are some logs:

2020-08-15 18:07:39 default[20200815t161056]  "GET /favicon.ico" 502
2020-08-15 18:49:09 default[20200815t211757]  "GET /" 404
2020-08-15 18:49:10 default[20200815t211757]  "GET /favicon.ico" 404
2020-08-16 12:03:25 default[20200815t211757]  "GET /favicon.ico" 404
2020-08-16 17:43:10 default[20200816t203647]  Running with options: {"max_tcp_sockets":10,"secure":true,"domain":"my-project.uc.r.appspot.com"}
2020-08-16 18:22:27 default[20200816t203647]  "GET /api/tunnels" 502
2020-08-16 18:22:28 default[20200816t203647]  "GET /favicon.ico" 502
2020-08-16 18:24:35 default[20200816t203647]  "GET /api/status" 502
2020-08-16 18:24:35 default[20200816t203647]  "GET /favicon.ico" 502
2020-08-16 18:36:38 default[20200816t213440]  Running with options: {"max_tcp_sockets":10,"secure":true,"domain":"my-project.uc.r.appspot.com"}

Do you have any idea what should I do / configure in App Engine to make it work? Of course locally it works.

lonormaly avatar Aug 17 '20 07:08 lonormaly