Cannot reach server (RC8)


#1

Hi,

I am trying to run v1.0.0-rc.8_oryOS.10 via docker using my own docker-compose file. I was able to run migrations and start servers (admin & public) successfully. However, when I try to hit any endpoint (GET /clients or GET /version), seems server cannot be reached.

Also, I was able to run v1.0.0-rc.6_oryOS.10 using the same config. Thanks in advance!


#2

The logs look fine. What URL are you trying to call?


#3

Here is a sample postman call

curl -X GET \
  http://localhost:4445/clients \
  -H 'Accept: application/json' \
  -H 'Postman-Token: 86f510a0-9b6d-4548-99dd-ded3074d5373' \
  -H 'cache-control: no-cache'


#4

Seems like you didn’t enable port forwarding in your docker compose config. Without the docker compose file I can not help you further.


#5

Below is my docker compose file:

version: "3"
services:
  hydra-migrate:
    image: oryd/hydra:v1.0.0-rc.8_oryOS.10
    container_name: hydra_migrate
    environment:
      - DSN=mysql://${DB_USER}:${DB_PASS}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true
      - LOG_LEVEL=${LOG_LEVEL}
    command: migrate sql -e
    restart: on-failure

  hydra:
    image: oryd/hydra:v1.0.0-rc.8_oryOS.10
    container_name: hydra
    depends_on:
      - hydra-migrate
    ports:
      - "${PUBLIC_PORT}:${PUBLIC_PORT}"
      - "${ADMIN_PORT}:${ADMIN_PORT}"
    command: serve all --dangerous-force-http
    environment:
      - LOG_LEVEL=${LOG_LEVEL}
      - LOG_FORMAT=${LOG_FORMAT}
      - SERVE_PUBLIC_HOST=${PUBLIC_HOST}
      - SERVE_PUBLIC_PORT=${PUBLIC_PORT}
      - SERVE_PUBLIC_CORS_ENABLED=${CORS_ENABLED}
      - SERVE_PUBLIC_CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS}
      - SERVE_PUBLIC_CORS_DEBUG=${CORS_DEBUG}
      - SERVE_ADMIN_HOST=${ADMIN_HOST}
      - SERVE_ADMIN_PORT=${ADMIN_PORT}
      - SERVE_ADMIN_CORS_ENABLED=${CORS_ENABLED}
      - SERVE_ADMIN_CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS}
      - SERVE_ADMIN_CORS_DEBUG=${CORS_DEBUG}
      - DSN=mysql://${DB_USER}:${DB_PASS}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true
      - WEBFINGER_OIDC_DISCOVERY_CLIENT_REGISTRATION_URL=${ADMIN_CONSOLE_URL}
      - WEBFINGER_OIDC_DISCOVERY_SUPPORTED_CLAIMS=email,email_verified,name,family_name,given_name,profile
      - WEBFINGER_OIDC_DISCOVERY_USERINFO_URL=${PUBLIC_URL}/userinfo
      - URLS_SELF_ISSUER=${PUBLIC_URL}
      - URLS_SELF_PUBLIC=${PUBLIC_URL}
      - URLS_CONSENT=${IDP_URL}/authorize
      - URLS_LOGIN=${IDP_URL}/login
      - URLS_POST_LOGOUT_REDIRECT=${IDP_URL}/logout
      - URLS_ERROR=${IDP_URL}/error
      - OAUTH2_TTL_AUTH_CODE=${TTL_AUTH_CODE}
      - OAUTH2_TTL_ID_TOKEN=${TTL_ID_TOKEN}
      - OAUTH2_TTL_ACCESS_TOKEN=${TTL_ACCESS_TOKEN}
      - OAUTH2_TTL_REFRESH_TOKEN=${TTL_REFRESH_TOKEN}
      - OAUTH2_TTL_LOGIN_CONSENT_REQUEST=${TTL_LOGIN_CONSENT_REQUEST}
      - OAUTH2_EXPOSE_INTERNAL_ERRORS=${EXPOSE_ERRORS}
      - SECRETS_SYSTEM=${SYSTEM_SECRET}
      - SECRETS_COOKIE=${COOKIE_SECRET}
    restart: unless-stopped

#6

Well, what are the values that are being inserted…? Like ${ADMIN_PORT} etc…


#7

I used ADMIN_PORT=4445 and PUBLIC_PORT=4444 stored in an .env file.


#8

I have solved the issue by serving hydra on host 0.0.0.0.

PUBLIC_HOST and ADMIN_HOST was originally set to localhost. Thus, changing it to 0.0.0.0 fixed it.

Thanks a lot for the help :slight_smile: