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

Backup doesn't trigger when USB is plugged in #735

Open
lucasmz-dev opened this issue Aug 30, 2024 · 8 comments
Open

Backup doesn't trigger when USB is plugged in #735

lucasmz-dev opened this issue Aug 30, 2024 · 8 comments
Labels
needs info Requires more information from reporter

Comments

@lucasmz-dev
Copy link
Contributor

lucasmz-dev commented Aug 30, 2024

When first plugging in a USB used for backup, the backup process will only start when the app is opened, not automatically in the background. This goes against what is said in Seedvault under scheduling, "Backups will be made automatically after you connect your USB drive".

Android version: 14, CalyxOS 5.10.3-2
Method of backup: USB Drive

@lucasmz-dev lucasmz-dev changed the title Automatic backup scheduling doesn't automatically trigger when USB is plugged in Automatic backup scheduling doesn't trigger when USB is plugged in Aug 30, 2024
@lucasmz-dev lucasmz-dev changed the title Automatic backup scheduling doesn't trigger when USB is plugged in Backup doesn't trigger when USB is plugged in Aug 30, 2024
@lucasmz-dev
Copy link
Contributor Author

Logs taken right after opening Seedvault and the backup process started: seedvault-14-4.0-1725061029282.txt

@grote
Copy link
Collaborator

grote commented Sep 2, 2024

I extracted the relevant lines from the log:

08-30 20:36:53.527  1868  2387 D UsbHostManager: USB device attached: vidpid 0781:5595 mfg/product/ver/serial  USB/ SanDisk
08-30 20:36:53.537  1868  2387 D UsbHostManager: Added device UsbDevice[mName=/dev/bus/usb/001/002,mVendorId=1921,mProductId=21909,mClass=0,mSubclass=0,mProtocol=0,mManufacturerName= USB,mProductName= SanDisk 3.2Gen1,mVersion=1.00,mSerialNumberReader=com.android.server.usb.UsbSerialReader@36908d1, mHasAudioPlayback=false, mHasAudioCapture=false, mHasMidi=false, mHasVideoCapture=false, mHasVideoPlayback=false, mConfigurations=[
08-30 20:36:53.537  1868  2387 D UsbHostManager: UsbConfiguration[mId=1,mName=null,mAttributes=128,mMaxPower=112,mInterfaces=[
08-30 20:36:53.537  1868  2387 D UsbHostManager: UsbInterface[mId=0,mAlternateSetting=0,mName=null,mClass=8,mSubclass=6,mProtocol=80,mEndpoints=[
08-30 20:36:53.537  1868  2387 D UsbHostManager: UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=512,mInterval=0]
08-30 20:36:53.537  1868  2387 D UsbHostManager: UsbEndpoint[mAddress=2,mAttributes=2,mMaxPacketSize=512,mInterval=0]]]]
08-30 20:36:53.560  1868  1962 I ActivityManager: Start proc 12860:android.process.media/u0a94 for broadcast {com.android.mtp/com.android.mtp.UsbIntentReceiver}
08-30 20:36:53.913  1868  1962 I ActivityManager: Start proc 12924:com.stevesoltys.seedvault/u0a163 for broadcast {com.stevesoltys.seedvault/com.stevesoltys.seedvault.UsbIntentReceiver}
08-30 20:36:54.039 12924 12924 D UsbIntentReceiver: Last backup older than it should be, requesting a backup...
08-30 20:36:54.041 12924 12924 D UsbIntentReceiver:   Thu Aug 29 21:06:16 GMT-03:00 2024
08-30 20:36:59.202 12924 12924 I BackupStateManager: appBackupRunning: false, filesBackupRunning: false, workInfoState: SUCCEEDED
08-30 20:37:05.465  1868  2637 I ActivityManager: Background started FGS: Allowed [callingPackage: com.stevesoltys.seedvault; callingUid: 10163; uidState: TOP ; uidBFSL: [BFSL]; intent: Intent { cmp=com.stevesoltys.seedvault/.storage.StorageBackupService (has extras) }; code:PROC_STATE_TOP; tempAllowListReason:<,reasonCode:SYSTEM_ALLOW_LISTED,duration:9223372036854775807,callingUid:-1>; targetSdkVersion:34; callerTargetSdkVersion:34; startForegroundCount:0; bindFromPackage:null: isBindService:false]
08-30 20:37:05.478 12924 12924 I BackupStateManager: appBackupRunning: false, filesBackupRunning: true, workInfoState: SUCCEEDED
08-30 20:37:05.479 12924 12924 D BackupService: onStartCommand Intent { cmp=com.stevesoltys.seedvault/.storage.StorageBackupService (has extras) } 0 1
08-30 20:37:08.116 12924 13248 D SmallFileBackup: Zip Chunks: 2
08-30 20:37:08.117 12924 13248 E Time    : Backing up 8 small files took 304ms

So this looks like Seedvault is notified of the change and starts a file backup. This is still in progress when the log ends, so no way to know if the app backup afterwards gets triggered as well, but I'd assume so.

When first plugging in a USB used for backup, the backup process will only start when the app is opened, not automatically in the background.

Did you open the app for backup to start in this log?

@grote grote added the needs info Requires more information from reporter label Sep 2, 2024
@lucasmz-dev
Copy link
Contributor Author

Did you open the app for backup to start in this log?

Yep. I used the log feature inside Seedvault if that's helpful. I can take another log soon if you'd like me to wait a longer interval before opening Seedvault.

@lucasmz-dev
Copy link
Contributor Author

I do notice a few times backups erroring out which I find weird, not sure if its related...

@grote
Copy link
Collaborator

grote commented Sep 2, 2024

Flash drive was plugged in at 20:36:53.527.
Seedvault got informed at 20:36:53.913.
It requested the backup at 20:36:54.041.
Files backup was started at 20:37:05.479.

So between plugging in the drive and starting the backup 12 seconds had passed. In those 12 seconds you had opened the app? Hard to know that it would not have started the backup otherwise.

@lucasmz-dev
Copy link
Contributor Author

It has been a while... I don't remember unfortunately.. Usually I see the backup notification showing up right away when I open the app, or at worst 2 seconds later

@lucasmz-dev
Copy link
Contributor Author

lucasmz-dev commented Sep 3, 2024

seedvault-14-4.0-1725374138847.txt

Here I noticed I plugged the drive in, had to open the backup app for it to start "automatically", and in the end it failed and restarted the backup.

seedvault-14-4.0-1725374329368.txt

This was right after the backup that was done as a retry automatically by Seedvault finished

@lucasmz-dev
Copy link
Contributor Author

Afterwards, I tried opening the backup app in my work profile, and it did not start automatically even when I opened it.

seedvault-14-4.0-1725374499409.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Requires more information from reporter
Projects
None yet
Development

No branches or pull requests

2 participants