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

mCaptcha suddenly restarting #114

Closed
pluja opened this issue Oct 18, 2023 · 2 comments
Closed

mCaptcha suddenly restarting #114

pluja opened this issue Oct 18, 2023 · 2 comments

Comments

@pluja
Copy link

pluja commented Oct 18, 2023

I had mcaptcha working for a while, but suddenly it is down and the logs show the following:

mcaptcha-mcaptcha-1           |  DEBUG sqlx::query        > summary="SELECT current_database()" db.statement="" rows_affected=0 rows_returned=1 elapsed=586.012µs
mcaptcha-mcaptcha-1           |  DEBUG sqlx::query        > summary="SELECT pg_advisory_lock($1)" db.statement="" rows_affected=1 rows_returned=1 elapsed=596.292µs
mcaptcha-mcaptcha-1           |  INFO  sqlx::postgres::notice > relation "_sqlx_migrations" already exists, skipping
mcaptcha-mcaptcha-1           |  DEBUG sqlx::query            > summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMPTZ NOT NULL DEFAULT now(),\n  success BOOLEAN NOT NULL,\n  checksum BYTEA NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=523.102µs
mcaptcha-mcaptcha-1           |  DEBUG sqlx::query            > summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=1.116349ms
mcaptcha-mcaptcha-1           |  DEBUG sqlx::query            > summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=12 rows_returned=12 elapsed=445.767µs
mcaptcha-mcaptcha-1           |  DEBUG sqlx::query            > summary="SELECT current_database()" db.statement="" rows_affected=0 rows_returned=1 elapsed=109.938µs
mcaptcha-mcaptcha-1           |  DEBUG sqlx::query            > summary="SELECT pg_advisory_unlock($1)" db.statement="" rows_affected=1 rows_returned=1 elapsed=377.335µs
mcaptcha-mcaptcha-1           |  INFO  mcaptcha::data         > Initialized credential manager
mcaptcha-mcaptcha-1           | thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/libmcaptcha-0.2.4/src/redis/mod.rs:46:22:
mcaptcha-mcaptcha-1           | called `Result::unwrap()` on an `Err` value: Connection refused (os error 111)
mcaptcha-mcaptcha-1           | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
mcaptcha-mcaptcha-1 exited with code 101

I did not change anything, is there something wrong?

@realaravinth
Copy link
Member

My apologies, I broke your installation.

short version: I will start versioning software to avoid breakages like this. If you are connecting to the cache container with MCAPTCHA_REDIS_URL, please rename it to MCAPTCHA_redis_URL and restart the container. Please see CONFIGURATION.md for the full list of environment variables.

long version: I changed the way mCaptcha reads environment variables #105 to fix a bug where the config library that mCaptcha uses doesn't read all environment variables. Which I stupidly merged into master, a branch that publishes mCaptcha/mCaptcha:latest images. This could have been avoided if I versioned releases. I will work on that now.

@pluja
Copy link
Author

pluja commented Oct 18, 2023

Thank you! it is working now.

@pluja pluja closed this as completed Oct 18, 2023
realaravinth added a commit that referenced this issue Oct 18, 2023
hotfix: read soon-to-be deprecated env vars to avoid breakages like #114
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