RocketChat / helm-charts

Repository for RocketChat helm charts
36 stars 67 forks source link

Unable to upgrade 5.4.3 #92

Closed TLINDEN closed 1 year ago

TLINDEN commented 1 year ago

Howdy,

I am currently running on helm chart version 5.1.0 and want to upgrade to 5.3.2.

The README says about upgrading to release >= 5.4.3 that user,pass,db must now be arrays. But the problem is, that the mongodb helm chart in turn tries to create a multinode replica if these values are an array and fails because there are no other replicas than the one I'm trying to deploy. The variable mongodb.replicaCount is set to 1. This is the status of mongodb at this stage:

I have no name!@rocketchat-fitstest-mongodb-0:/bitnami/mongodb$ mongo --disableImplicitSessions $TLS_OPTIONS --eval 'db.hello()'

MongoDB shell version v4.4.11                                                                                                                              
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
MongoDB server version: 4.4.11                                                                                                                             
{                                                                                                                                                          
        "topologyVersion" : {                                                                                                                              
                "processId" : ObjectId("64104c05a669b5a13712a2e8"),                                                                                        
                "counter" : NumberLong(0)                                                                                                                  
        },                                                                                                                                                 
        "isWritablePrimary" : false,                                                                                                                       
        "secondary" : false,                                                                                                                               
        "info" : "Does not have a valid replica set config",                                                                                               
        "isreplicaset" : true,                                                                                                                             
        "maxBsonObjectSize" : 16777216,                                                                                                                    
        "maxMessageSizeBytes" : 48000000,                                                                                                                  
        "maxWriteBatchSize" : 100000,                                                                                                                      
        "localTime" : ISODate("2023-03-14T10:48:04.707Z"),                                                                                                 
        "logicalSessionTimeoutMinutes" : 30,                                                                                                               
        "connectionId" : 297,                                                                                                                              
        "minWireVersion" : 0,                                                                                                                              
        "maxWireVersion" : 9,                                                                                                                              
        "readOnly" : false,                                                                                                                                
        "ok" : 1                                                                                                                                           
}  

So in order to get it running I tried to set architecture explicit to standalone. Now mongodb comes up, but rocketchat doesn't with this error:

/app/bundle/programs/server/node_modules/fibers/future.js:313                                    
                                              throw(ex);                                         
                                              ^                                                  

MongoServerSelectionError: getaddrinfo ENOTFOUND rocketchat-fitstest-mongodb-headless            
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_mod

    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {                                                
  reason: TopologyDescription {                                                                  
    type: 'ReplicaSetNoPrimary',
    servers: Map(1) {                
      'rocketchat-fitstest-mongodb-headless:27017' => ServerDescription {
        _hostAddress: HostAddress {                                
          isIPv6: false,
          host: 'rocketchat-fitstest-mongodb-headless',
          port: 27017                
        },
        address: 'rocketchat-fitstest-mongodb-headless:27017',
        type: 'Unknown',
        hosts: [],
        passives: [],                
        arbiters: [],
        tags: {},                                                                                
        minWireVersion: 0,                               
        maxWireVersion: 0,                               
        roundTripTime: -1,                               
        lastUpdateTime: 4934119363,
        lastWriteDate: 0,            
        error: MongoNetworkError: getaddrinfo ENOTFOUND rocketchat-fitstest-mongodb-headless
            at connectionFailureError (/app/bundle/programs/server/npm/node_modules/meteor/npm-mo

            at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/

            at Object.onceWrapper (events.js:520:26)
            at Socket.emit (events.js:400:28)
            at emitErrorNT (internal/streams/destroy.js:106:8)
            at emitErrorCloseNT (internal/streams/destroy.js:74:3)
            at processTicksAndRejections (internal/process/task_queues.js:82:21)
      }
    },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: 'rs0',
    logicalSessionTimeoutMinutes: undefined
  }
}

And indeed, there's no service rocketchat-fitstest-mongodb-headless anymore, because in standalone mode the mongodb helmchart creates this service (w/o the headless part):

rocketchat-fitstest-mongodb      ClusterIP   10.244.113.6    <none>        27017/TCP   15m 

I haven't found a way to persuade rocketchat to use this service, also I was unable to find any reference to this headless service, which doesn't exist. Also note, that I removed the whole namespace and deployed from scratch, so there can't be any old objects hanging around anymore.

So, how can I tell rocketchat to use the correct service (or is this a bug)? Or - even better - how can I continue to use architecture replicaset with 1 replica AND upgrade to 5.4.3?

Here's the WORKING** config for mongodb values:

mongodb:
  arbiter:
    enabled: false
    pdb:
      minAvailable: 0
  auth:
    database: rocketchat
    password: ****
    rootPassword: ****
    username: rocketchat
  enabled: true
  pdb:
    minAvailable: 0
  persistence:
    accessMode: ReadWriteOnce
    enabled: true
    size: 50Gi
    storageClass: partition-silver
  podSecurityPolicy:
    create: true
  rbac:
    create: true
  replicaCount: 1
  resources:
    limits:
      cpu: 2
      memory: 20Gi
  serviceAccount:
    create: true
  volumePermissions:
    enabled: true
    securityContext: {}

This is the NONWORKING values:

mongodb:
  arbiter:
    enabled: false
    pdb:
      minAvailable: 0
  auth:
    database: rocketchat
   usernames:
      - ****
    passwords:
      - ****
    databases:
      - ****
  enabled: true
  pdb:
    minAvailable: 0
  persistence:
    accessMode: ReadWriteOnce
    enabled: true
    size: 50Gi
    storageClass: partition-silver
  podSecurityPolicy:
    create: true
  rbac:
    create: true
  replicaCount: 1
  resources:
    limits:
      cpu: 2
      memory: 20Gi
  serviceAccount:
    create: true
  volumePermissions:
    enabled: true
    securityContext: {}

Also it doesn't matter if don't upgrade, so even if I keep the versions as is (that is, 5.1.0), then the mongodb replicaset error still happens due to the user,pass,db arrays.

TLINDEN commented 1 year ago

ignore this one. Sorry.