issues with redis while trying to upgrade nodebb

General Discussion
  • while trying to upgrade nodebb from version 1.0.3 to 1.3.0 and got this error message
    by the way this is using docker

    ran the below command inside the docker container

    ./nodebb upgrade


    1. Bringing base dependencies up to date .. OK
    2. Checking installed plugins for updates.. OK
    3. Updating NodeBB data store schema..
                    options.path = port_arg;
    TypeError: cannot assign to read only property 'path' of NODEBB_REDIS_HOST
            at createClient (/app/node_modules/redis/lib/createClient.js:62:26)
            at Object.exports.createClient (/app/node_modules/redis/index.js:1081:41)
            at Object.module.connect (/app/src/database/redis.js:85:16)
            at Object.module.init (/app/src/database/redis.js:47:24)
            at upgrade (/app/app.js:285:28)
            at Object.<anonymous> (/app/app.js:75:2)
            at Module._compile (module.js:410:26)
            at Object.Module._extensions..js (module.js:417:10)
            at Module.load (module.js:344:32)
            at Function.Module._load (module.js:301:12)
    Error: undefined

    NODEBB_REDIS is the variable used for the remote redis host/endpoint

    Can anyone please help with this error?

  • Can you share your config.json? Looks like your redis host/port isn't properly defined.

  • Following up from GH,

    If you can give us more info as per the comments in that link hopefully we can help you out 😃

  • @stuwil

    The config.json file is below

        "url": "NODEBB_URL",
        "secret": "NODEBB_SECRET",
        "database": "redis",
        "redis": {
            "host": "NODEBB_REDIS_HOST",
            "port": "NODEBB_REDIS_PORT",
            "password": "",
            "database": "3"
        "app_url": "",
        "smtp_from_name": "example"

    and command to run the docker container before running the ./nodebb upgrade command

    docker run -it \
            -h nodebb \                                
            -e NODEBB_CONFIG_ENV='config.json' \       
            -e NODEBB_REDIS_HOST='' \
            -e NODEBB_REDIS_PORT='6379' \
            -e NODEBB_SECRET='xxxxxx' \       
            -e NODEBB_URL='' \
                                    -v /var/log/nodebb:/app/logs \
            -v /var/opt/nodebb/uploads:/app/public/uploads \
                                    -p 8080:4567 \
                            --name nodebb \
                    example/nodebb:production bash

    hope all this information and help figure out what the issue is. I thought it was a popular issue that will be figured out quickly; surprised i had to add all these info.


  • @psychobunny

    not sure it was really necessary to link my github (privacy???)

  • @ubern00b Both this site and GitHub are public sites, there's no reason @psychobunny would think not to link the two issues together.

    It is very difficult to debug issues otherwise, when relevant information is posted in multiple places.

  • @julian
    Seems you don't understand what privacy is.
    I did not in anyway mention i opened same exact issue on github or suggest i want to link myself with both sites, i may simply want to separate my github account from this forum account.
    Normally i try to edit my questions whenever am posting to a few sources i need help mainly because of abuse of privacy like this.

  • @ubern00b I think you mistake anonymity (you walking on the street) for privacy (you walking or doing whatever pleases you in your apartment). Posting on different public websites is more related to anonymity than it is to privacy.

  • @hukadan
    point is i did NOT want to link the two accounts
    just because he saw i am the one that posted on github doesn't mean link me

    Anyways i posted this thread to get help
    Will great appreciate any help on the redis issue

  • @ubern00b The NodeBB upgrade is failing because the config.json isn't actually being populated with any of the environment variables. It's literally trying to connect to "NODEBB_REDIS_HOST" as the hostname of your redis instance.

    Check that your Dockerfile specifies an entrypoint script that actually generates a config.json. Also, you're declaring two persistent volumes (for logs and uploads) - if config.json isn't stored on a persistent volume, it'll need to be re-generated at every run... which might be what you're intending to do.

    Alternatively, the "quick fix" would be to edit the config.json inside your container and substitute the variable names for their actual values, then run ./nodebb upgrade.

  • @stuwil brings up a good point... what happens when you ping NODEBB_REDIS_HOST? Do you get the redis instance?

Suggested Topics

  • 0 Votes
    1 Posts
  • 0 Votes
    6 Posts
  • 0 Votes
    4 Posts
  • 0 Votes
    2 Posts
  • 0 Votes
    3 Posts