-
Notifications
You must be signed in to change notification settings - Fork 983
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
admin.peers() is empty #3271
Comments
Just did one more run – admin.peers() were empty in the beginning, but ~90 seconds later after polling, one peer appeared:
And after that, app was able to request messages from that peer just fine. |
It looks like the time reported by the emulator is different than the time on the server. The app thinks it got a message from the future and, following the Whisper protocol, it disconnects the peers immediately. Not sure how your OS works or how the emulator works, but it looks like when the laptop goes to sleep, it stops syncing the clock (or, more likely, the emulator stops doing that) and when it gets awaken, the app receives messages before emulator's clock is synced. I assume both logs were written at the same time. On the first one, it's I believe @flexsurfer reported the similar problem with the clock. Overall, the behavior of Whisper is not really what we expect I believe. Desynchronisation of the clock on mobile devices can happen in many situations and it's not as stable as on a desktop. I see two possible solutions:
I would try (1) and if it does not work try (3). |
Oh, that would suggest that there is a reconnecting mechanism. It just probably does it every N minutes. Can you please upload the whole |
@dmitryn @yenda I've tried to run such bash script on local machine and it looks like it solves the issue with Genymotion Emulator: |
@JekaMas i'm having error:
|
@dmitryn Do you use Mac? |
@JekaMas i have Looks like geth.log time is UTC and simulator is UTC -5 |
After debugging session with @JekaMas we found out that this script helps to sync time in android emulator (works on OSX):
Issue regarding empty admin.peers() still persist when you try to connect to @adambabik do you know what ports should we use to connect? And what mailserver node should be used as default? |
One thing to keep in mind is that after each network connectivity loss admin.peers will be 0 for ~30s or so. More information about this here: status-im/status-go#646 . We will be able to fix it once approach described in status-im/status-go#649 will be fully implemented. |
@dshulyak thanks, good to know. Should not be a problem as we only need it during startup, and if it's empty we do ~100 retries for ~6 minutes. |
Type: Bug
Description
When app starts it connect to peers for messaging and offline inboxing. Sometimes, usually on next day in the morning , i start app in emulator and see
admin.peers()
is empty in the logs on app initialize.Steps to reproduce
Operating System: Android Genymotion Emulator
Logs
geth.log
adb logcat
Notes
Notice that time in logcat and geth.log is out of sync.
Part of status-im/swarms#71
The text was updated successfully, but these errors were encountered: