Jump to content

Trakt failing with the "sync to" library task


Bazzu85

Recommended Posts

Bazzu85

Hi,

after the trakt api downtime I'm trying to run a "sync to" task to update the watched contents during the period.

after almost 2 minutes the scheduled task fails.

here's the log: log

suggestions?

Edited by Bazzu85
Link to comment
Share on other sites

MBSki

Try getting another pin for the user you want to sync. I also revoked access to Emby on the trakt.tv site, although i'm not sure that step is necessary. Just getting a new pin should do the trick.

Link to comment
Share on other sites

Eigeplackter
Quote
*** Error Report ***
Version: 4.8.0.21
Command line: /volume4/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
Operating system: Linux version 4.4.180+ (root@build13) (gcc version 8.5.0 (GCC) ) #42962 SMP Tue Sep 20 22:35:56 CST 2022
Framework: .NET 6.0.8
OS/Process: x64/x64
Runtime: volume4/@appstore/EmbyServer/system/System.Private.CoreLib.dll
Processor count: 4
Data path: /var/packages/EmbyServer/var
Application path: /volume4/@appstore/EmbyServer/system
MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: BadRequest
at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
at Trakt.Api.TraktApi.PostToTrakt(String url, Object data, CancellationToken cancellationToken, TraktUser traktUser)
at Trakt.Api.TraktApi.RefreshUserAuth(TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.Api.TraktApi.SetRequestHeaders(HttpRequestOptions options, TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.Api.TraktApi.GetFromTrakt(String url, TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.Api.TraktApi.SendGetAllWatchedMoviesRequest(TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.ScheduledTasks.SyncLibraryTask.SyncMovies(User user, TraktUser traktUser, TraktApi traktApi, ISplittableProgress`1 progress, CancellationToken cancellationToken)
at Trakt.ScheduledTasks.SyncLibraryTask.SyncUserLibrary(User user, TraktUser traktUser, TraktApi traktApi, ISplittableProgress`1 progress, CancellationToken cancellationToken)
at Trakt.ScheduledTasks.SyncLibraryTask.Execute(CancellationToken cancellationToken, IProgress`1 progress)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
Source: Emby.Server.Implementations
TargetSite: Void MoveNext()

Not working for me either, this part is after revoked and added emby/trakt access. 😒

Link to comment
Share on other sites

MBSki
9 minutes ago, Eigeplackter said:

Not working for me either, this part is after revoked and added emby/trakt access. 😒

Did you get a new pin too?

Link to comment
Share on other sites

Nemesis63

I had a similar problem. I fixed it by adding a pin to all my Emby users (even the admin one which I don't use to watch anything). 

Hope it helps.

Link to comment
Share on other sites

Eigeplackter

Ok so now I have added pins to all users, deinstalled plugin and revoked acces on trakt website.

Reboot server, install plugin, reboot server.

Still no positive reply:

 

Quote
2023-01-02 16:34:41.450 Error Trakt: Tried to reauthenticate with Trakt, but neither PIN nor refreshToken was available
2023-01-02 16:34:41.459 Info HttpClient: POST https://api.trakt.tv/oauth/token
2023-01-02 16:34:42.236 Error TaskManager: Error
*** Error Report ***
Version: 4.8.0.21
Command line: /volume4/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
Operating system: Linux version 4.4.180+ (root@build13) (gcc version 8.5.0 (GCC) ) #42962 SMP Tue Sep 20 22:35:56 CST 2022
Framework: .NET 6.0.8
OS/Process: x64/x64
Runtime: volume4/@appstore/EmbyServer/system/System.Private.CoreLib.dll
Processor count: 4
Data path: /var/packages/EmbyServer/var
Application path: /volume4/@appstore/EmbyServer/system
MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: BadRequest
 

@Luke

Log attached

 

embyserver (1).txt

Link to comment
Share on other sites

  • 2 weeks later...
Bazzu85
On 02/01/2023 at 10:12, Nemesis63 said:

I had a similar problem. I fixed it by adding a pin to all my Emby users (even the admin one which I don't use to watch anything). 

Hope it helps.

The problem seems to be resolved on my side refreshing the pin for all my users..

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
Eigeplackter

Just throwing out some ideas, as I was still battling with the trakt plugin.

Mine wasn't working since the trakt API was shutdown and didnt resume working, when it finally was put back online.

 

What made me wonder was the relative small number of people being affected, I mean there were some threads in forum where

people participated, but it was small amount, considering trakt share for playback logging.

 

So after trying several proposed solutions in the last month, like reinstall plugin, revoke access in trakt, get new pin, and change

user passwords for all my emby users I still couldn't get it to work, sync always failed in 1 second and reported:

Quote
2023-01-19 21:41:11.442 Error TaskManager: Error
*** Error Report ***
Version: 4.8.0.21
Command line: /volume4/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
Operating system: Linux version 4.4.180+ (root@build13) (gcc version 8.5.0 (GCC) ) #42962 SMP Tue Sep 20 22:35:56 CST 2022
Framework: .NET 6.0.8
OS/Process: x64/x64
Runtime: volume4/@appstore/EmbyServer/system/System.Private.CoreLib.dll
Processor count: 4
Data path: /var/packages/EmbyServer/var
Application path: /volume4/@appstore/EmbyServer/system
MediaBrowser.Model.Net.HttpException: MediaBrowser.Model.Net.HttpException: BadRequest
at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
at Trakt.Api.TraktApi.PostToTrakt(String url, Object data, CancellationToken cancellationToken, TraktUser traktUser)
at Trakt.Api.TraktApi.RefreshUserAuth(TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.Api.TraktApi.SetRequestHeaders(HttpRequestOptions options, TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.Api.TraktApi.GetFromTrakt(String url, TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.Api.TraktApi.SendGetAllWatchedMoviesRequest(TraktUser traktUser, CancellationToken cancellationToken)
at Trakt.ScheduledTasks.SyncLibraryTask.SyncMovies(User user, TraktUser traktUser, TraktApi traktApi, ISplittableProgress`1 progress, CancellationToken cancellationToken)
at Trakt.ScheduledTasks.SyncLibraryTask.SyncUserLibrary(User user, TraktUser traktUser, TraktApi traktApi, ISplittableProgress`1 progress, CancellationToken cancellationToken)
at Trakt.ScheduledTasks.SyncLibraryTask.Execute(CancellationToken cancellationToken, IProgress`1 progress)
at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
Source: Emby.Server.Implementations
TargetSite: Void MoveNext()

 

So today I started another try to get it working,, as my OCD was driving me kinda mad, an it was sort of a coincidence.

I discovered a device I haven't used for nearly 2 months and I was, in the browser (not app) still logged into my emby server with the default

user "emby".

Strange, as I changed that user password as I was trying to get the Trakt plugin working. So I logged out and used my regular "emby user"

to sign in again.

 

Than I did something that might seem "dumb", not sure that's why I share my experience, I deleted the default user emby from the server.

Revoked access on trakt, and got a new access + pin via plugin (no restart or reinstall) and oh wonder trakt starting syncing again. 🤪

 

Supposition, as I mentioned just throwing out ideas:

 

Default user "emby" wasn't logged out from the other device even though access should have been revoked by change of password.

Emby server keeps a "persistent log" of authenticated users, and grants access after authorisation, ignores password changes !

Seems like a bug to me !

 

I just tried it with my regular user, change pw via control panel - users, close the only open emby tab (webapp) and opened a new tab.

Returned to emby by favorites (link: mysynology:8096 no user or pw in url) and could continue watching as if nothing had changed.

I have secured lan access by password:

 

image.thumb.png.d107b7c29fc34b3bfb79a4e80a3b2976.png

 

Imho that shouldn't be possible at all.

 

Propositions:

 

  • However I'd like @Luke or maybe @softworkz readover my thoughts and maybe verify my assumptions

 

  • Feature implementation into control panel of emby server, that tells the emby server to require new login at next connection attempt, something like a  "Logout all connected users" button.

 

  • Review handling of logged in users in case of password change by admin (clarification, the user changing the password was my regular emby user, who has allowance to manage server, not the "default user "emby")

 

And I think, with my little knowledge of programming, that this "bug" might be the elemental cause for the sync problems I encountered.

 

Thanks for your time and a reply.

 

 

  • Like 1
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
×
×
  • Create New...