Solved Mastodon can't connect to Redis
it seems my Mastodon installation is having trouble with its Redis connection.
Opening up the site I'm greeted by an error message ( "We're sorry, but something went wrong on our end.")
I checked the log, which immediately fills with this error message:
ERR! Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
I restarted the whole app, which didn't do anything.
I also restarted the Mastodon Redis from the Cloudron backend, same result.
The apphealthmonitor says 17 alive / 3 dead (the two additional dead services seem to be my two LAMP boxes, which for some reason won't restart properly - could be related?)
Any idea what might be going on?
Thanks in advance,
@stormgrass said in Mastodon can't connect to Redis:
the two additional dead services seem to be my two LAMP boxes
This might be https://forum.cloudron.io/topic/6612/lamp-unbound-variable-mysql
@stormgrass About mastodon, can you confirm you are on Cloudron 7.1 and also on Mastodon package v1.7.5 ?
After that, can you check the contents of
/app/data/env.production? It should have something like:
# Service dependencies REDIS_HOST=redis-7da0beb3-999b-434e-b5cf-f54527387a2a REDIS_PORT=6379 REDIS_PASSWORD=8cca7ae6eee15ef77b298a8269b8d83087e6a5e8fc4a0d41
Important thing is that there should no "space" between the variables names and values. Otherwise, the startup script is not very smart in patching them.
The above values should match the values in Web Terminal:
root@7da0beb3-999b-434e-b5cf-f54527387a2a:/app/code# env | grep REDIS CLOUDRON_REDIS_HOST=redis-7da0beb3-999b-434e-b5cf-f54527387a2a CLOUDRON_REDIS_URL=redis://redisuser:8cca7ae6eee15ef77b298a8269b8d83087e6a5e8fc4a0d41@redis-7da0beb3-999b-434e-b5cf-f54527387a2a CLOUDRON_REDIS_PASSWORD=8cca7ae6eee15ef77b298a8269b8d83087e6a5e8fc4a0d41 CLOUDRON_REDIS_PORT=6379
@girish Thank you! It was, the solution in your linked thread fixed it.
stormgrass last edited by stormgrass
@girish I checked .env.production, but it doesn't have the Service Dependencies as posted by you. I do, however, get the kind of result you posted when querying env for REDIS.
My Cloudron is version 7.1.4, my Mastodon package is version 2.8.4, though (weirdly, the last update was "years ago").
EDIT: I DO have the service dependencies lines in .env.production, but not grouped in that order, under that heading, and the REDIS_PASSWORD variable has no value.
EDIT2: Just noticed that apparently my package is really outdated, as the current one when installing it from scratch is 3.4.6. Which is weird, because I've always had it set to automatically update, and when manually trying to update, there doesn't seem to be a newer package. Is there a way to update my current install to the latest version without completely wiping it?
@stormgrass ah, maybe you installed this long ago as a custom package or something ?
If you have the CLI tool installed, you can try something like this:
cloudron update --app <domain> --appstore-id org.joinmastodon.cloudronapp
This will make it an "appstore" app instead of a custom app and get updates moving forward .Hopefully, all the database migrations work depending on how outdated your installation is.
@girish Thank you, that did the trick! Not entirely sure how and why my install looked the way it did. I think I installed it first thing once it showed up in the app store, but back then it was still marked as unstable. Anyway, it's all good now, thank you!