soketi / charts

The source repository for Soketi Helm charts.
Apache License 2.0
20 stars 18 forks source link

Google Cloud deployment - crashing on bad port #10

Closed mfreeman451 closed 2 years ago

mfreeman451 commented 2 years ago

Getting an error when deploying this chart to gke:

2022-02-15 14:21:35.906 CSTnode:internal/validators:216
Error
2022-02-15 14:21:35.906 CST throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);
Error
2022-02-15 14:21:35.906 CST ^
Error
2022-02-15 14:21:35.906 CST{}
Error
2022-02-15 14:21:35.906 CSTRangeError [ERR_SOCKET_BAD_PORT]: Port should be > 0 and < 65536. Received udp://10.124.4.184:11002.
Error
2022-02-15 14:21:35.907 CST at new NodeError (node:internal/errors:371:5)
Error
2022-02-15 14:21:35.907 CST at validatePort (node:internal/validators:216:11)
Error
2022-02-15 14:21:35.907 CST at Socket.send (node:dgram:637:12)
Error
2022-02-15 14:21:35.907 CST at /app/node_modules/node-discover/lib/network.js:188:25
Error
2022-02-15 14:21:35.907 CST at Array.forEach (<anonymous>)
Error
2022-02-15 14:21:35.907 CST at /app/node_modules/node-discover/lib/network.js:187:26
Error
2022-02-15 14:21:35.907 CST at Network.encode (/app/node_modules/node-discover/lib/network.js:221:12)
Error
2022-02-15 14:21:35.907 CST at Network.send (/app/node_modules/node-discover/lib/network.js:180:10)
Error
2022-02-15 14:21:35.907 CST at Discover.hello (/app/node_modules/node-discover/lib/discover.js:361:17)
Error
2022-02-15 14:21:35.907 CST at /app/node_modules/node-discover/lib/discover.js:286:10 {
Error
2022-02-15 14:21:35.907 CST code: 'ERR_SOCKET_BAD_PORT'
mfreeman451 commented 2 years ago

Ended up getting this to work with a little different setup for GKE, but it is working.

fibis commented 2 years ago

This problem is a Kubernetes thing. When you deploy the whole thing with the name soketi, you also get a service with the name soketi. This creates in the namespace the environment variable SOKETI_PORT that is injected into the pod. Since soketi is using this env as port env, it will be overwritten with the generated env from the service, that leads to the error.

SergkeiM commented 2 years ago

Hi @mfreeman451 can you share your solution?

asrail commented 1 year ago

There is an answer is posted here: https://github.com/soketi/soketi/discussions/766 In that case, you edit values.yml if using the helm chart. Pick any nameOverride value which is not exactly soketi.

If you are not using Helm, you can also edit the app name and the prefix for the other values, but it is only required for you to change the service names which are named "soketi" or "soketi_cluster".

h0jeZvgoxFepBQ2C commented 1 year ago

Ah this bugged me as well...