Jump to content


Photo

[SOLVED] Trakt plugin won't let me sync my library (unauthorized)

Trakt

  • Please log in to reply
44 replies to this topic

#1 Pankookis OFFLINE  

Pankookis

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:02 PM
  • LocationSweden

Posted 12 February 2018 - 09:04 AM

When running the scheduled task "Sync library to Trakt.tv" it fails. If I look at my notifications it says it failed because it was unauthorized. I can "Import playstates from Trakt.tv" and it scrobbles what I'm watching.

 

Have had this issue for about a week now.

 

Emby Server Version 3.2.70.0

 

Trakt plugin 3.1.4.0

 

Attached Files


Edited by Pankookis, 15 February 2018 - 05:57 PM.


#2 kesm OFFLINE  

kesm

    Advanced Member

  • Members
  • 81 posts
  • Local time: 08:02 PM

Posted 12 February 2018 - 09:12 AM

You need to add an Authentification PIN in trakt plugin configuration



#3 Pankookis OFFLINE  

Pankookis

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:02 PM
  • LocationSweden

Posted 12 February 2018 - 11:53 AM

You need to add an Authentification PIN in trakt plugin configuration

Done this many times.

 

Have uninstalled, restarted, then installed the plugin again and entered a PIN but it's the same.

It's just the Sync library part that doesn't work.



#4 Trevor68 OFFLINE  

Trevor68

    Advanced Member

  • Members
  • 258 posts
  • Local time: 07:02 PM

Posted 13 February 2018 - 01:54 AM

OP is correct, was working, now isn't, doing PIN again does not help.


  • Pankookis likes this

#5 Trevor68 OFFLINE  

Trevor68

    Advanced Member

  • Members
  • 258 posts
  • Local time: 07:02 PM

Posted 13 February 2018 - 03:49 AM

tried updating pin again, still no joy so heres my log.

Attached Files


Edited by Trevor68, 13 February 2018 - 03:52 AM.


#6 J2ghz OFFLINE  

J2ghz

    Advanced Member

  • Members
  • 75 posts
  • Local time: 08:02 PM

Posted 13 February 2018 - 04:47 PM

@Pankookis and @Trevor68 can you try to capture the error in the log again, while having debug logging on? See screenshots:
https://i.imgur.com/cY5xdNx.png
https://i.imgur.com/2Bne9tW.png



#7 Trevor68 OFFLINE  

Trevor68

    Advanced Member

  • Members
  • 258 posts
  • Local time: 07:02 PM

Posted 13 February 2018 - 04:59 PM

Ah dammit, I missed the first screenshot, will take the log again tonight.



#8 Pankookis OFFLINE  

Pankookis

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:02 PM
  • LocationSweden

Posted 13 February 2018 - 05:11 PM

@J2ghz

 

Debug logging checked and I hope this is correct. The log didn't seem to include so much more than before but I'm just a layman :)

 

 

Attached Files



#9 Trevor68 OFFLINE  

Trevor68

    Advanced Member

  • Members
  • 258 posts
  • Local time: 07:02 PM

Posted 13 February 2018 - 05:19 PM

Interestingly my Media Center Master is now failing auth for no particular reason, makes one wonder if trakt are stuffing about with their API again maybe.



#10 J2ghz OFFLINE  

J2ghz

    Advanced Member

  • Members
  • 75 posts
  • Local time: 08:02 PM

Posted 14 February 2018 - 03:03 PM

@Trevor68 I had a look at the changelog, there seem to be no announced breaking changes and no outages. I also tried to re-authenticate mine just now and it worked. You can also try the steps below.

@Pankookis 401 Unauthorized at /auth/token according to docs means that the code (in this case PIN) provided was invalid, expired, revoked or already used. Try following these steps with logging on like before:

  1. Go to Trakt plugin configuration page, switch to your user
  2. Click Get PIN, put it in the field, click Save
  3. Go to scheduled tasks, run one of the tasks from Trakt, wait for it to finish, if it says failed send the log.
  4. Start watching something, after a few tens of seconds go to Trakt.tv to check if it says you are watching what you are watching. If it does not, send the log.

Edited by J2ghz, 14 February 2018 - 03:04 PM.


#11 Pankookis OFFLINE  

Pankookis

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:02 PM
  • LocationSweden

Posted 14 February 2018 - 03:14 PM

@J2ghz

 

Followed your steps until 3. I can "Import playstates....." but "Sync library....." still fails for me and it says unauthorized

 

 

Attached Files



#12 Trevor68 OFFLINE  

Trevor68

    Advanced Member

  • Members
  • 258 posts
  • Local time: 07:02 PM

Posted 14 February 2018 - 03:35 PM

and here is my log with both debugs enabled.

Attached Files


Edited by Trevor68, 14 February 2018 - 03:36 PM.


#13 Pankookis OFFLINE  

Pankookis

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:02 PM
  • LocationSweden

Posted 15 February 2018 - 06:03 PM

Solved.

 

Go to .../YOUR USER/Appdata/Roaming/Emby-Server/plugins/configurations/      and delete trakt.xml and then re-authenticate. Find appropriate folder for other OS. 

 

This clear the plugin from all data. Uninstalling the plugin seem to store this file and since the PIN disappear from the plugin setting page there was no way of knowing that it used old data. Why re-authenticating didn't work, I have no idea, but as someone mentioned in another Trakt thread it might for some reason hold the PIN for only 2 months. 


Edited by Pankookis, 15 February 2018 - 06:06 PM.

  • njoak likes this

#14 Trevor68 OFFLINE  

Trevor68

    Advanced Member

  • Members
  • 258 posts
  • Local time: 07:02 PM

Posted 15 February 2018 - 06:29 PM

That would totally explain why the PIN wasn't clearing from the field, will give it a go tonight. The 2 months thing seems valid, as my MCM also stopped validating at the same time.



#15 Trevor68 OFFLINE  

Trevor68

    Advanced Member

  • Members
  • 258 posts
  • Local time: 07:02 PM

Posted 16 February 2018 - 04:52 AM

Mine got a bit more involved but eventually by revoking emby from trakt, deleting the plugin and the file, and starting from scratch, it's all fixed. :-)


  • Pankookis likes this

#16 Pankookis OFFLINE  

Pankookis

    Advanced Member

  • Members
  • 32 posts
  • Local time: 08:02 PM
  • LocationSweden

Posted 16 February 2018 - 05:45 AM

Mine got a bit more involved but eventually by revoking emby from trakt, deleting the plugin and the file, and starting from scratch, it's all fixed. :-)

 

Yeah, I had already revoked Emby during my hair pulling phase some time before so maybe that was critical too. :)



#17 jmedemar OFFLINE  

jmedemar

    Member

  • Members
  • 11 posts
  • Local time: 01:02 PM

Posted 22 February 2018 - 10:12 AM

I was fighting with this same issue. Thanks to the help above, I checked my .xml file and found the expiration date of my token was 2-6-18. Even though I had gotten a new token and it saved to the .xml properly, the expiration time field was not updated properly in the .xml

 

If any of the plugin developers are listening in, please check this out in your implementation, as the .xml file is not updating properly when a new token is saved. Thanks everyone for the help!



#18 njoak OFFLINE  

njoak

    Advanced Member

  • Members
  • 79 posts
  • Local time: 08:02 PM

Posted 28 February 2018 - 05:45 PM

Solved.
 
Go to .../YOUR USER/Appdata/Roaming/Emby-Server/plugins/configurations/      and delete trakt.xml and then re-authenticate. Find appropriate folder for other OS. 
 
This clear the plugin from all data. Uninstalling the plugin seem to store this file and since the PIN disappear from the plugin setting page there was no way of knowing that it used old data. Why re-authenticating didn't work, I have no idea, but as someone mentioned in another Trakt thread it might for some reason hold the PIN for only 2 months.


Awesome, this got my Trakt plugin finally working again. Thanks a bunch!

#19 Animosity022 OFFLINE  

Animosity022

    Advanced Member

  • Members
  • 117 posts
  • Local time: 02:02 PM

Posted 01 March 2018 - 11:09 PM

I've read through this a few times. I've tried deleting the plugin and the trakt.xml file a few times and I can't seem to get authenticated.

 

I've got a fresh install on Fedora 27 that I've been trying to get setup.

 

Server logs are attached but they didn't tell me much.

 

 

Attached Files


Edited by Animosity022, 01 March 2018 - 11:09 PM.


#20 digger11 OFFLINE  

digger11

    Advanced Member

  • Members
  • 35 posts
  • Local time: 11:02 AM

Posted 02 March 2018 - 12:52 AM

