smocker-dev / smocker

Smocker is a simple and efficient HTTP mock server and proxy
https://smocker.dev
MIT License
1.14k stars 61 forks source link

When using persistence, session name is reloaded, but mocks and history are not. #292

Closed mkrum001 closed 6 months ago

mkrum001 commented 10 months ago

Hello,

I'm using Smocker with Docker-compose:

version: '3.8'

services:
  smocker:
    image: thiht/smocker:0.18.5
    container_name: smocker
    ports:
      - 8080:8080
      - 8081:8081
    environment:
      - SMOCKER_PERSISTENCE_DIRECTORY=/mnt
    volumes:
      - type: bind
        source: ../data
        target: /mnt

After the container is up and running, I can see on the host file system "sessions.yml" file and a folder named with the session id. If I add a mock using "Add mocks endpoint", this mock appear in mocks.yml inside session folder. So far so good. If the container restarts, this mock is no longer visible from the UI. The only reloaded information is the session name. No history, no mocks.

willy-kimbyungsoo commented 10 months ago

rollback 0.17.1

gwleclerc commented 10 months ago

🤔 I will check that. I've made those changes because I have a strange behaviour on MacOS. I'll start from 0.17.1 and add some non-regression on persistence to ensure that sessions are load correctly at start and that the synchronisation is correctly made.

Rem-V commented 10 months ago

Hello, same kind of behavior here (Debian 10/docker) : persistence no more working after image upgrade. I tried with 0.18.3, 0.18.4 and 0.18.5. No luck, should rollback to 0.18.2 to load existing history & mocks.

Here is my compose file :

version: "3.3"
services:
  smocker:
    container_name: smocker
    image: "thiht/smocker:0.18.2"
    volumes:
    - /home/testing/smocker:/home
    environment:
    - SMOCKER_PERSISTENCE_DIRECTORY=/home
    - SMOCKER_LOG_LEVEL=debug
    restart: always
    logging:
      driver: "json-file"
      options:
        max-size: 10m
        max-file: "3"
    networks:
    - proxy-net

networks:
  proxy-net:
    external: true
shakun-roman commented 3 months ago

gwleclerc hey! Could you pls tell when this fix will be relased?