Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix-synapse[823]: docker: Error response from daemon: path /matrix/synapse/storage is mounted on / but it is not a shared or slave mount. #703

Closed
RedJohn14 opened this issue Nov 2, 2020 · 9 comments
Labels
question This issue is a question related to installation

Comments

@RedJohn14
Copy link

Hello,

I can start the matrix-synapse container. all other containers are running without problem. In syslog I found this:

matrix-synapse[823]: docker: Error response from daemon: path /matrix/synapse/storage is mounted on / but it is not a shared or slave mount.

And ansible said:
"ansible_loop_var": "item", "changed": false, "item": "matrix-synapse", "msg": "matrix-synapse was not detected to be running. It's possible that there's a configuration problem or another service on your server interferes with it (uses the same ports, etc.). Try running systemctl status matrix-synapse and journalctl -fu matrix-synapse on the server to investigate."}

Any ideas?

@spantaleev
Copy link
Owner

This turned out to be because the whole thing was installed within an LXC container.

The solution was to remount / somehow, before starting this service.

I guess we can close this now. If you can provide more details about how you're solving this, it would probably be helpful to people who will find this thread in the future.

@bmanturner
Copy link

The solution was to remount / somehow, before starting this service.

This isn't helpful. I'd like to make sure the solution gets documented here for people like me.

Do you remember what you did?

@spantaleev
Copy link
Owner

I'm just summarizing what someone else told me he did. I haven't had this problem, but it's usually related to running our services within an LXC container, from what I've seen.

You'd need something like mount -o remount /, I think. Perhaps some other options next to remount. If you find out what works for you, feel free to post it.

@bmanturner
Copy link

I found that you would need to use mount -o remount,rw / but I couldn't figure out how to do it on a running LXC container so I opted to use a VM instead.

My apologies to anyone hoping for a good solution. I can tell you I tried both a privileged and unprivileged container with nesting and nfs enabled and it made no difference. You could potentially look into disabling AppArmor for this container and see if that helps you make any progress.

@RedJohn14
Copy link
Author

I found that you would need to use mount -o remount,rw / but I couldn't figure out how to do it on a running LXC container so I opted to use a VM instead.

My apologies to anyone hoping for a good solution. I can tell you I tried both a privileged and unprivileged container with nesting and nfs enabled and it made no difference. You could potentially look into disabling AppArmor for this container and see if that helps you make any progress.

I have fixed is in my lxc container with this command

mount --make-shared /

I used this command on every startup my lxc container and restart docker services. lxc container are more leighter than a vm.

Maybe with this solution we can make some fix?

@shreyasajj
Copy link
Contributor

@RedJohn14 can we make this a crontab on reboot?

@RedJohn14
Copy link
Author

@RedJohn14 can we make this a crontab on reboot?

Hey shreyasajj,

yes I have configure this in the cronjob.

Thank you!

@Haxprox
Copy link

Haxprox commented Sep 9, 2021

I think better option here is to edit 'matrix-synapse.service' systemd unit and add 'ExecStartPre'.
Somethink like that:

[Service]
Type=simple
Environment="HOME=/root"
ExecStartPre=-/usr/bin/env sh -c 'mount --make-shared /'
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker kill matrix-synapse 2>/dev/null'
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker rm matrix-synapse 2>/dev/null'

Works flawlessly but looks still awfully instead of using something before running the container.

@tnijboer
Copy link

Adding an systemd drop-in file is more persistent

mkdir -p /etc/systemd/system/matrix-synapse.service.d

create a file override.conf with the following content

[Service]
Type=simple
Environment="HOME=/root"
ExecStartPre=-/usr/bin/env sh -c 'mount --make-shared /'

After creating the file:
systemctl daemon-reload

@luixxiul luixxiul added the question This issue is a question related to installation label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question related to installation
Projects
None yet
Development

No branches or pull requests

7 participants