Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect IP address when using remote builder with proxy #714

Closed
JoeKaldas opened this issue Mar 7, 2024 · 4 comments
Closed

Incorrect IP address when using remote builder with proxy #714

JoeKaldas opened this issue Mar 7, 2024 · 4 comments
Labels

Comments

@JoeKaldas
Copy link

I'm trying to deploy on Hetzner. My setup has 2 servers, one for app and one for postgres.
They talk to each other internally. Have a network setup on Hetzner for that.

Here's a screenshot of my 2 servers.
0o3_SQJ-

If I try deploying using Using remote builder for single-arch, I get the following error. It's trying to connect to 5.75.252.76 which isn't even one of my IP addresses. I tried using 10.0.0.2 in my builder host but same issue.

LKHFHygY

Here's my deploy.yml

service: j-h

image: joekaldas/j-h

ssh:
  proxy: "5.75.253.249"

servers:
  web:
    hosts:
      - 10.0.0.2
  solid-queue:
    hosts:
      - 10.0.0.2
    cmd: bundle exec rake solid_queue:start

registry:
  username: joekaldas

  password:
    - KAMAL_REGISTRY_PASSWORD

env:
  clear:
    POSTGRES_USER: postgres
    POSTGRES_HOST: 10.0.0.3
  secret:
    - RAILS_MASTER_KEY
    - POSTGRES_PASSWORD

builder:
  remote:
    arch: amd64
    host: ssh://root@5.75.253.249

accessories:
  pg-16.2:
    image: postgres:16.2
    host: 10.0.0.3
    port: "5432:5432"
    env:
      clear:
        POSTGRES_USER: postgres
      secret:
        - POSTGRES_PASSWORD
    files:
      - db/init.sql:/docker-entrypoint-initdb.d/setup.sql
    volumes:
      - "postgres_data:/var/lib/postgresql/data"
@dotnofoolin
Copy link

Try deleting the context.

docker context ls

docker context rm name_of_context_with_wrong_ip_address

I had the same issue using an AWS instance as the builder when I had to delete and restart the instance and the IP address changed.

@JoeKaldas
Copy link
Author

@dotnofoolin I've tried on both instances and both had one context of default

@djmb
Copy link
Collaborator

djmb commented Jun 4, 2024

@JoeKaldas - the context will be on the machine you are deploying from.

To fix this, we need to add a check in the build step to confirm the context is up to date with the config.

@djmb
Copy link
Collaborator

djmb commented Jun 5, 2024

Duplicate of #90

@djmb djmb marked this as a duplicate of #90 Jun 5, 2024
@djmb djmb closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants