Closed pbruna closed 6 years ago
I think this is an issue with the docker image. I suggest raising it at https://github.com/silvio/docker-matrix.
The problem isn't docker related. This problem exists on all alpine installations without docker.
I have this issue too, on Synapse v0.18.7, would you please reopen the issue?
It's an issue with alpine linux, not synapse.
okay, thanks
Has this issue been reported on their side somewhere? I can not find anything in their bugtracker. Edit: After searching some more, and still not finding anything, I posted a bug report: https://bugs.alpinelinux.org/issues/6765
Yes, same problem. Can synapse avoid using ujson?
@ptman I don't think it will. Dendrite however will most likely not use ujson, once that is ready. Until then, I guess you'll just need to avoid alpine linux for running synapse.
I also tried to report this problem to ujson https://github.com/esnme/ultrajson/issues/254
We're not going to stop using ujson just because alpinelinux ship a broken version of it, no.
(or rather, whatever brokenness it is that alpinelinux has)
@richvdh I second that, but I think it will be a good idea to Throw a better error when the json parsing fails.
A segfault takes out the whole python process. We can't catch it and recover from within python.
hah! well, i guess that's one way to work around the segfaulting dep :D
How much faster than json is ujson anyway?
The following workaround seems to be working for me: https://github.com/esnme/ultrajson/issues/254#issuecomment-314862445
Despite wishful thinking on my part, this doesn't seem to have been fixed at ultrajson or alpinelinux, so it looks like we're going to have to find a workaround for this.
How much faster than json is ujson anyway?
"much", according to erik.
@richvdh hasn't the workaround already been found? s/ujson/json/g
It's a simple enough patch.
also, there is an open PR, they seem to be working on it over at ujson: https://github.com/esnme/ultrajson/pull/281
@richvdh hasn't the workaround already been found? s/ujson/json/g
We'd prefer not to drop all use of ujson, for performance reasons.
Could anyone who has been having trouble with this see if the patch in https://github.com/matrix-org/synapse/commit/e961569e9330da2108fbf75d8d51938a953c8469 helps them?
I've switched to Debian as a base long ago, but I still have the dockerfile from when I tried to use alpine. Do you want it?
I was trying to avoid setting up docker environments and hoping somebody else could test it...
I've tested your commit in this image. So far so good. I will come back here if I notice something bad.
For anyone who is following this discussion. We added a fix for stacksize issues within python which should fix the ujson segfault.
Its in alpine edge and backported to v3.7. Hope somebody can verify this so we can close this issue.
ref: https://github.com/alpinelinux/aports/commit/2f35283fec8ec451fe5fb477dd32ffdcc0776e89
@clandmeter Seems to work great, thanks @richvdh e961569 no longer seems necessary
Anyone interested can take a look at https://github.com/ptman/synapse-docker and https://hub.docker.com/r/ptman/synapse/
great news. @silvio any chance you could bump your docker images to include the fix?
@richvdh: @silvio has stopped maintaining the docker image, and it was Debian based for more than a year now anyway.
@jcgruenhage @richvdh : This is true, the current state of the dockerimages are using debian. I have added @andreaspeters as contributor to my docker repository. Maybe he wants to switch back to alpine based distributions.
@silvio @richvdh @jcgruenhage : I my fork I changed to "debian:stable-slim". Before I will merge it with the official docker-matrix version, I need some peoples who like to test it (https://hub.docker.com/r/avhost/docker-matrix/tags/). Just now, I have no plan to change back to alpine.
thanks all. either way it sounds like we can finally close this bug.
Hi, Im running Synapse v0.18.0 with Python 2.7.12. The users are authenticated agains our LDAP server. When using Riot.im on iOS everything works ok, but the instant I login with Chrome, or Safari, the servers crash and I guess the DB gets corrupted because I can't even use the iOS App anymore.
The las request Riot make before the crash is always a
synapse.rest.client.v2_alpha.sync
, like:Which produces the following log:
Note: I changed the real
username
,domain
andIPAddress
.Before the Crash, Riot make the following request without problem:
https://matrix.example.com/_matrix/client/r0/presence/username/status
https://matrix.example.com/_matrix/client/unstable/keys/upload/JZBZGPVPPK?access_token=
https://matrix.example.com/_matrix/client/r0/voip/turnServer?access_token
https://matrix.example.com/_matrix/client/r0/pushrules/?access_token
https://matrix.example.com/_matrix/client/r0/user/user/filter?access_token
https://matrix.example.com/_matrix/client/r0/sync?filter=0&timeout=30000&_cacheBuster=1474554706574&access_token
https://matrix.example.com/_matrix/client/unstable/sendToDevice/m.new_device/m147455436634.0?access_token=
https://matrix.example.com/_matrix/client/r0/user/username/account_data/m.direct?access_token
https://matrix.example.com/_matrix/client/r0/publicRooms?access_token=
Tha last return an empty
{}
because there is no public rooms. And the next request is the one that crash the server:Yesterday I debuged this and found that the crash happen when the
json.loads
method runs, of the filestorage/account_data.py
:The SegFault Info of
GDB
is:And the trace: