[SOLVED] Matrix Synapse no longer working, update error "matrix-synapse is kept back"

After this mornings auto-update Matrix has stopped working.

I clicked “Update now” to do a manual update. When it finished running, I saw the following message:

2023-10-09 11:05:21,336 INFO No packages found that can be upgraded unattended and no pending auto-removals
2023-10-09 11:05:24,641 INFO Package matrix-synapse is kept back because a related package is kept back or due to local apt_preferences(5).

Under the Matrix Synapse tab I also saw the message: “This application needs an update. Update now?”. I clicked “Update” and I got this error:

Error updating app: (‘Apt command failed with return code: 100’, b’freedombox set on hold.\n’, b’\x1b[97m INFO\x1b[0m \x1b[94mplinth.app \x1b[0m Initialized apps - apache, api, names, avahi, storage, backups, cockpit, firewall, config, datetime, diagnostics, dynamicdns, first_boot, help, letsencrypt, networks, power, privacy, security, snapshot, ssh, sso, upgrades, users, bepasty, bind, calibre, coturn, deluge, ejabberd, email, gitweb, i2p, ikiwiki, infinoted, janus, jsxc, matrixsynapse, mediawiki, minetest, minidlna, mumble, openvpn, pagekite, performance, privoxy, quassel, radicale, roundcube, rssbridge, samba, searx, shaarli, shadowsocks, shadowsocksserver, sharing, syncthing, tor, torproxy, transmission, ttrss, wireguard, wordpress, zoph\nE: Unable to correct problems, you have held broken packages.\n\x1b[31m ERROR\x1b[0m \x1b[94m__main__ \x1b[0m Error executing action: Apt command failed with return code: 100\nTraceback (most recent call last):\n File “/usr/share/plinth/actions/actions”, line 93, in _call\n return_values = func(*arguments['args'], **arguments['kwargs'])\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/usr/lib/python3/dist-packages/plinth/privileged/packages.py”, line 69, in install\n raise RuntimeError(\nRuntimeError: Apt command failed with return code: 100\n’)

I restarted my FreedomBox and tried updating again. It did not fix the issue.

Any suggestions for how to fix this so I can update Matrix and get it working again?

Under System > Software Update it says:

You are running Debian GNU/Linux 12 (bookworm) and FreedomBox version 23.18. FreedomBox is up to date.

1 Like

I uninstalled Matrix Synapse to see if that would resolve the problem with a fresh install - it did not.

Matrix Synapse

Error installing app: (‘Apt command failed with return code: 100’, b’freedombox set on hold.\n’, b’\x1b[97m INFO\x1b[0m \x1b[94mplinth.app \x1b[0m Initialized apps - apache, api, names, avahi, storage, backups, cockpit, firewall, config, datetime, diagnostics, dynamicdns, first_boot, help, letsencrypt, networks, power, privacy, security, snapshot, ssh, sso, upgrades, users, bepasty, bind, calibre, coturn, deluge, ejabberd, email, gitweb, i2p, ikiwiki, infinoted, janus, jsxc, matrixsynapse, mediawiki, minetest, minidlna, mumble, openvpn, pagekite, performance, privoxy, quassel, radicale, roundcube, rssbridge, samba, searx, shaarli, shadowsocks, shadowsocksserver, sharing, syncthing, tor, torproxy, transmission, ttrss, wireguard, wordpress, zoph\nE: Unable to correct problems, you have held broken packages.\n\x1b[31m ERROR\x1b[0m \x1b[94m__main__ \x1b[0m Error executing action: Apt command failed with return code: 100\nTraceback (most recent call last):\n File “/usr/share/plinth/actions/actions”, line 93, in _call\n return_values = func(*arguments['args'], **arguments['kwargs'])\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/usr/lib/python3/dist-packages/plinth/privileged/packages.py”, line 69, in install\n raise RuntimeError(\nRuntimeError: Apt command failed with return code: 100\n’)

upgrades: Allow matrix-synapse to be installed from bookworm was merged a couple of days ago and presumably will roll out with the next version of FreedomBox. It cleans up some issues related to matrix-synapse being in backports.

1 Like

Thank you! I will update here if that fixes the problem.

It is the second consecutive time that an update has either killed the whole box or one of the apps that is “supported” in the product. It does show how far Freedombox is from being a mainstream consumer product.

Love it when it works.

Back to Telegram for family comms until it is working again sometime in the future.

1 Like

It seems the two are related. Hopefully some of the ideas collected here will help prevent such problems in the future.

I also love my FreedomBox and hope we as a community can help avoid such problems in the future. Using it and giving feedback is one such way!

1 Like

A temporary workaround until the fix arrives in the latest release in a few days is to run the following command:

sudo su -
cat > /etc/apt/preferences.d/51freedombox-apps.pref << EOL
Explanation: This file is managed by FreedomBox, do not edit.
Explanation: matrix-synapse shall not be available in Debian stable but
Explanation: only in backports. Upgrade priority of packages that have needed
Explanation: versions only in backports.
Explanation: matrix-synapse >= 1.92.0-3 requires
Explanation: python3-canonicaljson >= 2.0.0~
Package: python3-canonicaljson
Pin: release n=bookworm-backports
Pin-Priority: 500
EOL

Confirm that the solution worked with the following command: (version 2.0.0.2 should show 500 priority):

$ apt policy python3-canonialjson
python3-canonicaljson:
  Installed: 2.0.0-2~bpo12+1
  Candidate: 2.0.0-2~bpo12+1
  Version table:
 *** 2.0.0-2~bpo12+1 500
        100 http://deb.debian.org/debian bookworm-backports/main amd64 Packages
        100 /var/lib/dpkg/status
     1.6.2-1 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
2 Likes

Thank you @sunil !

I would like to keep the default configurations in my daily-driver FreedomBox as close to the source as possible. Will the coming fix in the next release overwrite the above manual changes? I may just wait until the latest release, since it sounds like that will be soon.

A simpler solution that some suggested is to run the following command:

sudo apt install -t bookworm-backports matrix-synapse python3-canonicaljson
1 Like

The file will be overwritten by the future update. The file can be modified without repercussions. The contents of the file are also the exact contents the next release is carrying.

Thank you! I ssh’ed into the box, opened up a Screen session in case the connection gets lost, and then ran the simpler solution above.

Now I am getting the following “Package Configuration” prompt:

The name that this homeserver will appear as, to clients and other servers via federation. This name should match the SRV record published in DNS. Name of the server: ____

I assume I should write the Domain Name found under System > Dynamic DNS Client (e.g., NAME.freedombox.rocks).

Can someone here confirm this is correct before I break something?

I received some help in the IRC channel. It was fortunate that I ran the command in the Screen session as the connection was in fact lost.

For those reading this, the domain name is indeed that under System > Dynamic DNS Client, e.g., NAME.freedombox.rocks. After replying to an additional prompt about submitting usage statistics, the installation was complete and I restarted the FreedomBox from the Plinth interface. Now Matrix is back online.

Thanks to the community for the assistance!

This totally broke my Matrix install too. Trying the command doesn’t seem to help:

sudo apt install -t bookworm-backports matrix-synapse python3-canonicaljson

This is what I see after issuing the command:

I really like this project and use it every day, but version/update management is desperately lacking here. It shouldn’t be that hard to stay one version behind and/or have some simple controls in place. Come on guys, let’s make this a priority. Getting surprises like these that break everything can be prevented. Otherwise this will remain an experimental project forever, which completely contradicts why this exists.

I will setup another FB for testing, or do whatever I can to help make update control a priority. Please let’s just do this soon okay? I don’t have time to clown around fixing stuff when FB is plenty stable, but the updates break stuff suddenly. Happy to help in any way I can, but we really need to make this usable for people instead of just another silly tech-tinkering exercise.

*EDIT: Okay, I’ve fixed the corrupted package and it’s working. I’ve calmed down a bit. But why does Matrix keep breaking? I can disable updates on FB, but for how long? I guess I need setup another canary FB with auto updates on to see if something breaks before enabling updates on the FB I actually need to use huh?

2 Likes

Agreed but how to put it in practice?

What did you do to fix the corrupted package? It may help others who get a similar error message.

I cannot reply for the OP, but I can indicate what I had to do to make matrix work again:

I tried recently to connect from my Freedombox to another server and it appears I can no longer do so (I did in the past, before the manual update above). For example, if I try to join a known room #ROOM:SERVER.org, I get the error:

#ROOM:SERVER.org is not accessible at this time.

Try again later, or ask a room or space admin to check if you have access.

M_UNKNOWN was returned while trying to access the room or space. If you think you’re seeing this message in error, please submit a bug report.

I suspect it may have to do with this:

The name that this homeserver will appear as, to clients and other servers via federation. This name should match the SRV record published in DNS. Name of the server: ____

As I noted above, when I received the above prompt I put the Domain Name found under System > Dynamic DNS Client (e.g., NAME.freedombox.rocks).

Is it possible I should have written something else?

Other ideas about what the federation issue I am having is caused by?

Thank you!