Jump to content

Login Session won't expire


FredFrin

Recommended Posts

FredFrin

Hi,

 

Emby-server: docker on Linux, Version 3.2.60.0

Client: Chromium Browser

 

This is sort of weird.  I was unable to remove some LiveTV test channel data,

so I did the folowing:

 

  - stopped server

  - removed the .emby-server directory - all runntime data

  - cleared all browser history data incl cookies, shift-reload the emby page

  - re-start server as per https://hub.docker.com/r/emby/embyserver/

 docker run -it --rm -v /usr/local/bin:/target emby/embyserver instl

  - start the emby-server with:

 emby-server

  - as expected I'm asked for a media directory on the host .. entered.

  - parts of the login page seem to blink, but I'm still forwarded to the home page (???)

  - if I sign-out, I'm redirected to the server config page.

  - from the server page I can return to the Home page without login.

 

Unsurprisingly I then start seeing these messages in the log:

 MediaBrowser.Controller.Net.SecurityException: Access token is invalid or expired.

 I do not seem to be able to force a fresh login & session ...

 

Adding log extract:


2018-01-07 01:49:26.907 Info HttpServer: HTTP POST http://192.168.43.8:8096/emby/Sessions/Logout. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.912 Info SessionManager: Logging out access token 14e63e8b7681463c97ffa28a71bb3e17
2018-01-07 01:49:26.913 Info HttpServer: HTTP Response 204 to 192.168.42.18. Time: 5ms. http://192.168.43.8:8096/emby/Sessions/Logout 
2018-01-07 01:49:26.924 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/users/public. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.925 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Branding/Configuration. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.925 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 1ms. http://192.168.43.8:8096/emby/users/public 
2018-01-07 01:49:26.928 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/Branding/Configuration 
2018-01-07 01:49:26.936 Info HttpServer: HTTP POST http://192.168.43.8:8096/emby/Users/authenticatebyname. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.938 Info UserManager: Authentication request for stef has succeeded.
2018-01-07 01:49:26.938 Info SessionManager: Creating new access token for user 46a857f876aa4b2cb6664cf7a23e8d47
2018-01-07 01:49:26.940 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 4ms. http://192.168.43.8:8096/emby/Users/authenticatebyname 
2018-01-07 01:49:26.961 Info HttpServer: HTTP POST http://192.168.43.8:8096/emby/Sessions/Capabilities/Full. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.962 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/DisplayPreferences/usersettings?userId=46a857f876aa4b2cb6664cf7a23e8d47&client=emby. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.963 Info HttpServer: WS ws://192.168.43.8:8096/embywebsocket?api_key=6bb578b4e86343bab9fea70f44d10ff4&deviceId=22bb3ec758cbc33e55cc0ad3397202294371d349. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.965 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/DisplayPreferences/usersettings?userId=46a857f876aa4b2cb6664cf7a23e8d47&client=emby 
2018-01-07 01:49:26.968 Info HttpServer: HTTP Response 204 to 192.168.42.18. Time: 7ms. http://192.168.43.8:8096/emby/Sessions/Capabilities/Full 
2018-01-07 01:49:26.994 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Users/46a857f876aa4b2cb6664cf7a23e8d47. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.996 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Notifications/46a857f876aa4b2cb6664cf7a23e8d47/Summary. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:26.997 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 1ms. http://192.168.43.8:8096/emby/Notifications/46a857f876aa4b2cb6664cf7a23e8d47/Summary 
2018-01-07 01:49:26.997 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/Users/46a857f876aa4b2cb6664cf7a23e8d47 
2018-01-07 01:49:27.008 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Users/46a857f876aa4b2cb6664cf7a23e8d47. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.011 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/Users/46a857f876aa4b2cb6664cf7a23e8d47 
2018-01-07 01:49:27.037 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Sessions. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.038 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/ScheduledTasks. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.039 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Plugins/SecurityInfo. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.039 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 1ms. http://192.168.43.8:8096/emby/ScheduledTasks 
2018-01-07 01:49:27.040 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/Sessions 
2018-01-07 01:49:27.040 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 1ms. http://192.168.43.8:8096/emby/Plugins/SecurityInfo 
2018-01-07 01:49:27.045 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/System/Info. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.048 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/System/Info 
2018-01-07 01:49:27.051 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/System/ActivityLog/Entries?startIndex=0&limit=7&minDate=2018-01-06T00%3A49%3A27.036Z. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.052 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/News/Product?StartIndex=0&Limit=4. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.055 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 4ms. http://192.168.43.8:8096/emby/System/ActivityLog/Entries?startIndex=0&limit=7&minDate=2018-01-06T00%3A49%3A27.036Z 
2018-01-07 01:49:27.055 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/News/Product?StartIndex=0&Limit=4 
2018-01-07 01:49:27.060 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/LiveTv/Recordings?UserId=46a857f876aa4b2cb6664cf7a23e8d47&IsInProgress=true&Fields=CanDelete%2CPrimaryImageAspectRatio&EnableTotalRecordCount=false&EnableImageTypes=Primary%2CThumb%2CBackdrop. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.060 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/web/configurationpages?pageType=PluginConfiguration&EnableInMainMenu=true. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.062 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 2ms. http://192.168.43.8:8096/emby/web/configurationpages?pageType=PluginConfiguration&EnableInMainMenu=true 
2018-01-07 01:49:27.062 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 3ms. http://192.168.43.8:8096/emby/LiveTv/Recordings?UserId=46a857f876aa4b2cb6664cf7a23e8d47&IsInProgress=true&Fields=CanDelete%2CPrimaryImageAspectRatio&EnableTotalRecordCount=false&EnableImageTypes=Primary%2CThumb%2CBackdrop 
2018-01-07 01:49:27.069 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Packages/Updates?PackageType=UserInstalled. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.072 Info InstallationManager: Opening /config/cache/serverpackages.json
2018-01-07 01:49:27.099 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 30ms. http://192.168.43.8:8096/emby/Packages/Updates?PackageType=UserInstalled 
2018-01-07 01:49:27.108 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Packages/Updates?PackageType=System. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.130 Info HttpServer: HTTP Response 200 to 192.168.42.18. Time: 22ms. http://192.168.43.8:8096/emby/Packages/Updates?PackageType=System 
2018-01-07 01:49:27.172 Info HttpServer: HTTP GET http://192.168.43.8:8096/web/css/images/logoblack.png. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36
2018-01-07 01:49:27.173 Info HttpServer: HTTP Response 304 to 192.168.42.18. Time: 1ms. http://192.168.43.8:8096/web/css/images/logoblack.png 
2018-01-07 01:49:30.804 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Users/47e6580c7989434db765cc3ede23f7e3/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json. UserAgent: 
2018-01-07 01:49:30.815 Error HttpServer: Error processing request
*** Error Report ***
Version: 3.2.60.0
Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /config -restartpath /usr/lib/emby-server/restart.sh
Operating system: Unix 4.10.0.42
64-Bit OS: True
64-Bit Process: True
User Interactive: False
Mono: 4.8.1 (Stable 4.8.1.0/22a39d7 Sun Oct  1 17:55:43 UTC 2017)
Processor count: 4
Program data path: /config
Application directory: /usr/lib/emby-server/bin
MediaBrowser.Controller.Net.SecurityException: Access token is invalid or expired.
  at Emby.Server.Implementations.HttpServer.Security.AuthService.ValidateSecurityToken (MediaBrowser.Model.Services.IRequest request, System.String token) [0x00027] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at Emby.Server.Implementations.HttpServer.Security.AuthService.ValidateUser (MediaBrowser.Model.Services.IRequest request, MediaBrowser.Controller.Net.IAuthenticationAttributes authAttribtues) [0x0002e] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at Emby.Server.Implementations.HttpServer.Security.AuthService.Authenticate (MediaBrowser.Model.Services.IRequest request, MediaBrowser.Controller.Net.IAuthenticationAttributes authAttribtues) [0x00000] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at MediaBrowser.Controller.Net.AuthenticatedAttribute.RequestFilter (MediaBrowser.Model.Services.IRequest request, MediaBrowser.Model.Services.IResponse response, System.Object requestDto) [0x00005] in <8c9e2cb1cee44ce5aa58258dd61a92e3>:0 
  at Emby.Server.Implementations.HttpServer.HttpListenerHost.ApplyRequestFilters (MediaBrowser.Model.Services.IRequest req, MediaBrowser.Model.Services.IResponse res, System.Object requestDto) [0x0006c] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at Emby.Server.Implementations.Services.ServiceHandler+<ProcessRequestAsync>d__15.MoveNext () [0x000bc] in <a12a7c6217e143eaa39430af322cb07e>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at Emby.Server.Implementations.HttpServer.HttpListenerHost+<RequestHandler>d__72.MoveNext () [0x006f4] in <a12a7c6217e143eaa39430af322cb07e>:0 
