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

Web site throws exception in Startup.cs when run locally #2

Open
robcamer opened this issue Mar 2, 2020 · 1 comment
Open

Web site throws exception in Startup.cs when run locally #2

robcamer opened this issue Mar 2, 2020 · 1 comment

Comments

@robcamer
Copy link

robcamer commented Mar 2, 2020

On this page, "Looking at the code", the steps fail. The web site throws an exception i think because it is trying to load kubernetes configuration. I set the environment variable at the command-line: ASPNETCORE_ENVIRONMENT=Development but it did not help.

STEPS:

  1. Clone the repo
  2. Open the project in Visual Studio Code and navigate to /Source/docker-compose.override.yml file in the Explorer window then right click and select 'Open in Terminal'
  3. In the terminal run the command docker-compose build
  4. In the terminal run the command docker-compose up

EXPECTED:
Web site loads along with API servers

ACTUAL:
Web site throws an exception per below output.

ERROR MESSAGE:
Starting source_middle-api_1 ... done
Starting source_website_1 ... done
Starting source_backend-api_1 ... done
Attaching to source_middle-api_1, source_website_1, source_backend-api_1
website_1 |
website_1 | Unhandled Exception: k8s.Exceptions.KubeConfigException: kubeconfig file not found at /root/.kube/config
website_1 | at k8s.KubernetesClientConfiguration.LoadKubeConfigAsync(FileInfo kubeconfig, Boolean useRelativePaths)
website_1 | at k8s.KubernetesClientConfiguration.LoadKubeConfig(FileInfo kubeconfig, Boolean useRelativePaths)
website_1 | at k8s.KubernetesClientConfiguration.BuildConfigFromConfigFile(FileInfo kubeconfig, String currentContext, String masterUrl, Boolean useRelativePaths)
website_1 | at AKSWebsite.Startup.ConfigureServices(IServiceCollection services) in /src/AKSWebsite/Startup.cs:line 52
website_1 | --- End of stack trace from previous location where exception was thrown ---
website_1 | at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
website_1 | at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
website_1 | at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
website_1 | at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
website_1 | at AKSWebsite.Program.Main(String[] args) in /src/AKSWebsite/Program.cs:line 17

middle-api_1 | : Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
middle-api_1 | User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
backend-api_1 | info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
backend-api_1 | User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
source_website_1 exited with code 139
middle-api_1 | Hosting environment: Development
middle-api_1 | Content root path: /app
middle-api_1 | Now listening on: http://[::]:80
middle-api_1 | Application started. Press Ctrl+C to shut down.
backend-api_1 | Hosting environment: Development
backend-api_1 | Content root path: /app
backend-api_1 | Now listening on: http://[::]:80
backend-api_1 | Application started. Press Ctrl+C to shut down.

@robcamer robcamer changed the title Web site fails to run when run locally Web site throws exception in Startup.cs when run locally Mar 2, 2020
@s-leonard
Copy link
Collaborator

Hi Rob

Apologies for the issues you having there, I'm currently in the process of re-writing this workshop, and the docs are not fully up to date. I will update the docs to inform people of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants