Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCaptchaRediSModuleCommandNotFound error while deploying with Docker #56

Closed
pitininja opened this issue Jan 3, 2023 · 2 comments
Closed
Assignees

Comments

@pitininja
Copy link

Hello,

I've tried to deploy mCaptcha with Docker and I have an error that I'm not able to fix:

Version: 0.1.0 commit: c1f6ce3ae29321f0fdecf801ba789f60e4f89511
 INFO  mcaptcha::settings > Loading config file from /etc/mcaptcha/config.toml
 INFO  mcaptcha::data     > Initializing credential manager
 INFO  sqlx::postgres::notice > relation "_sqlx_migrations" already exists, skipping
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: MCaptchaRediSModuleCommandNotFound("MCAPTCHA_CACHE.ADD_VISITOR")', src/data.rs:140:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Below is my Docker compose:

version: '3'

services:
  mcaptcha:
    container_name: mcaptcha
    image: mcaptcha/mcaptcha:latest
    restart: always
    volumes:
      - /opt/mcaptcha/config.toml:/etc/mcaptcha/config.toml
    networks:
      - mcaptcha-network
      - postgresql-network
    ports: 
      - 127.0.0.1:7000:7000
  mcaptcha-redis:
    image: redis:latest
    container_name: mcaptcha-redis
    restart: always
    networks:
      - mcaptcha-network

networks:
  mcaptcha-network:
    name: mcaptcha
  postgresql-network:
    name: postgresql
    external: true

And here is my config file:

debug = false
source_code = "https://github.com/mCaptcha/mCaptcha"
commercial = false
allow_demo = false
allow_registration = false

[server]
cookie_secret = "******"
port = 7000
ip = "0.0.0.0"
domain = "mcaptcha.domain.com"
proxy_has_tls = true

[captcha]
salt = "******"
gc = 30
runners = 4
queue_length = 2000
enable_stats = true

[captcha.default_difficulty_strategy]
avg_traffic_difficulty =  50000
peak_sustainable_traffic_difficulty = 3000000
broke_my_site_traffic_difficulty = 5000000
duration = 30

[database]
hostname = "postgresql"
port = "5432"
username = "******"
password = "******"
name = "mcaptcha"
pool = 4
database_type="postgres"

[redis]
url = "redis://mcaptcha-redis/"
pool = 4

[smtp]
from = "admin@localhost"
reply = "admin@localhost"
url = "127.0.0.1"
port = 10025
username = "admin"
password = "password"

Thanks for any help

@realaravinth
Copy link
Member

Hello,

Please use mcaptcha/cache:latest for the Redis cache. We use a custom Redis module (mCaptcha/cache) and publish Redis Docker images with that module preloaded. The backend checks for this module's existence during start up and will fail if it isn't loaded in the cache.

Here's a reference docker-compose file that uses the custom Redis module: https://github.com/mCaptcha/mCaptcha/blob/master/docker-compose.yml#L25

@realaravinth realaravinth self-assigned this Jan 3, 2023
@pitininja
Copy link
Author

Indeed it's working great now, my bad for not spotting this.

Thank you very much for your help sir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants