diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e5843e..89bbe8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Bugfix] Fix (agin) forum starting issue: "NoMethodError: undefined method `encode' for nil:NilClass". + ## v12.1.1 (2021-09-17) - [Bugfix] Fix forum starting issue: "NoMethodError: undefined method `encode' for nil:NilClass". diff --git a/tutor/templates/build/forum/Dockerfile b/tutor/templates/build/forum/Dockerfile index 2bb7c23..0bbbbd2 100644 --- a/tutor/templates/build/forum/Dockerfile +++ b/tutor/templates/build/forum/Dockerfile @@ -45,7 +45,7 @@ ENV NEW_RELIC_ENABLE false ENV API_KEY forumapikey ENV SEARCH_SERVER "http://elasticsearch:9200" ENV MONGODB_AUTH "" -ENV MONGOID_AUTH_MECH ":scram" +ENV MONGOID_AUTH_MECH "" ENV MONGODB_HOST "mongodb" ENV MONGODB_PORT "27017" ENV MONGODB_DATABASE "cs_comments_service" diff --git a/tutor/templates/build/forum/bin/docker-entrypoint.sh b/tutor/templates/build/forum/bin/docker-entrypoint.sh index 77cd2b0..4f5ac7c 100755 --- a/tutor/templates/build/forum/bin/docker-entrypoint.sh +++ b/tutor/templates/build/forum/bin/docker-entrypoint.sh @@ -4,6 +4,12 @@ export MONGOHQ_URL="mongodb://$MONGODB_AUTH$MONGODB_HOST:$MONGODB_PORT/$MONGODB_ # the search server variable was renamed after the upgrade to elasticsearch 7 export SEARCH_SERVER_ES7="$SEARCH_SERVER" +# make sure that there is an actual authentication mechanism in place, if necessary +if [ -n "$MONGODB_AUTH" ] +then + export MONGOID_AUTH_MECH=":scram" +fi + echo "Waiting for mongodb/elasticsearch..." dockerize -wait tcp://$MONGODB_HOST:$MONGODB_PORT -wait $SEARCH_SERVER -wait-retry-interval 5s -timeout 600s