MediaBrowser.Controller.Net.SecurityException
  at Emby.Server.Implementations.HttpServer.Security.AuthService.ValidateSecurityToken (MediaBrowser.Model.Services.IRequest request, System.String token) [0x00027] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at Emby.Server.Implementations.HttpServer.Security.AuthService.ValidateUser (MediaBrowser.Model.Services.IRequest request, MediaBrowser.Controller.Net.IAuthenticationAttributes authAttribtues) [0x0002e] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at Emby.Server.Implementations.HttpServer.Security.AuthService.Authenticate (MediaBrowser.Model.Services.IRequest request, MediaBrowser.Controller.Net.IAuthenticationAttributes authAttribtues) [0x00000] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at MediaBrowser.Controller.Net.AuthenticatedAttribute.RequestFilter (MediaBrowser.Model.Services.IRequest request, MediaBrowser.Model.Services.IResponse response, System.Object requestDto) [0x00005] in <8c9e2cb1cee44ce5aa58258dd61a92e3>:0 
  at Emby.Server.Implementations.HttpServer.HttpListenerHost.ApplyRequestFilters (MediaBrowser.Model.Services.IRequest req, MediaBrowser.Model.Services.IResponse res, System.Object requestDto) [0x0006c] in <a12a7c6217e143eaa39430af322cb07e>:0 
  at Emby.Server.Implementations.Services.ServiceHandler+<ProcessRequestAsync>d__15.MoveNext () [0x000bc] in <a12a7c6217e143eaa39430af322cb07e>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at Emby.Server.Implementations.HttpServer.HttpListenerHost+<RequestHandler>d__72.MoveNext () [0x006f4] in <a12a7c6217e143eaa39430af322cb07e>:0 


2018-01-07 01:49:30.815 Info HttpServer: HTTP Response 401 to 192.168.43.8. Time: 11ms. http://192.168.43.8:8096/emby/Users/47e6580c7989434db765cc3ede23f7e3/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json 
2018-01-07 01:49:30.817 Info HttpServer: HTTP GET http://192.168.43.8:8096/emby/Users/47e6580c7989434db765cc3ede23f7e3/Items?Recursive=true&limit=1&Fields=DateCreated,Etag&SortBy=DatePlayed&SortOrder=Descending&IncludeItemTypes=Movie,Episode&ImageTypeLimit=0&format=json. UserAgent: 
2018-01-07 01:49:30.819 Error HttpServer: Error processing request
*** Error Report ***
Version: 3.2.60.0
Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /config -restartpath /usr/lib/emby-server/restart.sh
Operating system: Unix 4.10.0.42
64-Bit OS: True
64-Bit Process: True
User Interactive: False
Mono: 4.8.1 (Stable 4.8.1.0/22a39d7 Sun Oct  1 17:55:43 UTC 2017)
Processor count: 4
Program data path: /config
Application directory: /usr/lib/emby-server/bin
MediaBrowser.Controller.Net.SecurityException: Access token is invalid or expired.

 

Edited by FredFrin
Link to comment
Share on other sites

The reason i ask is because as long as there only one single user, and as long as that user doesn't have a password, then you are always logged straight in just to remove the extra click.

 

What we need to do is just hide the logout button in this situation so that there's nothing to be confused about. Thanks.

Link to comment
Share on other sites

FredFrin

Ah - I used to have a password before trashing the .emby-server dir & I used to see a login page.

Yes, there is only one user.

And yes, you're right - after setting a password Logout seems to work.

 

With your suggestion, with no password set, there would still be auth failures (as per the log extract). 

I have no idea if other API call would fail - but the log will certainly be confusing...

 

Maybe consider forcing password entry on first login? Or do you want to preserve 'no-password' operation? 

Link to comment
Share on other sites

I wouldn't pay attention to the errors in the log. Your browser has saved credentials from your previous installation, those credentials aren't valid with the new installation and that's why you see that in the log.

 

I want to keep the no password operation because prior to this change we used to get a lot of complaints from new users saying they were prompted to login and didn't know the password. Of course just clicking on the user will log them straight in without a password but they wouldn't even go that far before sounding the alarm and coming here for help on it.

Link to comment
Share on other sites

FredFrin

I'm still seeing 2 requests every minute which fail with  SecurityException: Access token is invalid or expired.

Even with all clients closed - browser closed, .emby-server removed & emby-server restarted. The requests

have a blank UserAgent and seem to contain a user uuid. With this going on it's almost impossible to

track other issues in the log ... is this some sort of api-health monitoring message generated by the server

to itself?

 

Log attached

EmbyServer-periodicMsgs.log

Link to comment
Share on other sites

FredFrin

Ok - I'll answer myself: the requests were coming from an emby plugin in Kodi ... which I have now removed.

Apologies.

Edited by FredFrin
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...