i8beef / HomeAutio.Mqtt.GoogleHome

MIT License
215 stars 29 forks source link

Application Fails to start #46

Closed diabl0w closed 5 years ago

diabl0w commented 5 years ago

Here is the main part of the log:

Application startup exception: System.ArgumentException: The path in 'value' must start with '/'. Parameter name: value at Microsoft.AspNetCore.Http.PathString..ctor(String value) .... .... at HomeAutio.Mqtt.GoogleHome.Program.Main(String[] args) in /app/HomeAutio .Mqtt.GoogleHome/Program.cs:line 45

i8beef commented 5 years ago

ASPNETCORE_PATHBASE doesn't start with "/" maybe?

diabl0w commented 5 years ago

that variable is correctly set, I tried removing the / to see what would happen and error didn't change... here's the full output:

andled Exception: System.ArgumentException: The path in 'value' must start with '/'. Parameter name: value at Microsoft.AspNetCore.Http.PathString..ctor(String value) at Microsoft.AspNetCore.Http.PathString.op_Implicit(String s) at HomeAutio.Mqtt.GoogleHome.Startup.Configure(IApplicationBuilder app, IH ostingEnvironment env) in /app/HomeAutio.Mqtt.GoogleHome/Startup.cs:line 236 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicat ionBuilder app) at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter. <>cDisplayClass0_0.gMiddlewareFilterBuilder|0(IApplicationBuil der builder) at Microsoft.AspNetCore.HostFilteringStartupFilter.<>cDisplayClass0_0.<C onfigure>b0(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter. <>c__DisplayClass0_0.b__0(IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationTo ken cancellationToken) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token) at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host) at HomeAutio.Mqtt.GoogleHome.Program.Main(String[] args) in /app/HomeAutio .Mqtt.GoogleHome/Program.cs:line 45

diabl0w commented 5 years ago

I did just do a bunch of upgrades to my home automation system and new router firmware so unfortunately I'm not sure how to track this down. I also updated HomeAutio docker to the latest image so I was hoping it was just a bug in the newer image

diabl0w commented 5 years ago

I apologize, this is actually the full output:

18:27:34 INF] Loaded with configuration from: appsettings.json, /app/config/ appsettings.Production.json [18:27:35 WRN] Using an in-memory repository. Keys will not be persisted to s torage. [18:27:35 WRN] Neither user profile nor HKLM registry available. Using an eph emeral key repository. Protected data will be unavailable when application ex its. [18:27:35 INF] Creating key {XXXXX} with creat ion date 2019-01-22 23:27:35Z, activation date 2019-01-22 23:27:35Z, and expi ration date 2019-04-22 23:27:35Z. [18:27:35 WRN] No XML encryptor configured. Key {XXXXX} may be persisted to storage in unencrypted form. Application startup exception: System.ArgumentException: The path in 'value' must start with '/'. Parameter name: value at Microsoft.AspNetCore.Http.PathString..ctor(String value) at Microsoft.AspNetCore.Http.PathString.op_Implicit(String s) at HomeAutio.Mqtt.GoogleHome.Startup.Configure(IApplicationBuilder app, IH ostingEnvironment env) in /app/HomeAutio.Mqtt.GoogleHome/Startup.cs:line 236 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicat ionBuilder app) at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter. <>cDisplayClass0_0.gMiddlewareFilterBuilder|0(IApplicationBuil der builder) at Microsoft.AspNetCore.HostFilteringStartupFilter.<>cDisplayClass0_0.<C onfigure>b0(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter. <>cDisplayClass0_0.b__0(IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() [18:27:36 FTL] Application startup exception System.ArgumentException: The path in 'value' must start with '/'. Parameter name: value at Microsoft.AspNetCore.Http.PathString..ctor(String value) at Microsoft.AspNetCore.Http.PathString.op_Implicit(String s) at HomeAutio.Mqtt.GoogleHome.Startup.Configure(IApplicationBuilder app, IH ostingEnvironment env) in /app/HomeAutio.Mqtt.GoogleHome/Startup.cs:line 236 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicat ionBuilder app) at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter. <>cDisplayClass0_0.gMiddlewareFilterBuilder|0(IApplicationBuil der builder) at Microsoft.AspNetCore.HostFilteringStartupFilter.<>cDisplayClass0_0.<C onfigure>b0(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter. <>cDisplayClass0_0.b0(IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() [18:27:36 FTL] The path in 'value' must start with '/'. Parameter name: value System.ArgumentException: The path in 'value' must start with '/'. Parameter name: value at Microsoft.AspNetCore.Http.PathString..ctor(String value) at Microsoft.AspNetCore.Http.PathString.op_Implicit(String s) at HomeAutio.Mqtt.GoogleHome.Startup.Configure(IApplicationBuilder app, IH ostingEnvironment env) in /app/HomeAutio.Mqtt.GoogleHome/Startup.cs:line 236 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicat ionBuilder app) at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter. <>c__DisplayClass0_0.gMiddlewareFilterBuilder|0(IApplicationBuil der builder) at Microsoft.AspNetCore.HostFilteringStartupFilter.<>cDisplayClass0_0.<C onfigure>b0(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter. <>cDisplayClass0_0.b0(IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationTo ken cancellationToken) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token) at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host) at HomeAutio.Mqtt.GoogleHome.Program.Main(String[] args) in /app/HomeAutio .Mqtt.GoogleHome/Program.cs:line 45

Unhandled Exception: System.ArgumentException: The path in 'value' must start with '/'. Parameter name: value at Microsoft.AspNetCore.Http.PathString..ctor(String value) at Microsoft.AspNetCore.Http.PathString.op_Implicit(String s) at HomeAutio.Mqtt.GoogleHome.Startup.Configure(IApplicationBuilder app, IH ostingEnvironment env) in /app/HomeAutio.Mqtt.GoogleHome/Startup.cs:line 236 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicat ionBuilder app) at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter. <>cDisplayClass0_0.gMiddlewareFilterBuilder|0(IApplicationBuil der builder) at Microsoft.AspNetCore.HostFilteringStartupFilter.<>cDisplayClass0_0.<C onfigure>b0(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter. <>c__DisplayClass0_0.b__0(IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationTo ken cancellationToken) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage) at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token) at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host) at HomeAutio.Mqtt.GoogleHome.Program.Main(String[] args) in /app/HomeAutio .Mqtt.GoogleHome/Program.cs:line 45

i8beef commented 5 years ago

Well mine's working, so that implies its a config issue.

Your exception there, Startup line 236 is indeed where it grabs the environment variable ASPNETCORE_PATHBASE. Are you SURE you are setting that correctly with the Docker command? Should look something like this when you run the docker command:

docker run --restart=always --name $IMAGENAME --user=1000 -dit -p 5000:5000 -v /configpath:/app/config -v /logspath:/app/logs -e ASPNETCORE_PATHBASE="/google/home" -e TZ=America/New_York $REPOSITORY

You could delete the image first and recreate the container just to make sure a previous bad command isn't being saved.

docker stop $IMAGENAME
docker rm $IMAGENAME

Then execute that docker run again.

diabl0w commented 5 years ago

It's working now, I changed two things. 1st, I had the docker startup command sitting in a txt file so I wouldn't forget it and was running it as $(cat dockerstart.txt) so instead I just ran the command directly, but I also removed the quotes around "/google/home" in the ASPNET variable, so it starts with a "/" instead of a quotation mark.

I'm not sure what fixed it but it's working now, running on raspberry pi. Sorry to bother you man, but I didn't know what that error log meant and you telling me that it was definitely something wrong with the ASPNET variable helped so I didn't spend hours looking elsewhere.

Thank you

On Tue, Jan 22, 2019, 6:32 PM Michael Hallock <notifications@github.com wrote:

Well mine's working, so that implies its a config issue.

Your exception there, Startup line 236 is indeed where it grabs the environment variable ASPNETCORE_PATHBASE. Are you SURE you are setting that correctly with the Docker command? Should look something like this when you run the docker command:

docker run --restart=always --name $IMAGENAME --user=1000 -dit -p 5000:5000 -v /configpath:/app/config -v /logspath:/app/logs -e ASPNETCORE_PATHBASE="/google/home" -e TZ=America/New_York $REPOSITORY

You could delete the image first and recreate the container just to make sure a previous bad command isn't being saved.

docker stop $IMAGENAME docker rm $IMAGENAME

Then execute that docker run again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/i8beef/HomeAutio.Mqtt.GoogleHome/issues/46#issuecomment-456606729, or mute the thread https://github.com/notifications/unsubscribe-auth/APYcMoIYqEATHV5sUUsyjJvlGPYsQiA3ks5vF5-UgaJpZM4aL9JF .

i8beef commented 5 years ago

No problem man, any time. The quotes SHOULD be valid (thats how I run mine), so I'm not sure whats up, but glad its working for you again.