qJake / HADotNet.CommandCenter

📱 A web-based, wall-mountable command center for Home Assistant.
https://hacc.dev
Apache License 2.0
158 stars 11 forks source link

"Too many redirects" #74

Closed grantalewis closed 4 years ago

grantalewis commented 4 years ago

Description

Initial install. I can see the Docker container running, but trying to access from any browser (Firefox, Chrome, Safari) encounters redirect problems.

Environment

Latest

I run DuckDNS and so use an IP address rather than my domain name. Using localhost isn't an option.

Macmini reimaged with Ubuntu64 running Docker

Steps to Reproduce

(see above)

Screenshots

Screenshots not available, but I see this in the CLI:


info: HADotNet.CommandCenter.Middleware.HAClientInitialization[0]
      Client factory is not initialized, redirecting user to settings area...
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.NullReferenceException: Object reference not set to an instance of an object.
   at HADotNet.CommandCenter.Middleware.HAClientInitialization.InvokeAsync(HttpContext context) in /src/HADotNet.CommandCenter/Middleware/HAClientInitialization.cs:line 111
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
github-actions[bot] commented 4 years ago

Hey there, looks like this is your first time submitting a bug or enhancement to HACC! Thanks for helping make HACC a better app! 🎉

sr-as2 commented 4 years ago

Hi, same too many redirect error, but for me, the log show multiple errors:

info: HADotNet.CommandCenter.Middleware.HAClientInitialization[0] Attempting auto-initializaion of HACC via Supervisor interface... fail: HADotNet.CommandCenter.Middleware.HAClientInitialization[0] Unable to generate LLAT via Home Assistant WebSocket API. ERROR: {"id": 1, "type": "result", "success": false, "error": {"code": "unknown_error", "message": "Unknown error"}}

edit: HACC version 1.0.10

qJake commented 4 years ago

I am currently in the process of re-working the auth code for compatibility with the (new-ish) Supervisor. Please bear with me as I work through this.

qJake commented 4 years ago

Hi @grantalewis and @sr-as2, can you please try the latest prerelase (v1.0.12) to see if this is resolved? Thanks.

grantalewis commented 4 years ago

I’m not going to be much help, I’m afraid. Was contemplating using an old iPad but found out that it’s under-powered. And as I am currently unemployed, I’ll have to save my pennies before I can afford an android tablet. Good luck!

flyingspin commented 4 years ago

I just downloaded the latest docker image, and sadly I'm still having the same issues. Let me know if you'd like a copy of the exact error I'm currently receiving

qJake commented 4 years ago

Yeah @flyingspin if you could paste your full log text that would be most helpful.

flyingspin commented 4 years ago

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the request. System.NullReferenceException: Object reference not set to an instance of an object. at HADotNet.CommandCenter.Middleware.HAClientInitialization.InvokeAsync(HttpContext context) in /src/HADotNet.CommandCenter/Middleware/HAClientInitialization.cs:line 103 at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.gAwaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[3] An exception was thrown attempting to execute the error handler. System.NullReferenceException: Object reference not set to an instance of an object. at HADotNet.CommandCenter.Middleware.HAClientInitialization.InvokeAsync(HttpContext context) in /src/HADotNet.CommandCenter/Middleware/HAClientInitialization.cs:line 103 at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi) fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HLUJG77PTGSA", Request id "0HLUJG77PTGSA:00000001": An unhandled exception was thrown by the application. System.NullReferenceException: Object reference not set to an instance of an object. at HADotNet.CommandCenter.Middleware.HAClientInitialization.InvokeAsync(HttpContext context) in /src/HADotNet.CommandCenter/Middleware/HAClientInitialization.cs:line 103 at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.gAwaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

flyingspin commented 4 years ago

@qJake let me know if there is anything else I can provide

sr-as2 commented 4 years ago

Yep it's working :-) But i can't add tile (error 404) but i think it's under control ;)

flyingspin commented 4 years ago

What browser are you using @sr-as2, I've tried running the docker image on 3 different hosts, and haven't been able to connect on either of them, so wondering if its my browser.

qJake commented 4 years ago

It may also be the difference between a new set up versus a set up with a pre-existing access token. I will have to investigate further.

sr-as2 commented 4 years ago

ied running the docker image on 3 different hosts, and haven't been able to connect on either of them

Last chrome version

qJake commented 4 years ago

@sr-as2 Can you update your container to latest (v1.0.26 or higher) and let me know if this is fixed? Thanks!

flyingspin commented 4 years ago

Just tried it out and it works now! Thanks man

Sent from my iPhone

On Apr 5, 2020, at 10:20 PM, Jake Burgy notifications@github.com wrote:

 @sr-as2 Can you update your container to latest (v1.0.26 or higher) and let me know if this is fixed? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

qJake commented 4 years ago

Awesome! Glad to hear it.

sr-as2 commented 4 years ago

latest (v1.0.26 or higher) and let

Same 404 error qJake when i add a tile.

Edit: I can only add these tiles: Navigation, Blan and Date tile

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the request. System.Exception: Unexpected response code 502 from Home Assistant API endpoint /api/states. at HADotNet.Core.BaseClient.Get[T](String path) at HADotNet.Core.Clients.EntityClient.GetEntities() at HADotNet.CommandCenter.Controllers.StateTileController.Add() in /src/HADotNet.CommandCenter/Controllers/StateTileController.cs:line 26 at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.gAwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at HADotNet.CommandCenter.Middleware.HAClientInitialization.InvokeAsync(HttpContext context) in /src/HADotNet.CommandCenter/Middleware/HAClientInitialization.cs:line 63 at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)`

qJake commented 4 years ago

@sr-as2 Can you reply with your full environment info (hardware, Docker or Supervisor, versions...), and what is listed on your Settings page (minus your LLAT token - you can mask that out)?

A screenshot of the /admin/technical page might be helpful as well - feel free to mask out any sensitive info you don't want to share.

sr-as2 commented 4 years ago

Ok @qJake , i'll open a new issue