Diaspora and Mastodon

Good afternoon fellow friends! Long time no see! I wanted to make a post letting you all know about a problem that’s so far not very well documented :slight_smile:

Some of us users out there (such as myself and a few other confirmed podmins) have found that installing Diaspora and Mastodon on the same server can be extremely troublesome. For the most part, simple configurations can get past most issues, but there is one issue that there is no simple solution for that doesn’t involve moving both platforms on different servers:

They both use the same redis database. This causes problems with your SIDEKIQ system. Essentially Mastodon and Diaspora are fighting over which platform gets to handle the next database request and if the wrong platform gets the wrong request, it doesn’t understand it and fails the request and vice versa.

This results in your redis federation posts not going through.

There are a couple of solutions I want to put forth for folks:

  1. If you can, please make sure your diaspora and your mastodon sites are on two DIFFERENT servers. That’s the best and easiest solution.
  2. If you can’t do that but can put mastodon in a VM, that will work too.
  3. Place Mastodon in a docker image.

PLEASE NOTE: Docker has known security flaws which are not recommended for systems administrators. Please do your read up and study: I do not recommend doing this unless you actually know what you’re doing!!!

Notice that option number three is NOT supported officially by any Diaspora representative and is to be taken at your own risk.

If you choose to ignore this issue, you may experience severe degredation of federation among both of your platforms.

Docker has no known security flaws. Things running in Docker might listen to public IPs and bypass firewalls, but that’s not Docker’s security flaw, that’s by design.

You are right, running Mastodon inside Docker is not supported by diaspora*. That’s stuff the folks from Mastodon support?!

IMO this is a big OUCH!.. To have multiple servers is not that obvious. Yes you can hire a 2nd VPS or something, but if you already have a VPS with the theoretical capacity to host another federated platform, it would be nice if they could reside on the same server.
I am not familiar with redis whatsoever, but isn’t there an option to start a 2nd instance/process on the same server?
I found this as extra stuff to read: https://www.nicovs.be/running-multiple-redis-instances-on-the-same-server/

1 Like

Dennis and I have spoken at length about this issue, and it doesn’t look like it’ll work well. Redis would need to be installed each on it’s own instance and working directory as well as have different ports configured. Even then, I’m not familiar with redis that much myself, so I’m not sure that would even work, because I’m not familiar with how changing redis configs might affect either platform if they expect certain settings to work.

It would be nice if they could both work in the same platform, but the official stance of Diaspora is that they won’t mesh well together and will cause conflicts.

For the record, I’m experiencing this problem right now, at all fault of my own, as Dennis warned me of this months ago, I ignored him, and now I’m suffering the consequences :stuck_out_tongue:. For now, I’m only writing this as a warning to other podmins who may come across this issue as I don’t expect there to be a solution for this any time soon.

1 Like

I found that one as well, but it doesn’t talk about running them in their own working directory. Again, i feel like I have too little skill and knowledge about this to try to implement it.

1 Like

Contrary to the config that has been linked on IRC, the one linked by @robb_nl might actually work, because it sets a different dir and dbfilename.

I still don’t suggest doing that, because that’d put you in a place that requires you to read the redis changelog for every update, making sure there is nothing new that might break if you run two instances and that requires config changes to make it work. That’s risky.

One thing I also mentioned on IRC is this config, which would allow diaspora to run on a non-0 Redis db. This probably works fine for diaspora, but other applications might run into trouble if they do funny iterations or manual SELECT calls for some reason.

Also, this is not only affecting Mastodon. Running any two applications using Redis at the same time with the same Redis instance is probably a bad idea, unless you know all involved applications very well. The installation guides carry a note for that in the “requirements” section.

2 Likes

A post was split to a new topic: Sidekiq unable to start