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

Error in workloop RangeError [ERR_SOCKET_BAD_PORT] #114

Open
tillias opened this issue Apr 16, 2020 · 1 comment
Open

Error in workloop RangeError [ERR_SOCKET_BAD_PORT] #114

tillias opened this issue Apr 16, 2020 · 1 comment

Comments

@tillias
Copy link

tillias commented Apr 16, 2020

Hello,

I'm using following StatefulSet:

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: mongo
spec:
  serviceName: "mongo"
  replicas: 3
  template:
    metadata:
      labels:
        role: mongo
        environment: test
    spec:
      terminationGracePeriodSeconds: 10
      containers:
        - name: mongo
          image: mongo
          command:
            - mongod
            - "--replSet"
            - rs0
            - "--bind_ip_all"
          ports:
            - containerPort: 27017
          volumeMounts:
            - name: mongo-persistent-storage
              mountPath: /data/db
        - name: mongo-sidecar
          image: cvallance/mongo-k8s-sidecar
          env:
            - name: MONGO_SIDECAR_POD_LABELS
              value: "role=mongo,environment=test"
            - name: KUBERNETES_MONGO_SERVICE_NAME
              value: "mongo"
  volumeClaimTemplates:
    - metadata:
        name: mongo-persistent-storage
        annotations:
          volume.beta.kubernetes.io/storage-class: "nfs-rw"
      spec:
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 10Gi

If I look into mongo-sidecar logs there is constantly error:

The cluster domain 'cluster.local' was successfully verified.
Error in workloop RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received tcp://10.247.212.143:27017.
    at lookupAndConnect (net.js:972:13)
    at Socket.connect (net.js:948:5)
    at Object.connect (net.js:159:17)
    at Connection.connect (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/connection.js:420:25)
    at Pool.connect (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:666:16)
    at Server.connect (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/topologies/server.js:399:17)
    at Server.connect (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb/lib/server.js:368:17)
    at open (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb/lib/db.js:229:19)
    at Db.open (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb/lib/db.js:252:44)
    at getDb (/opt/cvallance/mongo-k8s-sidecar/src/lib/mongo.js:32:11)
@wenbya
Copy link

wenbya commented Jun 24, 2022

hi @tillias have you ever found the solution ? I am in the same problem now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants