Docker installation failing - Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED

Technical Support
  • docker run --name my-forum-redis -d -p 6379:6379 nodebb/docker:ubuntu-redis
    docker run --name dockerdev-nodebb --link dockerdev-redis:redis -p 80:80 -p 443:443 -p 4567:4567 -P -t -i nodebb/docker:ubuntu

    Defined the wbsite url for the forum as http://forum.mydomain.com:80

    Results in:

    [email protected] node_modules/connect-redis
    ā””ā”€ā”€ [email protected] ([email protected])
    14/12 09:45 [1] - info: Populating database with default configs, if not already set...
    14/12 09:45 [1] - error: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
        at RedisClient.flush_and_error (/opt/nodebb/node_modules/redis/index.js:142:13)
        at RedisClient.on_error (/opt/nodebb/node_modules/redis/index.js:180:10)
        at Socket.<anonymous> (/opt/nodebb/node_modules/redis/index.js:95:14)
        at Socket.EventEmitter.emit (events.js:95:17)
        at net.js:441:14
        at process._tickCallback (node.js:415:13)
    14/12 09:45 [1] - warn: NodeBB Setup Aborted. Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
    

    Any help would be appreciated.

  • @william.owen
    telnet localhost 6379 ?
    netstat -npl | grep 6379 && echo 'Port open. Good.' || echo 'Port Closed. Redis started ?'
    šŸ˜‰

  • Hi there; thanks for the reply. I get : -

    Port open. Good.

  • telnet localhost 6379 ?

  • telnet: Unable to connect to remote host: Connection refused

  • @william.owen
    This suggests that it is not in the driver connection and not in the installation script. It tells us that the database connection is not possible, even though you have previously reported that the port is open.

    1. Start Redis
    2. Input 'redis-cli ping' and Enter
    3. Insert screenshot command output netstat -npl
  • you have to run docker network inspect bridge

    the result will be :

    [
        {
            "Name": "bridge",
            "Id": "a82774b4cc857b934ca5d3bba8f20a077aef3c117b9a390455466fb8785aea0f",
            "Scope": "local",
            "Driver": "bridge",
            "EnableIPv6": false,
            "IPAM": {
                "Driver": "default",
                "Options": null,
                "Config": [
                    {
                        "Subnet": "172.17.0.0/16",
                        "Gateway": "172.17.0.1"
                    }
                ]
            },
            "Internal": false,
            "Containers": {
                "64e285ed8b6a287c693df8244f4cf45c6e724e74e979734b823f14f19cb2a74b": {
                    "Name": "node-bb-redis",
                    "EndpointID": "869f51cfefb3d1d59b5f0cc881c16e6a127b423345704c7f17bc3f10c5061922",
                    "MacAddress": "02:42:ac:11:00:02",
                    "IPv4Address": "172.17.0.2/16",
                    "IPv6Address": ""
                },
                "7fd7885220b189427121102a9cf34e7b2259b5d1038b3f6a522f24e1e3ebd25b": {
                    "Name": "node-bb",
                    "EndpointID": "9d971bdd8675714ba96385c3832cf08a0ed6630cc40e8ac08d3666c42f0b9133",
                    "MacAddress": "02:42:ac:11:00:05",
                    "IPv4Address": "172.17.0.5/16",
                    "IPv6Address": ""
                },
                "8391d3e8f44f064e885e2cf754a59a7cc00d24ca5c2db13b4add0152308eb843": {
                    "Name": "nginx-letsencrypt",
                    "EndpointID": "0416947f3ff616fb063b17363ef4f5d282a0549bc15582a842f97155b9ede5c2",
                    "MacAddress": "02:42:ac:11:00:04",
                    "IPv4Address": "172.17.0.4/16",
                    "IPv6Address": ""
                },
                "a06b204eb61be007c093488aa1f3491407b784c48c4b3a069afcc967892b1522": {
                    "Name": "nginx-proxy",
                    "EndpointID": "6de08ad911df8e80b04f4600909b76c70d3dd99f26a586cc444bf5a2ec97e2ef",
                    "MacAddress": "02:42:ac:11:00:03",
                    "IPv4Address": "172.17.0.3/16",
                    "IPv6Address": ""
                }
            },
            "Options": {
                "com.docker.network.bridge.default_bridge": "true",
                "com.docker.network.bridge.enable_icc": "true",
                "com.docker.network.bridge.enable_ip_masquerade": "true",
                "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
                "com.docker.network.bridge.name": "docker0",
                "com.docker.network.driver.mtu": "1500"
            },
            "Labels": {}
        }
    ]
    

    Find your redis IP and put it in your nodeBB config (in my case Redis IP is 172.17.0.2)

  • @Absam-Sibsam you saved me bro, worked perfectly!


Suggested Topics


  • 0 Votes
    5 Posts
    119 Views

    @Gliding9426 Yeah, NodeBB can fork itself and maintain its own state if you prefer not to use separate tooling. šŸ‘

  • 0 Votes
    2 Posts
    651 Views

    I fixed my own issue. Apparently some install scripts fail when run as root (or with sudo). I'm not sure why this is the case, but I got everything to work by running sudo chown -R ralph:www-data /path/to/nodebb && ./nodebb upgrade as a standard user.

  • 0 Votes
    8 Posts
    4k Views

    @flex said:

    Do you think that it's possible to don't use yours and replace it by my reverse proxy ?

    HI, If you meant that one use a niginx which is installed on a host instead of a dockerized nginx which is dedicated for NodeBB, then it's totally possible, yes šŸ™‚

    I just put some ideas and matters

    One can remove a dockerized nginx easily by just a modifying(removing) of nginx part from docker-compose.yml. Really, that's just it. ( This is a full chain, but if one doesn't need/want a full chain then.. šŸ™‚ ) One can use a dockerized nginx as a prime web server instead a host installed web server and can serve subomains or what ever with other docker or directory Actually this doesn't happen yet, but nginx can serve static files for NodeBB efficiently and you know, nginx is extremely small. So I'd rather proxy from a host installed nginx to the nodebb dedicated nginx docker ( In this case one needs to change a line 80:80 with 8080:80 or <any port>:80 in docker-compose.yml )

    But, if anybody wants to get an easier way and less steps, then your idea will be also a good option.

  • 0 Votes
    2 Posts
    1k Views

    After some more digging I found this: https://github.com/akhoury/nodebb-plugin-import/issues/131#issuecomment-143779814

    Basically import isn't ready for v0.8.2 just yet but akhoury is working on it. Personally I'll wait for an updated import rather than downgrade->import->upgrade given my trouble with plugins and v0.7.x from npm.

  • 0 Votes
    5 Posts
    1k Views

    nodebb-plugin-composer-default 1.0.14

    nodebb-plugin-dbsearch 0.2.16

    nodebb-plugin-desktop-notifications 0.2.0

    nodebb-plugin-emailer-mandrill 0.2.4

    nodebb-plugin-emoji-extended 0.4.13

    nodebb-plugin-google-analytics 0.5.5

    nodebb-plugin-markdown 4.0.5

    nodebb-plugin-mentions 1.0.2

    nodebb-plugin-pushbullet 3.0.3

    nodebb-plugin-recent-cards 0.0.9

    nodebb-plugin-soundpack-default 0.1.4

    nodebb-plugin-spam-be-gone 0.4.2

    nodebb-rewards-essentials 0.0.5

    nodebb-widget-essentials 2.0.1