brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.5k stars 546 forks source link

redis password not set in sentinel mode #548

Closed gbrehmer closed 3 years ago

gbrehmer commented 3 years ago

I'm getting errors if I want to use a redis instance with a password: level=fatal msg="setup storage error: get keys error: NOAUTH Authentication required."

The go client FailoverOptions has two password fields SentinelPassword AND Password (https://github.com/go-redis/redis/blob/7ecd5cee5b1b56fd5135b1b38207ae12ee9e70b4/sentinel.go#L49). Last one is used for the client connection. But chirpstack is only setting the sentinel password: https://github.com/brocaar/chirpstack-network-server/blob/8bc17e3a25091debba7be3072b3c1119872d6907/internal/storage/storage.go#L65-L72 For backwards compatibility probably its better to introduce a new property, but in our case we use the same password for sentinel and redis, so it would be enough to only set the additional property.

gbrehmer commented 3 years ago

ist already done in the application server: https://github.com/brocaar/chirpstack-application-server/blob/efb3284a2f04938180d9bd818f647b86177c6cc1/internal/storage/storage.go#L97 so probably no backwards compatibility is required :)

brocaar commented 3 years ago

If it is already there in the ChirpStack Application Server code, then it makes sense to add it to the NS code-base as well. Would you like to create a pull-request for this?

fmendez89 commented 3 years ago

hi, i have found this bug too, could you please share when it will be build into a new release?

fmendez89 commented 3 years ago

@brocaar Thank you very for the release and the project itself.