chirpstack / chirpstack-docker

Setup ChirpStack using Docker Compose
https://www.chirpstack.io/
MIT License
273 stars 316 forks source link

MQTT connection refused #75

Closed mpgprofe closed 1 year ago

mpgprofe commented 1 year ago

I have been deploying a new ChirpStack server using docker compose from the master branch of your repository. Logs are reporting a constant problem which is related with MQTT. See traces bellow:

time="2023-01-27T18:56:32.198796797Z" level=error msg="integration/mqtt: connection error" error="network Error : dial tcp 127.0.0.1:1883: connect: connection refused"

Probably, URL should be as tcp://mosquitto:1883 to refer the mosquitto container instead of tcp://127.0.0.1:1883 that refers to local container.

bconway commented 1 year ago

It already appears to?

https://github.com/chirpstack/chirpstack-docker/blob/master/docker-compose.yml#L16

https://github.com/chirpstack/chirpstack-docker/blob/master/configuration/chirpstack/chirpstack.toml#L105

Perhaps your local configuration is different. I am unable to duplicate here.

Edit: The log above is missing the service name, so it is likely the same chirpstack-gateway-bridge issue already reported. I have no issues with the ChirpStack (v4) service itself.

ccall48 commented 1 year ago

it doesnt matter what you put in there - from the last version it always tries to connect to localhost:1883 rather then the docker container - see earlier raised issue from me here. https://github.com/chirpstack/chirpstack-docker/issues/74

ccall48 commented 1 year ago

i suggest you check my logs, as it also reported this as an error.

bconway commented 1 year ago

I updated my comment above, you two are no doubt reporting the same chirpstack-gateway-bridge issue, but the log above lacks the leading service name. Perhaps the issue title could be updated.

ccall48 commented 1 year ago

I tracked it to the gateway bridge - hence my documented findings, i think perhaps this issue here should be closed or merged as same issue as one i tracked in #74. I think this one was started without even reading the exisiting found issues.

lewisxhe commented 1 year ago

I also encountered the same error, but it is normal for me to try to connect using the mqtt client alone, and I found that even if I changed the port of MQTT, 1883 is still displayed in the log

File1 : docker-compose.yml

  mosquitto:
    image: eclipse-mosquitto:2
    restart: unless-stopped
    ports:
      - 1884:1884
    volumes:
      - ./configuration/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf

File2 : configuration/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml

[integration.mqtt.auth.generic]
servers=["tcp://mosquitto:1884"]
username="myusername"
password="mypassword"

File3 : configuration/chirpstack/region_eu868.toml

  # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
  server="tcp://$MQTT_BROKER_HOST:1884"

I will use the 1884 port and user name and password according to the above configuration. Even if the port and account password are correctly configured, the output log will still display 1883, so I don't think this is a configuration problem

lewisxhe commented 1 year ago

Yes, everything is normal after I replace the chipstack-gateway-bridge with v4.0.3,


chirpstack-gateway-bridge-eu868:
image: chirpstack/chirpstack-gateway-bridge:4.0.3
brocaar commented 1 year ago

This is a duplicate of #74. A bugfix will released shortly.