Jump to content

Possible fix if your sync stops working


PhyberApex
 Share

Recommended Posts

Hey,

 

just ran into a issue with sync and fixed myself. My sync just stopped working and nothing seemed to fix it. Tried removing and re-adding all syncs, tried clearing cache / data. What finally fixed it was disabling and re-enabling the sync for the emby account in the android settings fixed it. Just in case you stumble upon the same issue. Not sure what triggered that behaviour.

 

~Cheers

Link to comment
Share on other sites

zigzagtshirt

Hey,

 

just ran into a issue with sync and fixed myself. My sync just stopped working and nothing seemed to fix it. Tried removing and re-adding all syncs, tried clearing cache / data. What finally fixed it was disabling and re-enabling the sync for the emby account in the android settings fixed it. Just in case you stumble upon the same issue. Not sure what triggered that behaviour.

 

~Cheers

 

 

Thanks for the helpful tip.

 

Can you specifically describe what wasn't working properly with sync?  What was the behavior of it?

 

Also, if you are still able to access a log from when it wasn't working, I'm sure the devs would appreciate seeing it so they could identify the bug.

Link to comment
Share on other sites

Actually I was not able to find the logs for Android in the mentioned folder "/Android/data/com.mb.android/files/logs" in a sticky in this forum. The actual behaviour I got was, that the sync got added but were stuck on "queued" or "ready for transfer" on the server log I could see that a request was made if I pressed the sync button in the app.

 

Hope this helps.

 

~Cheers

Link to comment
Share on other sites

I have a similar issue too -- the media would convert and then just sit in the "Ready to Transfer" state forever. Clicking the sync button didn't do anything. I verified the app had Storage Permissions. I cleared Cache & Data and that didn't help.  Finally I did a full uninstall and that fixed it temporarily (it transferred items I had marked previously, but when I tried to sync new items they just sat in "Ready to Transfer" again)

 

@@PhyberApex -- My logs were nested in the /sdcard/ directory  (so /sdcard/Android/data/com.mb.android/files/logs)

 

I didn't see anything in the logs related to syncing, but I'm not very familiar with them.

 

Android 6.0 -- Emby 2.8.79  (and I've tried version 2.8.82 APK from the Emby site as well but still has the bug)

Link to comment
Share on other sites

zigzagtshirt

@@PhyberApex @@adam1010

 

Did you go to the Scheduled Tasks on the server, and run the process that transfers the files?  I can't remember what the process is titled (I can't view my server at the moment to check).  If I remember correctly, once the sync process completes, there is a separate process that copies the temp files into a permanent file and transfers it to where ever it is to be stored.  Your settings might have it set to run only once a day on its own, or it might be disabled. 

Link to comment
Share on other sites

@@zigzagtshirt

 

Thanks for your message! I did try just leaving one in the "Ready to Transfer" state for a few hours and it eventually synced. I'll try a few more to verify that it's just a delay issue.

 

1) Does the Green Sync/Refresh button in the Android app not do anything? (i.e. the videos can only be "pushed" from the server and can NOT be "pulled" from the app)  When I push the button it says "Sync started", making it seem like it's initiating the transfers (but it doesn't)

 

2) I looked at the "Scheduled Tasks" on the server and the only one that mine shows relating to Sync is "Remove Old Sync Data". Running that didn't trigger the transfers. I'm running server version 3.2.8.0. In the past I've seen it transfer immediately upon completion of transcoding.

Link to comment
Share on other sites

zigzagtshirt

@@adam1010

 

1) I believe that only puts the media into a "queue" and it doesn't get pushed from the server until the "Cloud & Folder Sync" task runs.

 

2) The Scheduled Task is "Cloud & Folder Sync"

 

  58dadc920e35f_sync.jpg

Link to comment
Share on other sites

No that isn't true. The task is called "Cloud & Folder Sync" - it is not related to syncing with Android.

 

Is is Convert Media task that manages the conversion queue.

  • Like 1
Link to comment
Share on other sites

The only scheduled task I have in my "Sync" section is "Convert Media" (which doesn't appear to trigger the transfers).

 

The "Cloud & Folder Sync" task I was missing became available once I installed the "Folder Sync" plugin. When I removed that plugin the "Cloud & Folder Sync" task was removed as well.

 

So is the verdict then that there is NO WAY to manually trigger the the file transfer? You're just forced to wait a couple hours (as a feature)?

Link to comment
Share on other sites

The only scheduled task I have in my "Sync" section is "Convert Media" (which doesn't appear to trigger the transfers).

 

The "Cloud & Folder Sync" task I was missing became available once I installed the "Folder Sync" plugin. When I removed that plugin the "Cloud & Folder Sync" task was removed as well.

 

So is the verdict then that there is NO WAY to manually trigger the the file transfer? You're just forced to wait a couple hours (as a feature)?

 

@@adam1010, the sync task in the app runs every 15 minutes, so as soon as the conversion is done, it will generally not be that long.

Link to comment
Share on other sites

@@adam1010, the sync task in the app runs every 15 minutes, so as soon as the conversion is done, it will generally not be that long.

Additional you can trigger this task manually if you need it to happen now by disabling sync for the emby account in your android account settings and re-enabling it. At least that works for me if I need it urgently.

 

~Cheers

Link to comment
Share on other sites

Good to know, thank you!

 

What's the best way to notify the Android devs about this? That green sync button on the "Downloads" screen should manually trigger any pending transfers (or it needs to be removed because it's useless/confusing).   Or if that's too much work, lowering the interval from 15min to 5min would also satisfy my use case (although I'm guessing it would result in more battery usage which isn't great) -- but since we're able to trigger the transfers by toggling that Sync option in the settings, I wouldn't think much work would be needed to make the green button do the same thing.

Link to comment
Share on other sites

There is a button inside the app to trigger it manually, just click the Downloads tab at the button, there will be a button on that screen.

Link to comment
Share on other sites

If that green refresh/sync button on the Downloads tab is supposed to trigger transfers, then there is definitely a bug to report.

 

I just tried syncing a TV episode with Original quality (so no transcoding is necessary). I clicked the green Sync button on the Downloads tab and the message "Sync started" appeared. I waited 5 minutes (plenty of time to transfer over my 802.11ac connection) and it still says "Ready to Transfer". Usually during transfer the status will change to "Transferring: x%" to let you know that it's copying the bytes -- but that never happened.

 

What information would the devs need to figure out why the Manual Sync button isn't functioning properly on my device?

Link to comment
Share on other sites

I've posted a bug months ago about syncing to sdcards. Somehow the API that writes the file to the sdcard is too fragile, and stop randomly.

 

Eventually... if you try and wait a lot, all gets synced. But changing the Emby for Android data folder to INTERNAL has made sync perfect here.

 

Are you using internal or sdcard to sync?

Link to comment
Share on other sites

@anderbytes  Thanks for following up.  I'm using Internal memory (I verified that the SD card slot is empty).

 

I don't think stopping randomly is the problem because it never switches from "Ready to Transfer" to "Transferring: X%". So I take that to mean that the transfer is not being initiated when I press the button.

 

Is there anything from the log file I could provide to help narrow down the problem?

Link to comment
Share on other sites

Have in mind that the switch from states "Ready" and "Transferring" is very quick, and so is the switch back when something goes wrong. So there are good chances that the Transferring procedure starts but some immediate error makes it go back.

 

For my first guess, I can think about file permissions or diskspace.

 

Do you have all permissions enabled in Android for emby app? Any firewalls or antivirus meddling with Android?

 

Can you post some logs?

 

Afaik, Emby does a good job with it's schedules, and sync issues that don't even write usually are caused by the client device.

Link to comment
Share on other sites

@@anderbytes -- Thanks for feedback. I've got 14GB free on my internal storage (no SD card) and verified that the Emby app has the "Storage" permission enabled.  As you noted, it always syncs *eventually* so the storage and permissions should be good.

 

I tried added another episode to sync (with Original quality) and then pressed the green sync button (which displays "Sync started"). I waited a few seconds and then opened the log file.  There were a couple entries that seemed notable:

 

00:27:12.661 [main] DEBUG App - AndroidSyncFileRepository started. syncPath: /storage/emulated/0/Android/data/com.mb.android/files/sync

00:27:12.717 [main] DEBUG App - Calling MediaSyncAdapter.updateSyncPreferences. syncPath:

00:27:38.767 [main] INFO  App - file:///android_asset/www/bower_components/requirejs/require.js: Line 1 : Uncaught Error: Script error for "idb", needed by: bower_components/emby-apiclient/sync/itemrepository, bower_components/emby-apiclient/sync/useractionrepository

00:27:58.256 [main] INFO  App - file:///android_asset/www/bower_components/emby-webcomponents/emby-tabs/emby-tabs.js?v=31: Line 1 : Uncaught (in promise) TypeError: Cannot read property 'classList' of undefined

Link to comment
Share on other sites

That kind of error can only be diagnosed by the devs. Hope they are looking at this

Link to comment
Share on other sites

The files probably weren't ready on the server yet.

Luke, if this "weren't ready yet" is a known and normal happening, the log shouldn't throw an error like that, and a message box (or info at page) should appear.

 

I say this because the end user thinks the file is available, when it is not, and diagnosing an issue gets harder when those kind of "false positive" appear in the log.

 

Just an idea.

Link to comment
Share on other sites

All of my tests were done using "Original" quality (no transcoding was performed) -- so I'm not sure why they wouldn't be instantly available for transfer.

 

Is there an Android dev you know of we could mention on this thread to loop them in?

Link to comment
Share on other sites

  • 4 weeks later...

@@Luke Is a particular Android dev I can report this to? I'm happy to help with debugging -- since I was using sync with "Original" quality, there does appear to be a bug.

Link to comment
Share on other sites

  • 2 weeks later...

@@Luke What's the handle for the Android mobile dev? I would like to loop them in on this and I've got another unrelated bug report I'm working on as well. Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...