I've been fighting the trakt plugin on my new server install for hours.  A couple of days ago I added a user and linked it to Trakt without any issues.

Today I added a couple of additional users and went through the same process, but their accounts won't sync.  I've tried everything I could think of, including deleting the trakt config xml file, and revoking Emby's connection on my account on the trakt website, and nothing has worked.

 

To see whether it was something peculair to the new server, I even went onto a different server where things were working fine and tried to get a new authentication pin for my account.  The behavior is the same now on that server.

 

The symptom I see is that if I

go into the settings for the  trakt plugin,

select a user

click on "get pin"

log onto trackt

allow Emby to use my account

copy the pin

paste it into the trakt plugin

hit save

go to scheduled tasks

run the import play states from trakt

 

The import fails.

If  I then go back into the trakt plugin settings and look at the user, the pin code I pasted in is still present.

 

 

The errors I see in the log look like the following.

2018-03-01 21:28:12.563 Info HttpClient: POST: https://api.trakt.tv/oauth/token
2018-03-01 21:28:12.689 Error Trakt: Exception handled
	*** Error Report ***
	Version: 3.2.70.0
	Command line: C:\Users\home\AppData\Roaming\MediaBrowser-Server\system\EmbyServer.dll -service
	Operating system: Microsoft Windows NT 6.1.7601 Service Pack 1
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 4
	Program data path: C:\Users\home\AppData\Roaming\MediaBrowser-Server
	Application directory: C:\Users\home\AppData\Roaming\MediaBrowser-Server\system
	MediaBrowser.Model.Net.HttpException: Unauthorized
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsyncInternal>d__20.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsync>d__17.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<PostToTrakt>d__30.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<RefreshUserAuth>d__26.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SetRequestHeaders>d__31.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<GetFromTrakt>d__28.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SendGetAllWatchedMoviesRequest>d__18.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.ScheduledTasks.SyncFromTraktTask.<SyncTraktDataForUser>d__7.MoveNext()
	MediaBrowser.Model.Net.HttpException
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsyncInternal>d__20.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsync>d__17.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<PostToTrakt>d__30.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<RefreshUserAuth>d__26.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SetRequestHeaders>d__31.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<GetFromTrakt>d__28.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SendGetAllWatchedMoviesRequest>d__18.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.ScheduledTasks.SyncFromTraktTask.<SyncTraktDataForUser>d__7.MoveNext()
	
2018-03-01 21:28:12.695 Error Trakt: Error syncing trakt data for user j&j
	*** Error Report ***
	Version: 3.2.70.0
	Command line: C:\Users\home\AppData\Roaming\MediaBrowser-Server\system\EmbyServer.dll -service
	Operating system: Microsoft Windows NT 6.1.7601 Service Pack 1
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 4
	Program data path: C:\Users\home\AppData\Roaming\MediaBrowser-Server
	Application directory: C:\Users\home\AppData\Roaming\MediaBrowser-Server\system
	MediaBrowser.Model.Net.HttpException: Unauthorized
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsyncInternal>d__20.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsync>d__17.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<PostToTrakt>d__30.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<RefreshUserAuth>d__26.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SetRequestHeaders>d__31.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<GetFromTrakt>d__28.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SendGetAllWatchedMoviesRequest>d__18.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.ScheduledTasks.SyncFromTraktTask.<SyncTraktDataForUser>d__7.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.ScheduledTasks.SyncFromTraktTask.<Execute>d__6.MoveNext()
	MediaBrowser.Model.Net.HttpException
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsyncInternal>d__20.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsync>d__17.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<PostToTrakt>d__30.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<RefreshUserAuth>d__26.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SetRequestHeaders>d__31.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<GetFromTrakt>d__28.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.Api.TraktApi.<SendGetAllWatchedMoviesRequest>d__18.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.ScheduledTasks.SyncFromTraktTask.<SyncTraktDataForUser>d__7.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Trakt.ScheduledTasks.SyncFromTraktTask.<Execute>d__6.MoveNext()
	
2018-03-01 21:28:12.695 Info TaskManager: Import playstates from Trakt.tv Completed after 0 minute(s) and 2 seconds

Attached File  server-63655536310.txt   63.12KB   1 downloadsI

 

 


Edited by digger11, 02 March 2018 - 12:54 AM.






Also tagged with one or more of these keywords: Trakt

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users