Latest master: first time wizard doesn't proceed #508

Closed
opened 2026-02-06 19:47:29 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @lbeltrame on GitHub (Mar 9, 2019).

Describe the bug
I updated to the latest master (to follow what's going on, I'm prepared to live with the consequences) and I started fresh with a new data dir.
However the setup locked up right after selecting the language in the first time wizard with a few errors in the logs (see below).

To Reproduce

  1. Build latest master state
  2. Start with a clean data directory

Expected behavior
First time wizard proceeds.

Logs

[2019-03-09 15:45:50.395 +01:00] [INF] ExecuteQueuedTasks
[2019-03-09 15:45:53.008 +01:00] [ERR] Access token is invalid or expired.
[2019-03-09 15:45:53.012 +01:00] [ERR] Error processing request
System.ArgumentNullException: Value cannot be null.
Parameter name: user
   at MediaBrowser.Controller.Entities.Folder.GetChildren(User user, Boolean includeLinkedChildren, InternalItemsQuery query) in /home/jellyfin/jellyfin/MediaBrowser.Cont
roller/Entities/Folder.cs:line 1161
   at Emby.Server.Implementations.Library.UserViewManager.GetUserViews(UserViewQuery query) in /home/jellyfin/jellyfin/Emby.Server.Implementations/Library/UserViewManager
.cs:line 44
   at MediaBrowser.Api.UserLibrary.UserViewsService.Get(GetUserViews request) in /home/jellyfin/jellyfin/MediaBrowser.Api/UserLibrary/UserViewsService.cs:line 84
   at Emby.Server.Implementations.Services.ServiceExecGeneral.Execute(Type serviceType, IRequest request, Object instance, Object requestDto, String requestName) in /home
/jellyfin/jellyfin/Emby.Server.Implementations/Services/ServiceExec.cs:line 88
   at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req) in /home/jellyfin/jellyfin/Emby.Server.Imp
lementations/Services/ServiceController.cs:line 177
   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken) in /home/jellyfin/jellyfin/Emby.Server.Implementations/Services/ServiceHandler.cs:line 95
   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken) in /home/jellyfin/jellyfin/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs:line 575
[2019-03-09 15:45:53.038 +01:00] [ERR] Access token is invalid or expired.

Also the logs are full of [WRN] Unable to determine session based on url like this: http://example.com/embywebsocket?apikey=myapikey`

System (please complete the following information):

  • OS: openSUSE Tumbleweed
  • Jellyfin reverse proxied through nginx
  • Jellyfin Version: master
Originally created by @lbeltrame on GitHub (Mar 9, 2019). **Describe the bug** I updated to the latest master (to follow what's going on, I'm prepared to live with the consequences) and I started fresh with a new data dir. However the setup locked up right after selecting the language in the first time wizard with a few errors in the logs (see below). **To Reproduce** 1. Build latest master state 2. Start with a clean data directory **Expected behavior** First time wizard proceeds. **Logs** ``` [2019-03-09 15:45:50.395 +01:00] [INF] ExecuteQueuedTasks [2019-03-09 15:45:53.008 +01:00] [ERR] Access token is invalid or expired. [2019-03-09 15:45:53.012 +01:00] [ERR] Error processing request System.ArgumentNullException: Value cannot be null. Parameter name: user at MediaBrowser.Controller.Entities.Folder.GetChildren(User user, Boolean includeLinkedChildren, InternalItemsQuery query) in /home/jellyfin/jellyfin/MediaBrowser.Cont roller/Entities/Folder.cs:line 1161 at Emby.Server.Implementations.Library.UserViewManager.GetUserViews(UserViewQuery query) in /home/jellyfin/jellyfin/Emby.Server.Implementations/Library/UserViewManager .cs:line 44 at MediaBrowser.Api.UserLibrary.UserViewsService.Get(GetUserViews request) in /home/jellyfin/jellyfin/MediaBrowser.Api/UserLibrary/UserViewsService.cs:line 84 at Emby.Server.Implementations.Services.ServiceExecGeneral.Execute(Type serviceType, IRequest request, Object instance, Object requestDto, String requestName) in /home /jellyfin/jellyfin/Emby.Server.Implementations/Services/ServiceExec.cs:line 88 at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req) in /home/jellyfin/jellyfin/Emby.Server.Imp lementations/Services/ServiceController.cs:line 177 at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, ILogger logger, String operationName, CancellationToken cancellationToken) in /home/jellyfin/jellyfin/Emby.Server.Implementations/Services/ServiceHandler.cs:line 95 at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken) in /home/jellyfin/jellyfin/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs:line 575 [2019-03-09 15:45:53.038 +01:00] [ERR] Access token is invalid or expired. ``` Also the logs are full of `[WRN] Unable to determine session based on url like this: `http://example.com/embywebsocket?apikey=myapikey` **System (please complete the following information):** - OS: openSUSE Tumbleweed - Jellyfin reverse proxied through nginx - Jellyfin Version: master
OVERLORD added the bug label 2026-02-06 19:47:29 +03:00
Author
Owner

@anthonylavado commented on GitHub (Mar 9, 2019):

Yeah. @cvium is working on this in #1079.

@anthonylavado commented on GitHub (Mar 9, 2019): Yeah. @cvium is working on this in #1079.
Author
Owner

@lbeltrame commented on GitHub (Mar 15, 2019):

I asume there's no way to bypass the first time wizard, either documented or not?

@lbeltrame commented on GitHub (Mar 15, 2019): I asume there's no way to bypass the first time wizard, either documented or not?
Author
Owner

@lbeltrame commented on GitHub (Mar 18, 2019):

I was able to proceed further without using the reverse proxy (more errors on Connection Upgrade) when manually applying #1079. However, with a reverse proxy it is impossible to log in now as the server returns 400 (Bad Request). The error is as follows:

mar 17 22:22:38 sasara.home dotnet[9170]: [22:22:38] [INF] Connection id "0HLLB3HMRVHT5" bad request data: "Requests with 'Connection: Upgrade' cannot have content in the request body."
@lbeltrame commented on GitHub (Mar 18, 2019): I was able to proceed further without using the reverse proxy (more errors on Connection Upgrade) when manually applying #1079. However, with a reverse proxy it is impossible to log in now as the server returns 400 (Bad Request). The error is as follows: ``` mar 17 22:22:38 sasara.home dotnet[9170]: [22:22:38] [INF] Connection id "0HLLB3HMRVHT5" bad request data: "Requests with 'Connection: Upgrade' cannot have content in the request body." ```
Author
Owner

@lbeltrame commented on GitHub (Mar 18, 2019):

Hm, it looks like a case of https://github.com/aspnet/KestrelHttpServer/issues/1263-

Adding the header suggested there fixes it. Which means that for reverse proxying Jellyfin with this change (#1079) you need:

        proxy_pass <whatever is needed>
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_redirect off;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;

In your reverse proxy configuration in case of nginx.

These changes + #1079 fix the current issue.

@lbeltrame commented on GitHub (Mar 18, 2019): Hm, it looks like a case of https://github.com/aspnet/KestrelHttpServer/issues/1263- Adding the header suggested there fixes it. Which means that for reverse proxying Jellyfin with this change (#1079) you need: ``` proxy_pass <whatever is needed> proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Protocol $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $http_host; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; ``` In your reverse proxy configuration in case of nginx. These changes + #1079 fix the current issue.
Author
Owner

@JustAMan commented on GitHub (Mar 18, 2019):

@lbeltrame what new Nginx headers did you apply? Related to websocket or X-* stuff?

@JustAMan commented on GitHub (Mar 18, 2019): @lbeltrame what new Nginx headers did you apply? Related to websocket or `X-*` stuff?
Author
Owner

@lbeltrame commented on GitHub (Mar 18, 2019):

I added:

  • proxy_set_header X-Forwarded-Host $http_host;
  • proxy_set_header Connection $http_connection (as opposed to "upgrade")
  • proxy_set_header X-Real-IP $remote_addr
@lbeltrame commented on GitHub (Mar 18, 2019): I added: - `proxy_set_header X-Forwarded-Host $http_host;` - `proxy_set_header Connection $http_connection` (as opposed to `"upgrade"`) - `proxy_set_header X-Real-IP $remote_addr`
Author
Owner

@JustAMan commented on GitHub (Mar 19, 2019):

@lbeltrame can you check that first time wizard proceeds normally without any of configuration changes if you access Jellyfin directly (i.e. not via reverse proxy)?

@JustAMan commented on GitHub (Mar 19, 2019): @lbeltrame can you check that first time wizard proceeds normally without any of configuration changes if you access Jellyfin directly (i.e. not via reverse proxy)?
Author
Owner

@lbeltrame commented on GitHub (Mar 20, 2019):

Ok, it looks like those errors in the log as previously reported were deeply misleading and in fact it was only a matter of reverse proxying things differently. I started with a fresh configuration and with those extra bits the wizard proceeded (it did proceed also without proxying, but that's a no-go for me).

This means that they ought to be added to the docs (will think about a PR if no one beats me to it).

The "null" exception still occurs BTW (however the error about the access token is no longer there), but it doesn't look critical.

FTR, even if #1079 wasn't the solution for the issue, it was very helpful (due to its errors) in actually finding out the cause of the problem.

@lbeltrame commented on GitHub (Mar 20, 2019): Ok, it looks like those errors in the log as previously reported were deeply misleading and in fact it was only a matter of reverse proxying things differently. I started with a fresh configuration and with those extra bits the wizard proceeded (it did proceed also without proxying, but that's a no-go for me). This means that they ought to be added to the docs (will think about a PR if no one beats me to it). The "null" exception still occurs BTW (however the error about the access token is no longer there), but it doesn't look critical. FTR, even if #1079 wasn't the solution for the issue, it was very helpful (due to its errors) in actually finding out the *cause* of the problem.
Author
Owner

@JustAMan commented on GitHub (Mar 20, 2019):

@lbeltrame I've created an issue on jf-docs repository, feel free to solve it via PR if you have time :)

@JustAMan commented on GitHub (Mar 20, 2019): @lbeltrame I've created an issue on jf-docs repository, feel free to solve it via PR if you have time :)
Author
Owner

@joshuaboniface commented on GitHub (Apr 20, 2019):

Should be fixed in 10.3.0 release.

@joshuaboniface commented on GitHub (Apr 20, 2019): Should be fixed in 10.3.0 release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#508