If i try to login in the blazor app the authentications fails with internal error 500. i did not find much about that error:
blazor-server.log: [14:20:46 INF] Request finished HTTP/1.1 GET http://appmicro-blazor/Themes/Lepton/Global/assets/fonts/poppins-v6-latin-600.woff2 - - - 304 - font/woff2 0.5253ms [14:20:46 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' [14:20:46 INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared). [14:20:46 INF] Executing ViewResult, running view ~/Views/Error/404.cshtml. [14:20:46 WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'. [14:20:46 INF] Authorization failed. These requirements were not met: PermissionRequirement: SettingManagement.Emailing [14:20:46 INF] Authorization failed. These requirements were not met: PermissionRequirement: AbpIdentity.SettingManagement [14:20:46 INF] Authorization failed. These requirements were not met: PermissionRequirement: LeptonThemeManagement.Settings [14:20:46 INF] Authorization failed. These requirements were not met: PermissionRequirement: AbpAccount.SettingManagement [14:20:46 INF] Executed ViewResult - view ~/Views/Error/404.cshtml executed in 11.1565ms. [14:20:46 INF] Executed action Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared) in 16.2938ms [14:20:46 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' [14:20:46 INF] Request finished HTTP/1.1 GET http://appmicro-blazor/Error?httpStatusCode=404 - - - 404 - text/html;+charset=utf-8 17.4042ms
I did forgot to rebuild the images. you were right.
And i also needed to modify the blazor-deployment.yaml (added .authserver) because otherwise the clientid etc were missing:
- name: "AuthServer__ClientId"
value: "{{ .Values.config.authServer.clientId }}"
- name: "AuthServer__ClientSecret"
value: "{{ .Values.config.authServer.clientSecret }}"
After that Blazor runs . I will check if i get some more errors in other components
i did remove the https redirection in gateways modules and check auth modulle. everything fine now.
Changing the gatewayUr to l: https://appmicro-gateway-web/ (trailing slash at the end) and the auth server to https solved the mixed content error (Nr.3 above).. I can now authenticate succefull through swagger. Great
What do you think about my yaml files above for blazor. Blazor is still not accessible due error 500. How to solve that ?
and yes, the gateway is running at port 80. To what should i change it ?
Hi,
i did face a lot of issues so far for getting a microservice solution run in kubernetes:
As you could see so far there are a lot things to care about to get it work in kubernetes.
let get through the three point i have three points left:
1. Blazor charts: my current deployment for blazor is already based on the web chart. My file look like this:
for blazor from values.yaml:
blazor: config: selfUrl: https://appmicro-blazor gatewayUrl: https://appmicro-gateway-web authServer: authority: http://appmicro-authserver requireHttpsMetadata: "false" clientId: AppMicro_BlazorServer clientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: appmicro-redis rabbitmqHost: appmicro-rabbitmq elasticsearchUrl: http://appmicro-elasticsearch ingress: host: appmicro-blazor tlsSecret: appmicro-tls image: repository: mycompany/appmicro-app-blazor-server tag: latest pullPolicy: IfNotPresent
I did check that the appmicro-tls is present (just like in eshoponabp)
blazor-deployment.yaml:
apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Release.Name }}-{{ .Chart.Name }} spec: selector: matchLabels: app: {{ .Release.Name }}-{{ .Chart.Name }} template: metadata: labels: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers:
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: {{ .Values.image.pullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports:
- name: http containerPort: 80
- name: https containerPort: 443 env:
- name: App__SelfUrl value: "{{ .Values.config.selfUrl }}"
- name: RemoteServices__Default__BaseUrl value: "{{ .Values.config.gatewayUrl }}"
- name: "AuthServer__Authority" value: "{{ .Values.config.authServer.authority }}"
- name: "AuthServer__RequireHttpsMetadata" value: "{{ .Values.config.authServer.requireHttpsMetadata }}"
- name: "AuthServer__ClientId" value: "{{ .Values.config.clientId }}"
- name: "AuthServer__ClientSecret" value: "{{ .Values.config.clientSecret }}"
- name: "DOTNET_ENVIRONMENT" value: "{{ .Values.config.dotnetEnv }}"
- name: "Redis__Configuration" value: "{{ .Values.config.redisHost }}"
- name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}"
- name: "RabbitMQ__Connections__Default__HostName" value: "{{ .Values.config.rabbitmqHost }}"
- name: "ElasticSearch__Url" value: "{{ .Values.config.elasticsearchUrl }}" {{- if .Values.env }} {{ toYaml .Values.env | indent 8 }} {{- end }}
blazor-ingress.yaml:
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress annotations: kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/proxy-buffer-size: 32k nginx.ingress.kubernetes.io/proxy-buffers-number: "8" cert-manager.io/cluster-issuer: letsencrypt spec: tls:
- hosts:
- {{ .Values.ingress.host }} secretName: {{ .Values.ingress.tlsSecret }} rules:
- host: "{{ .Values.ingress.host }}" http: paths:
- path: / pathType: Prefix backend: service: name: {{ .Release.Name }}-{{ .Chart.Name }} port: number: 80
blazor-ingress.yaml:
apiVersion: v1 kind: Service metadata: labels: name: {{ .Release.Name }}-{{ .Chart.Name }} name: {{ .Release.Name }}-{{ .Chart.Name }} spec: ports:
- name: "80" port: 80
- name: "443" port: 443 selector: app: {{ .Release.Name }}-{{ .Chart.Name }}
I have currently no blazor-configmap.yaml like in the web chart. do i need this also ? How about the files above ? can you check them ?
2. I do receive a error 500 while accessing the blazor page. Here is the log:
[08:54:39 INF] Request finished HTTP/1.1 GET http://appmicro-blazor/ - - - 500 0 - 109.9219ms [10:57:06 INF] Request starting HTTP/1.1 GET http://appmicro-blazor/ - - [10:57:06 WRN] Could not find IdentityClientConfiguration for AbpMvcClient. Either define a configuration for AbpMvcClient or set a default configuration. [10:57:06 INF] Start processing HTTP request GET https://appmicro-gateway-web/api/abp/application-configuration?api-version=1.0 [10:57:06 INF] Sending HTTP request GET https://appmicro-gateway-web/api/abp/application-configuration?api-version=1.0 [10:57:06 ERR] Connection id "0HMJFLMHOPT56", Request id "0HMJFLMHOPT56:00000002": An unhandled exception was thrown by the application. Volo.Abp.Http.Client.AbpRemoteCallException: An error occurred during the ABP remote HTTP request. (Connection refused (appmicro-gateway-web:443)) See the inner exception for details. ---> System.Net.Http.HttpRequestException: Connection refused (appmicro-gateway-web:443) ---> System.Net.Sockets.SocketException (111): Connection refused at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace ---
3. I still receive an error during authentification with swagger about Mixed Content. I did find post to that but couldn't solve it so far:
I did try to modify both gateways like in this post: https://support.abp.io/QA/Questions/3027/Mircoservice-k8s-deploy--AccountLogin-show-IDX20803-error
app.Use(async (ctx, next) => { if (ctx.Request.Headers.ContainsKey("from-ingress")) { ctx.Request.Scheme = "https"; return next(); }
return next();
But so far i couldn't solve that..
So now you should have detailed information to help. Hope we could solve this soon. I really need this, because people are waiting for me to finish this task.
Hi, its Blazor Server not Wasm.
I really need this, because i need to publish that solution internally for further test as soons as possible. So when do you expect to update them ? can you provide me a working sample with blazor server or the etc/k8s folder ?
Hi @gterdem,
the added microservie also uses Blazor. Maybe you would like to check my solution remotly ?
Hi,
i 'am trying to publish a microservice to kubernetes, but was not able to find any informations howto configure the helm charts for Blazor and correct domainnames.
To reproduce:
If i check the charts directory and the provided infos:
As far as i can see, it seems that you need to update these charts as soon as possible.
What i need from you is the complete etc\k8s Folder which would work for my solution (which you should generate like above).. Can you please provide that to me ?
Yes, this fixed it. Can you explain why ? Will it be replaced in the template or through abp-cli for future ?
No, sorry a page refresh wont change something. There error still persits. i did misunderstood you.
Yes this works fine. also cleared all cookies in browser. If i generate a product from blazor app menu the product is created fine.
but in swagger i receive the above error. Same swagger problem also with the other services.