RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received NaN.
See original GitHub issueRunning lhci server on k8s using patrickhulce/lhci-server
image. When a pod restart occurs, a RangeError
for the port is raised and the pod cannot be started successfully.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Port should be >= 0 and < 65536. Received NaN - Stack ...
Anyone help me in resolving this error. ` WARNING: Adonis has detected an unhandled promise rejection, which may cause undesired behavior in ...
Read more >Port should be >= 0 and < 65536. Received - Glitch Support
RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received . ... I get this error, and idk what to do.
Read more >Port should be >= 0 and < 65536. Received NaN-mongodb
Coding example for the question RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received NaN-mongodb.
Read more >Solved Can't start after update nodejs/npm - NodeBB
Received NaN. at validatePort (internal/validators.js:211:11) at ... RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536.
Read more >T205505 process.env.PORT not defined
port ); ^ RangeError [ERR_SOCKET_BAD_PORT]: Port should be > 0 and < 65536. Received NaN. Clearly the javascript var port = parseInt(process.env.PORT, 10)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@MahmoudDolah well something in the chain is setting the port to an invalid number. https://github.com/GoogleChrome/lighthouse-ci/pull/270 should add more debug information to help track it down.
Okay I have found out the issue here @patrickhulce. The system documented in Kubernetes doesn’t take into account a deployment or a service being attached (this is how we would set up a Kube system). In the situation of an lhci server we would define:
In the kubernetes world, a
service
linked to adeployment
automatically createsSERVICE_PORT
andSERVICE_HOST
ENV vars. This means if your service is namedlhci
then the env vars filtered down areLHCI_PORT=tcp://...
. This is the issue people are encountering above.Should we amend the documentation to highlight this clash?