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

Stuck on initial sync #983

Closed
ppapadeas opened this issue Feb 11, 2020 · 25 comments · Fixed by #2674
Closed

Stuck on initial sync #983

ppapadeas opened this issue Feb 11, 2020 · 25 comments · Fixed by #2674
Assignees
Milestone

Comments

@ppapadeas
Copy link

Using latest Android build from play store. After signing in with a matrix.org account I am stuck on an endless "Initial Sync: Importing account"
SmartSelect_20200211-145358_RiotX

@mairin
Copy link

mairin commented Feb 19, 2020

I have the same thing going on.

Update: tried clearing cache, rebooting, uninstalling and reinstalling, none seem to fix it. I let it sit for ~48 hours and no change.

@emmaguy
Copy link
Contributor

emmaguy commented May 8, 2020

Just ran into this too and happened to have logcat open - it was caused by a timeout exception (sorry, didn't keep the stacktrace!). I think the matrix.org server was just being very slow at the time, have retried again now and it worked okay.

The app could recover better - the spinner just keeps on spinning, so there's no way to recover or even know it's failed in the background.

@Dorifer
Copy link

Dorifer commented Jun 12, 2020

I seem to have the same problem unsing the most recent version from f-droid (0.210) and a custom synapse server (chaostreff.at) the app successfully connects to the server but seems to be starting over the initial sync over and over again.

@ppapadeas
Copy link
Author

Problem still persists as of updated version on 2020-07-20.
Nice call on force updating old riot.im apps to Element on Android. Now I cannot use my matrix.org on my phone. Good call 👍

@mairin
Copy link

mairin commented Jul 24, 2020

I have the same issue with Element now, it never resolved. I can't log into matrix at all now from my mobile :(

@SuperSandro2000
Copy link

Same happening to me. Couldn't find any meaningful error.

@NHAS
Copy link

NHAS commented Aug 13, 2020

This is definitely still an issue, Im running into it now. This is on a custom homeserver, that lives in my local network with no other users, so unlikely to be just because of slowness.

Bit of a blocking issue for me to get my friends on this.

As some added information, if you sign up through the android app you can access that account just fine. Just logging in to an existing account seems to trigger this issue. Cross signing perhaps?

Did anyone end up coming up with a solution to this?

@bill-rich
Copy link

I'm running into the same problem with a custom home server. I haven't found a solution yet.

@bmarty bmarty added this to the Sprint13 milestone Aug 21, 2020
@NHAS
Copy link

NHAS commented Aug 22, 2020

@bill-rich In the end it turned out that I had misconfigured public_baseurl under synapse to point to the wrong domain.

This happened due to me using delegation to assign matrix.certainlyawesome.com as my matrix server, However, I misunderstood the purpose of public_baseurl and set it to https://certainlyawesomesome.com instead of the correct value of https://matrix.certainlyawesome.com.

As initially this issue deals with matrix.org, I'd be very surprised if they had made the same mistake. So its probably two different issues leading to the same presentation.

@SuperSandro2000
Copy link

I have a sec record and we'll known forwarding. Federation tester is happy, too and it worked very well with riotx and still does with riot web. So it probably isn't an issue with the Homeserver.

@bmarty
Copy link
Member

bmarty commented Aug 26, 2020

@Dorifer I tried to create an account on chaostreff.at but registration is disabled.
I do not reproduce the issue on matrix.org, so anyone who encounter the issue please provide homeserver url and test account if you want us to investigate this.

@bmarty bmarty self-assigned this Aug 26, 2020
@jan--f
Copy link

jan--f commented Aug 30, 2020

I was about to open create a test account as I had the same issue. I wanted to make sure everything was configured correctly before commenting here.
Turns out (I believe) that there was a configuration error that caused this behaviour. I sadly didn't make backup of the ostensibly broken config but I think the issue was the following:
The matrix-synapse docu had a change recently in the sample reverse proxy config introduced by matrix-org/synapse#7823.
My synapse server runs under the matrix subdomain, served by nginx. synapse itself binds to 8008 on localhost. My nginx site for matrix would proxy <mydomain>:8448 to localhost:8008 as the example used to indicate. I think it should have forwarded matrix.<mydomain>:8448. After adjusting the site config according to the current reverse proxy exmaple, the inital sync succeeds just fine.

Keep in mind I'm writing this after the fact and I might have changed other things on the way I don't remember or add/leave out mistakes, but this is my best recollection of how I got to a working setup. So grains of salt apply but maybe this can be helpful to others.

@SuperSandro2000
Copy link

@jan--f that can't be the problem in my case. I only ever served https on port 443 and never change that. It could be the case that the postgres crashed due to OOM. My monitoring never catched that because it does not collect data as fast and the high memory was only ever for very short periods.

@bmarty bmarty modified the milestones: Sprint13, Sprint 14 Sep 14, 2020
@bmarty bmarty removed this from the Sprint 14 milestone Oct 5, 2020
@ghost
Copy link

ghost commented Oct 16, 2020

In the end it turned out that I had misconfigured public_baseurl under synapse to point to the wrong domain.

This happened due to me using delegation to assign matrix.certainlyawesome.com as my matrix server, However, I misunderstood the purpose of public_baseurl and set it to https://certainlyawesomesome.com instead of the correct value of https://matrix.certainlyawesome.com.

I had this issue as well and it turned out to be the wrong public_baseurl -- the comment felt like it implies it should be the url at the end of usernames, not the delegated url. (English is not my home language)

@wlcx
Copy link

wlcx commented Nov 23, 2020

Seeing this with element 1.0.10 and dendrite 0.3.1 too... Stays stuck at this dialog across force quits and restarts of the app/phone as others have reported.

@ShadowJonathan
Copy link
Contributor

This happens when the server is collecting too much data to send to the client, and so the client times out the connection, i see 200! happen on serverside requests (on synapse), which means that the client closed the connection.

Android really needs to not care about grabbing all pages upon first sync, i now cant log into matrix from my phone...

@ShadowJonathan
Copy link
Contributor

Update: I set filter_timeline_limit to 25 (manually) and now it finally logged in.

@Samgarr
Copy link

Samgarr commented Jan 10, 2021

Same issue here, lowering filter_timeline_limit did not help.

@ShadowJonathan
Copy link
Contributor

Looking further into it, and poking at some rough statistics and heuristics i got from the server, i have a suspicion that it's linked to inefficient stateres caching and resolution, and maybe linked with matrix-org/synapse#8612.

Should a synapse counterpart issue be created here? It's effectively a timeout on initial sync, where the server is too slow and only creates results after 400 seconds (according to the logs) or so, and doesn't cache the result afterwards.

Again, this is an issue where the internal exception mechanism just drops it, doesn't even update the UI to reflect it, and doesn't even retry the sync.

@Samgarr
Copy link

Samgarr commented Jan 13, 2021

I tried Fluffychat instead Element for Android and initial sync went without issue.

@bmarty bmarty added this to the Sprint 19 milestone Jan 13, 2021
@dakontiva
Copy link

@bill-rich In the end it turned out that I had misconfigured public_baseurl under synapse to point to the wrong domain.

This happened due to me using delegation to assign matrix.certainlyawesome.com as my matrix server, However, I misunderstood the purpose of public_baseurl and set it to https://certainlyawesomesome.com instead of the correct value of https://matrix.certainlyawesome.com.

As initially this issue deals with matrix.org, I'd be very surprised if they had made the same mistake. So its probably two different issues leading to the same presentation.

this worked for me too!

@bmarty
Copy link
Member

bmarty commented Feb 22, 2021

Ok, so probably due to some misconfiguration server side and also matrix-org/synapse#9264 which is now fixed.

@telmich
Copy link

telmich commented Sep 19, 2021

I see the exact same problem for an account with a lot of rooms and high latency (Korea <-> Switzerland). While element-web is able to pickup, element/android seems to stay in that endless loop, now for 72h.

@ouchadam
Copy link
Contributor

ouchadam commented Oct 1, 2021

I've also randomly encountered this using a matrix.org account, the account has 1 DM and 1 room (matrix-hq)
From the adb logs I could see the sync task completed multiple times and was in the waiting for future events phase.

Closing the app from recents and relaunching, everything works as expected

  • No foreground service is running (at least there's no notification)
    2021-10-01T12:52:02,664318307+01:00

@bmarty
Copy link
Member

bmarty commented Oct 8, 2021

on EA 1.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.