From faef48210938a4c3c7f96909cb92ce9c7136c6d6 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 8 Feb 2024 17:15:19 -0500 Subject: [PATCH] Check memcached backend in Django (#2778) Bail if using old memcached backend --- install.sh | 1 + install/check-memcached-backend.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 install/check-memcached-backend.sh diff --git a/install.sh b/install.sh index 06d332919b..78a96fece6 100755 --- a/install.sh +++ b/install.sh @@ -23,6 +23,7 @@ source install/check-minimum-requirements.sh source install/turn-things-off.sh source install/create-docker-volumes.sh source install/ensure-files-from-examples.sh +source install/check-memcached-backend.sh source install/ensure-relay-credentials.sh source install/generate-secret-key.sh source install/update-docker-images.sh diff --git a/install/check-memcached-backend.sh b/install/check-memcached-backend.sh new file mode 100644 index 0000000000..25ef70dcbd --- /dev/null +++ b/install/check-memcached-backend.sh @@ -0,0 +1,16 @@ +echo "${_group}Checking memcached backend ..." + +if grep -q "\.PyMemcacheCache" "$SENTRY_CONFIG_PY"; then + echo "PyMemcacheCache found in $SENTRY_CONFIG_PY, gonna assume you're good." +else + if grep -q "\.MemcachedCache" "$SENTRY_CONFIG_PY"; then + echo "MemcachedCache found in $SENTRY_CONFIG_PY, you should switch to PyMemcacheCache." + echo "See:" + echo " https://develop.sentry.dev/self-hosted/releases/#breaking-changes" + exit 1 + else + echo 'Your setup looks weird. Good luck.' + fi +fi + +echo "${_endgroup}"