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

TypeError: Cannot read property 'listDatabases' of undefined #64

Open
T00rk opened this issue Jun 18, 2021 · 0 comments
Open

TypeError: Cannot read property 'listDatabases' of undefined #64

T00rk opened this issue Jun 18, 2021 · 0 comments

Comments

@T00rk
Copy link

T00rk commented Jun 18, 2021

I updated my mongo-express kubernetes deployment to arm64v8/mongo-express:0.54 yesterday.

Since then, I got this error message :

Admin database is not accessible
TypeError: Cannot read property 'listDatabases' of undefined
    at Object.connectionData.updateDatabases (/node_modules/mongo-express/lib/db.js:41:11)
    at /node_modules/mongo-express/lib/router.js:94:11
    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
    at next (/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
    at /node_modules/express/lib/router/index.js:281:22
    at param (/node_modules/express/lib/router/index.js:354:14)
    at param (/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/node_modules/express/lib/router/index.js:410:3)

I'm connecting to a mongodb statefulset of 3 replicas. It worked before update (I don't remember which version was working before this one).

My deployment.yaml looks like this

apiVersion: apps/v1
kind: Deployment
metadata: 
  name: mongo-ui-deploy
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongo-ui
  template:
    metadata:
      labels:
        app: mongo-ui
    spec:
      containers:
        - name: mongo-ui
          image: arm64v8/mongo-express:0.54
          env:
            - name: ME_CONFIG_BASICAUTH_USERNAME
              value: '[auth_username]'
            - name: ME_CONFIG_BASICAUTH_PASSWORD
              value: '[auth_verystrongpassword]'
            - name: ME_CONFIG_MONGODB_ENABLE_ADMIN
              value: 'true'
            - name: ME_CONFIG_MONGODB_ADMINUSERNAME
              value: '[mongo_username]'
            - name: ME_CONFIG_MONGODB_ADMINPASSWORD
              value: '[mongo_verystrongpassword]'
            - name: ME_CONFIG_MONGODB_SERVER
              value: 'mongod-0.mongo-srv.default.svc.cluster.local,mongod-1.mongo-srv.default.svc.cluster.local,mongod-2.mongo-srv.default.svc.cluster.local'
            - name: ME_CONFIG_SITE_COOKIESECRET
              value: '[cookie-secret]'
            - name: ME_CONFIG_SITE_SESSIONSECRET
              value: '[session-secret]'   
            - name: ME_CONFIG_SITE_BASEURL
              value: '/'         
---
apiVersion: v1
kind: Service
metadata:
  name: mongo-ui-srv
spec:
  selector:
    app: mongo-ui
  ports:
    - name: mongo-ui
      protocol: TCP
      port: 8081
      targetPort: 8081
---
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

1 participant