jberkel / sms-backup-plus

Backup Android SMS, MMS and call log to Gmail / Gcal / IMAP
https://play.google.com/store/apps/details?id=com.zegoggles.smssync
Apache License 2.0
1.81k stars 498 forks source link

Automatic backup not worked for about a year #954

Closed turkeyphant closed 3 years ago

turkeyphant commented 5 years ago

Expected behaviour

Automatic backup to work according to regular schedule and post-receipt schedule settings.

Actual behaviour

Only manual backups work.

Steps to reproduce the behaviour

Set automatic backup to every 30 mins and receipt backup to 1 min after receiving a new SMS.

Receive an SMS/wait 1 hour.

No backup since last manual backup.

Last time it attempted an automatic backup was in August and then even after 34 SMS and 48 calls were logged, it did not do another automatic backup and I had to trigger it manually.

12-08 02:58 Backup requested (incoming)
12-08 02:58 Starting backup (INCOMING)
12-08 02:58 Skipped (no items found)
12-08 02:58 BackupState{currentSyncedItems=0, itemsToSync=0, backupType=INCOMING, exception=null, state=FINISHED_BACKUP}
12-08 02:58 Backup finished
12-08 12:29 Backup requested (regular)
12-08 12:29 Starting backup (REGULAR)
12-08 12:29 Skipped (no items found)
12-08 12:29 BackupState{currentSyncedItems=0, itemsToSync=0, backupType=REGULAR, exception=null, state=FINISHED_BACKUP}
12-08 12:29 Backup finished
23-08 14:15 Backup requested (manual)
23-08 14:15 Starting backup (MANUAL)
23-08 14:15 Backing up (34 SMS, 0 MMS, 48 call log)
23-08 14:15 Using config: BackupConfig{imap=BackupImapStore{uri=imap+ssl+://XOAUTH2:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX@imap.gmail.com:993}, currentTry=0, maxItemsPerSync=-1, groupToBackup=ContactGroup{_id=-1, type=EVERYBODY}, backupType=MANUAL, debug=true, typesToBackup=[SMS, MMS, CALLLOG]}
23-08 14:15 need to perform xoauth2 token refresh
23-08 14:15 token refreshed, retrying
23-08 14:15 Backing up (34 SMS, 0 MMS, 48 call log)
23-08 14:15 Using config: BackupConfig{imap=BackupImapStore{uri=imap+ssl+://XOAUTH2:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX@imap.gmail.com:993}, currentTry=1, maxItemsPerSync=-1, groupToBackup=ContactGroup{_id=-1, type=EVERYBODY}, backupType=MANUAL, debug=true, typesToBackup=[SMS, MMS, CALLLOG]}
23-08 14:17 BackupState{currentSyncedItems=82, itemsToSync=82, backupType=MANUAL, exception=null, state=FINISHED_BACKUP}
23-08 14:17 Backup finished

Please specify the following:

srauco commented 5 years ago

I have the same issue. It will manually backup, and says it's scheduled for the next increment, but never fires.

Android 9 Pixel 3 1.5.11 Stock Android Messenger

MaKali42 commented 5 years ago

I've been having the same problem since the beginning of 2019 with the backup schedule not initiating but manual working just fine. I've checked all settings for both the app and phone, tried different schedules, and made sure everything is up to date. Android 7.0 Note5 1.5.11 Stock messenger

kwinz commented 5 years ago

I have the same problem. Galaxy S7. Stock Android 8.0 SMS backup is in the Doze "do not optimize"app exception list. And also in the Samsung "don't put to sleep" list. But still only manual backups work.

wuxxin commented 5 years ago

also affected: Google Pixel with Lineage 16 (Android 9), SMS Backup+ from fdroid Version 1.5.11 what is working: start manual backup what is not working: automatic Backup (but selected) what is greyed out: "Connect" (Verbinden in German) can not be selected probably a duplicate: #957

kurahaupo commented 4 years ago

To confirm whether this is power-related, does your phone have the option to "never sleep while charging"? If so, turn that on, leave it on the charger, send it a message from another phone, and then let us know whether any automatic backup occurs.

Obviously that's not a permanent solution, but it helps by ruling out possible causes.

wuxxin commented 4 years ago

i only found "do not put display to sleep while charging", which was off, and i will switch it on for a test run. Also i put sms backup in the list of "non optimized" battery applications. i will write tommorrow if anything of these two settings changed something

kurahaupo commented 4 years ago

thanks, I await your findings.

turkeyphant commented 4 years ago

I don't have that option. Just checked the app and it hadn't updated since October 2019. Running manually worked fine.

wuxxin commented 4 years ago

none of the settings did make sms backup execute the backup. i pushed the manual backup button right now, and (as expected) it backed up my calls and sms from last day.

kurahaupo commented 4 years ago

It's worth noting that the majority of scheduling failures are related to power management.

It would help diagnostic efforts if everyone could check whether or not bypassing power management fixes each problem. The easiest way to do that it to enable "keep screen on when charging" and put the phone on charge; then send a test message, and wait.

turkeyphant commented 4 years ago

Just tried that and no dice. MightyText started syncing immediately though.

kurahaupo commented 4 years ago

@turkeyphant, @wuxxin thanks for doing that.

kurahaupo commented 3 years ago

I should have said sooner, the next thing is to enable and upload the debug log, so we can see whether SMS Backup+ is waking up but failing to sync, or not waking up.

If you are still having this problem (that is, manual backup works, but automatic backups do not) please:

  1. enable the debug log
  2. wait until the next time you notice it's failed to automatically back up a message
  3. add a comment to this ticket:
    • uploading your log (preferably as a file, not an image); AND
    • stating whether the device was apparently on WiFi, or on mobile data, or disconnected (which icons are in the status tray); AND
    • stating whether the device was awake with SMS Backup+ in the foreground, awake but doing something else, or asleep; AND
    • describing if and how any of those changed over the time covered by the log; AND
    • as always, the device & OS version

My suspicion is that on some phones, apps can be woken up but WiFi and/or mobile data might still be in "low power" mode and therefore not immediately unavailable, and that "try again in 5 seconds" might resolve the problem.

Another possibility is that the phone's security system doesn't want to let any background apps initiate direct TCP connections (instead of known APIs) "because malware blah blah", but isn't telling anyone.

It would also be really helpful if you have access to intercept WiFi data (tcpdump on your router?) and can check whether there's an outgoing TCP SYN to port 143 or 993 and a return SYN/ACK, at the time when the log indicates that it wakes up and attempts (but fails) to initiate an IMAP connection.

Also very useful would be if use your own IMAP server and can compare logs from both ends.

kurahaupo commented 3 years ago

Thanks everyone for the feedback.

Using the new Oreo JobScheduler API is on the roadmap.

I'm marking this as a duplicate of #758 just so we can track one issue and keep all the feedback in one place.