skip to Main Content

This may be an extension of this post, but I figured it might be a different problem since that post is more then 2 years old.

Basically, I am using the redis image and connecting it to my web server. Here is my docker compose config:

version: '3'

services:
...

  session-store:
    image: redis
    ports:
      - 6379:6379
    restart: on-failure
    networks:
      - babylon
    command: /bin/sh -c "redis-server --requirepass $$REDIS_PASS"
    container_name: 'session-store'
    environment:
      - REDIS_PASS=<pass>
...      

For some reason, after some time I am getting this error:

9:C 10 May 2024 15:14:37.012 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9:C 10 May 2024 15:14:37.012 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=9, just started
9:C 10 May 2024 15:14:37.012 * Configuration loaded
9:M 10 May 2024 15:14:37.012 * monotonic clock: POSIX clock_gettime
9:M 10 May 2024 15:14:37.013 * Running mode=standalone, port=6379.
9:M 10 May 2024 15:14:37.013 * Server initialized
9:M 10 May 2024 15:14:37.013 * Ready to accept connections tcp
9:M 10 May 2024 16:14:38.076 * 1 changes in 3600 seconds. Saving...
9:M 10 May 2024 16:14:38.077 * Background saving started by pid 14
14:C 10 May 2024 16:14:38.099 * DB saved on disk
14:C 10 May 2024 16:14:38.101 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
9:M 10 May 2024 16:14:38.178 * Background saving terminated with success
9:signal-handler (1715364019) Received SIGTERM scheduling shutdown...
9:M 10 May 2024 18:00:19.541 * User requested shutdown...
9:M 10 May 2024 18:00:19.541 * Saving the final RDB snapshot before exiting.
9:M 10 May 2024 18:00:19.557 * DB saved on disk
9:M 10 May 2024 18:00:19.557 # Redis is now ready to exit, bye bye...

I’ve searched the internet for an answer, but most of them rely on changing the service type in the file system. But since I am using the official docker image, it should have all the configurations set.

Has anyone encountered this and found any fix?

2

Answers


  1. Chosen as BEST ANSWER

    The solution is kind of stupid if you ask me, but it worked for me at least.

    The system that I am using is an Ubuntu 24 LTS server. The problem is that I have installed docker and docker-desktop and they are not good friends with each other. What I did was uninstall docker and docker-desktop and reinstalling them from 0.

    Here are the steps that I took:

    // Stopping docker;
    
    $ sudo systemctl stop docker
    
    // Pugring the packages
    
    $ sudo apt-get purge docker-ce docker-ce-cli containerd.io
    
    // Removing the current config and files
    
    $ sudo rm -rf /var/lib/docker /etc/docker
    $ sudo rm -rf /var/lib/containerd
    $ sudo rm -rf /var/lib/docker
    $ sudo rm -rf /var/run/docker
    
    // Removing executables
    
    $ sudo rm -rf /usr/bin/docker*
    
    // Removing the docker group(I think this one is optional)
    
    $ sudo groupdel docker
    
    // Removing the bridge interface
    
    $ sudo ip link delete docker0
    
    // Remove docker-compose if you have it
    
    $ sudo rm /usr/local/bin/docker-compose
    
    //On local as well
    
    $ sudo rm -rf ~/.docker ~/.docker-compose
    
    
    

    Instalation process:

    // Update the apt package index and install packages to allow apt to use a repository over HTTPS
    
    $ sudo apt-get update
    $ sudo apt-get install -y 
        apt-transport-https 
        ca-certificates 
        curl 
        gnupg-agent 
        software-properties-common
    
    // Add Docker’s official GPG key:
    
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    
    // Setup the docker repo
    
    $ echo 
      "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
    // Instalation
    
    $ sudo apt-get update
    $ sudo apt-get install -y docker-ce docker-ce-cli containerd.io
    
    

    Install Docker Compose(Optional)

    
    // Download the current stable release of Docker Compose(this will changes)
    
    $ sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -oP '"tag_name": "K(.*)(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    
    // Apply executing rights for executables
    
    $ sudo chmod +x /usr/local/bin/docker-compose
    

    For me works with docker compose command. I did not install follow the docker-compose steps since I did not need them. I just place them in case someone has a hard time setting it up.


  2. i am using docker under kubernetes , and had something same with bitnami/redis repo , the problem was in livenessProbe and readinessProbe , increasing initialDelaySeconds, periodSeconds, timeoutSeconds solved my problem

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search