Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lbeltrame opened this issue Mar 9, 2019 · 10 comments
Closed

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

lbeltrame opened this issue Mar 9, 2019 · 10 comments
Labels
bug Something isn't working

Comments

@lbeltrame
Copy link
Contributor

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
@lbeltrame lbeltrame added the bug Something isn't working label Mar 9, 2019
@anthonylavado
Copy link
Member

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

@JustAMan JustAMan added this to To Do in Release 10.3.0 via automation Mar 12, 2019
@lbeltrame
Copy link
Contributor Author

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

@lbeltrame
Copy link
Contributor Author

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
Copy link
Contributor Author

lbeltrame commented Mar 17, 2019

Hm, it looks like a case of aspnet/KestrelHttpServer#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.

@JustAMan
Copy link
Contributor

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

@lbeltrame
Copy link
Contributor Author

lbeltrame commented 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

JustAMan added a commit that referenced this issue Mar 19, 2019
Inspired by #1085 (comment)

It seems that the issue with "setup wizard" described there is only prominent when reverse-proxied, not when accessed directly. So this type of information should be gathered in the bug report as well.
@JustAMan
Copy link
Contributor

@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)?

@lbeltrame
Copy link
Contributor Author

lbeltrame commented 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.

@JustAMan
Copy link
Contributor

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

@joshuaboniface joshuaboniface moved this from To Do to Done in Release 10.3.0 Apr 16, 2019
@joshuaboniface
Copy link
Member

Should be fixed in 10.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

4 participants