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

The dns service on port 8600 is unavailable #75866

Open
xiaohei114 opened this issue Dec 21, 2024 · 1 comment
Open

The dns service on port 8600 is unavailable #75866

xiaohei114 opened this issue Dec 21, 2024 · 1 comment
Assignees
Labels
consul tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@xiaohei114
Copy link

xiaohei114 commented Dec 21, 2024

Name and Version

bitnami/consul:latest

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Use this docker compose file
version: '2'

networks:
  consul-network:
    driver: bridge

services:
  consul:
    image: bitnami/consul:latest
    networks:
      - consul-network
    ports:
      - '8300:8300'
      - '8301:8301'
      - '8301:8301/udp'
      - '8500:8500'
      - '8600:8600'
      - '8600:8600/udp'
  1. Some background information
    server os: ubuntu-22.04.3-live-server-amd64
    server ip address for running consul: 192.168.1.100
    bitnami/consul container id: 045d470b6ef4

  2. Register a service using python code

import json
import httpx
import fastapi
import uvicorn

def register_to_consul():
    consul_host = '192.168.1.100'
    consul_port = '8500'
    url = f"http://{consul_host}:{consul_port}/v1/agent/service/register"
    data = {
        "Name": "school",
        "Tags": ['school'],
        'Address': '192.168.1.250',
        'Port': 8000,
        "Check": {
            'http': f'http://192.168.1.250:8000/health',
            'interval': '10s'
        }
    }
    res = httpx.put(url, data=json.dumps(data))
    return res.text

app = fastapi.FastAPI()

@app.get("/health")
def health_status():
    print('health')
    return {"status": "healthy"}

if __name__ == '__main__':
    register_to_consul()
    uvicorn.run(app, port=8000, host='0.0.0.0')
  1. Query the ip of the service on the server using dig
$ dig school.service.consul @192.168.1.24 -p 8600 +tcp
;; Connection to 192.168.1.24#8600(192.168.1.24) for school.service.consul failed: connection refused.
;; Connection to 192.168.1.24#8600(192.168.1.24) for school.service.consul failed: connection refused.
;; Connection to 192.168.1.24#8600(192.168.1.24) for school.service.consul failed: connection refused.

$ dig school.service.consul @192.168.1.24 -p 8600
;; communications error to 192.168.1.24#8600: connection refused
;; communications error to 192.168.1.24#8600: connection refused
;; communications error to 192.168.1.24#8600: connection refused
; <<>> DiG 9.18.12-0ubuntu0.22.04.2-Ubuntu <<>> school.service.consul @192.168.1.24 -p 8600
;; global options: +cmd
;; no servers could be reached
  1. Use dig to query the service ip inside consul
# Enter the consul container as root
docker exec -u 0 -it 045d /bin/bash
# Install the packages needed to run dig
$ apt update && apt install dnsutils -y

# tcp query
$  dig school.service.consul @127.0.0.1 -p 8600 +tcp
school.service.consul.  0       IN      A       192.168.1.250

# udp query
$  dig school.service.consul @127.0.0.1 -p 8600
school.service.consul.  0       IN      A       192.168.1.250

# Query by ubuntu server port
$ dig school.service.consul @192.168.1.100 -p 8600 +tcp
;; communications error to 192.168.1.24#8600: connection reset
;; communications error to 192.168.1.24#8600: connection reset
;; communications error to 192.168.1.24#8600: connection reset

What is the expected behavior?

Just like using hashicorp/consul image, The following is the return result of hashicorp/consul

$ dig school.service.consul @192.168.1.100 -p 8600 +tcp

school.service.consul.  0       IN      A       192.168.1.250

What do you see instead?

Only inside the container can dns results be returned correctly

@xiaohei114 xiaohei114 added the tech-issues The user has a technical issue about an application label Dec 21, 2024
@github-actions github-actions bot added the triage Triage is needed label Dec 21, 2024
@carrodher
Copy link
Member

Hi, the issue may not be directly related to the Bitnami container image/Helm chart, but rather to how the application is being utilized, configured in your specific environment, or tied to a particular scenario that is not easy to reproduce on our side.

If you think that's not the case and want to contribute a solution, we'd like to invite you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Please feel free to contact us if you have any questions or need assistance.

Suppose you have any questions about the application, customizing its content, or technology and infrastructure usage. In that case, we highly recommend that you refer to the forums and user guides provided by the project responsible for the application or technology.

With that said, we'll keep this ticket open until the stale bot automatically closes it, in case someone from the community contributes valuable insights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants