gaia-app / gaia

Gaia is a Terraform 🌍 UI for your modules, and self-service infrastructure 👨‍💻
https://gaia-app.io
Mozilla Public License 2.0
986 stars 86 forks source link

🐛 : Problem with Runner #750

Open barbaops opened 4 days ago

barbaops commented 4 days ago

Describe the bug I create stack with Docker-Compose following doc, but when i try running any stack the runner show error:

Unable to connect to gaia find jobs to run : I/O error on GET request for "http://localhost:8080/api/runner/steps/request": Connection refused; nested exception is java.net.ConnectException: Connection refused

I try change the port, url but only error

To Reproduce Steps to reproduce the behavior:

  1. Running docker-compose up -d
  2. Access with admin
  3. Create a module or import from GitHub
  4. Try Launch

Expected behavior

Screenshots If applicable, add screenshots to help explain your problem. image image image

Desktop (please complete the following information):

juwit commented 4 days ago

Hey @barbaops ! :wave:

Can you share your docker-compose file? The error IO error on GET request for "http://localhost:8080/api/runner/steps/request" means that your runner is missing the GAIA_URL configuration.

The related documentation is here: https://docs.gaia-app.io/getting-started/quick-start/#getting-started-with-docker-compose-pre-build-images

barbaops commented 2 days ago

Follow the docker-compose file:

version: "3.9"
services:
  gaia:
    image: "gaiaapp/gaia"
    ports: 
      - "8080:8080"
    environment:
      - "GAIA_MONGODB_URI=mongodb://mongo/gaia"
      - "GAIA_RUNNER_API_PASSWORD=123456"
      - "GAIA_EXTERNAL_URL=http://localhost:8080"
      - "SPRING_PROFILES_ACTIVE=github"
      - "SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_ID=xxxxxxxxxx"
      - "SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_SECRET=xxxxxxxxx"
  runner:
    image: "gaiaapp/runner"
    environment:
      - "GAIA_URL=http://localhost:8080"
      - "GAIA_RUNNER_API_PASSWORD=123456"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
  mongo:
    image: "mongo:4.4"

I use docker in local machine

juwit commented 2 days ago

The problem is the GAIA_URL in the runner.

It should be http://gaia:8080 (to use the gaia service) The GAIA_EXTERNAL_URL in the gaia container can be http://localhost:8080.

So your docker-compose should be :

version: "3.9"
services:
  gaia:
    image: "gaiaapp/gaia"
    ports: 
      - "8080:8080"
    environment:
      - "GAIA_MONGODB_URI=mongodb://mongo/gaia"
      - "GAIA_RUNNER_API_PASSWORD=123456"
      - "GAIA_EXTERNAL_URL=http://localhost:8080"
      - "SPRING_PROFILES_ACTIVE=github"
      - "SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_ID=xxxxxxxxxx"
      - "SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_SECRET=xxxxxxxxx"
  runner:
    image: "gaiaapp/runner"
    environment:
      - "GAIA_URL=http://gaia:8080"
      - "GAIA_RUNNER_API_PASSWORD=123456"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
  mongo:
    image: "mongo:4.4"
barbaops commented 2 days ago

Job stuck:

image

Gaia Log image

Runner Log: image

My compose file:

version: "3.9"
services:
  gaia:
    image: "gaiaapp/gaia"
    ports: 
      - "8080:8080"
    environment:
      - "GAIA_MONGODB_URI=mongodb://mongo/gaia"
      - "GAIA_RUNNER_API_PASSWORD=123456"
      - "GAIA_EXTERNAL_URL=http://localhost:8080"
      - "SPRING_PROFILES_ACTIVE=github"
      - "SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_ID=xxxxxxxxxx"
      - "SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GITHUB_CLIENT_SECRET=xxxxxxxxx"
  runner:
    image: "gaiaapp/runner"
    environment:
      - "GAIA_URL=http://gaia:8080"
      - "GAIA_RUNNER_API_PASSWORD=123456"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
  mongo:
    image: "mongo:4.4"