Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Mastodon can't connect to Redis

    Mastodon
    2
    7
    914
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stormgrass last edited by

      Hello,
      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,
      Richard

      girish 2 Replies Last reply Reply Quote 0
      • girish
        girish Staff @stormgrass last edited by

        @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

        S 1 Reply Last reply Reply Quote 0
        • Moved from Support by  girish girish 
        • girish
          girish Staff @stormgrass last edited by

          @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
          
          S 1 Reply Last reply Reply Quote 0
          • S
            stormgrass @girish last edited by

            @girish Thank you! It was, the solution in your linked thread fixed it.

            1 Reply Last reply Reply Quote 0
            • Topic has been marked as a question  nebulon nebulon 
            • Topic has been marked as solved  nebulon nebulon 
            • S
              stormgrass @girish 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?

              girish 1 Reply Last reply Reply Quote 0
              • girish
                girish Staff @stormgrass last edited by

                @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.

                S 1 Reply Last reply Reply Quote 1
                • Topic has been marked as unsolved  girish girish 
                • S
                  stormgrass @girish last edited by

                  @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!

                  1 Reply Last reply Reply Quote 2
                  • Topic has been marked as solved  nebulon nebulon 
                  • First post
                    Last post
                  Powered by NodeBB