- ABP Framework version: v8.2
- UI Type: Blazor Server
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
I am working through a CI / CD implementation using Azure Deployment slots. I have a tiered application that I am trying to get deployed correctly. This is just a basic, no changes, out of the box 3 tier application generated by ABPSuite that I use as a base dev environment for testing.
First problem is that I can not see the full menu for the admin user in the tiered app on neither dev nor production. However in dev everything works as expected, I can create users, and I am authenticated as admin ( it seems ).
For reference, I created a single tier app, and I see the admin user menu as I would expect:
So I would expect to see this menu in my tiered app. They were created exactly the same time, same 8.2 version number, no code updates, just out of the box ABP. But I do not get the user / admin menu in my fresh and clean 3 tier app.
The real issue here is when I deploy a 3 tier app using Azure Deployment Slots to a staging environment on Azure. I can log in OK, and I get the same no options Admin menu as I got in my local dev environment:
However I can’t see any admin menu, and I get an Unauthorized exception after trying to do anything. Even though I seem to be logged in as the admin user.
After Refresh:
This to me seems like a configuration issue, but I can not seem to see any difference in config between environments.
Any insight would be much appreciated.
Thanks,
Karim Ainsworth
39 Answer(s)
-
0
hi
Please share your website URL and a test user with a password.
I will check it online.
Thanks
liming.ma@volosoft.com
-
0
Hi,
I have sent those details to your email address.
Thanks,
Karim
-
0
hi
I have reproduced the problem. Can you also share the debug logs of your staging authserver and blazor apps?
Thanks
-
0
Hi,
Logs and configuration all sent to your email address.
Thanks
-
0
hi
The URL in
appsettings.json
is stilllocalhost
.https://fbd-staging.azurewebsites.net/appsettings.json
And can you share the Logs.txt files?
public class Program { public async static Task<int> Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()) .CreateLogger();
-
0
Hi,
OK I just emailed you the full logs.txt files for both services.
The appsettings.json config should be overridden by the AppService Environment Variables config, I had sent that config to you in the previous email.
I can send a full Environment Dump from Kudu if you think that will help?
Thanks,
Karim
-
0
Also just emailed the EnvVars dumps from Kudu...
-
0
hi
The error is:
[ERR] An unhandled exception has occurred while executing the request. Volo.Abp.Http.Client.AbpRemoteCallException: An error occurred during the ABP remote HTTP request. (The operation was canceled.) See the inner exception for details. ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request.. ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
This should be related to the network of the running environment, I have no experience with this.
-
0
Hi,
I noticed something just now, I had a mistake in the config. I had shifted this entire app to InteractiveServer, however I left 1 setting at InteractiveAuto by mistake!
I have fixed that issue and redeployed and it seems to have fixed the 404 page flash that was happening. However the initial issues are still there:
-
0
ok, Please re-share the logs.txt of your applicaitons. Thanks
-
0
Ok, just emailed them to you, thanks.
-
0
hi
Do you have the
logs.txt
offbd-api-staging
website? -
0
Hi yeah I just emailed them, thanks.
-
0
hi
An error occurred using the connection to database 'Flo3BlazorDev-staging' on server 'tcp:xxxx.database.windows.net,1433'.[ERR] System.Threading.Tasks.TaskCanceledException: A task was canceled.
Please set the log level to Debug of your API website to see more logs.
https://abp.io/support/questions/7716/Admin-user-menu-not-showing-on-tiered-app-in-dev--production-and-logged-in-with-same-menu-issue-but-not-authenticated-in-production-Azure-deployment-slots#answer-3a146c3c-05eb-d49a-90e7-9e1f5f54b502
Thanks.
-
0
-
0
hi
https://github.com/abpframework/abp/issues/20013#issuecomment-2160025249
https://abp.io/support/questions/7180/Deploying-an-ABP-tiered-project-to-mutliple-docker-containers#answer-3a1297a0-ff1b-ca76-c30d-0b6e0f62253d
Failed to validate the token. IDX10204: Unable to validate issuer. validationParameters.ValidIssuer is null or whitespace AND validationParameters.ValidIssuers is null or empty.
Can you share a access_token?
-
0
-
0
hi
This is an encrypted token. You can add a middle to write the bearer token header to log in your API website,
app.Use(async (httpContext, next) => { var bearerToken = httpContext.Request.Headers["Authorization"].ToString(); var logger = httpContext.RequestServices.GetRequiredService<ILogger<MyProjectNameWebModule>>(); logger.LogInformation($"Bearer Token: {bearerToken}"); await next(httpContext); });
-
0
Hi,
I added the code, but didn't get anything logged. Can you confirm that I have put this in the right place? I am in my APIHost project, in the OnApplicationInitialization method:
added to the end:
Ran the project, went through the normal steps, logged in, looked at the profile, got a 401 Unauthorized. So I am assuming it should have logged the token ?
Thanks,
Karim
-
0
hi
Add this after
app.UseAuthentication()
-
0
Still can't see this in the Staging logs on Azure, but I can see the log entry it in Dev now, but getting a Bearer was not Authenticated message and no token:
However I do seem to be logged in, at least I can do admin things. However the Admin Profile menu isn't there. This is basically the initial question!
So I am assuming even if the logging was working on Staging that the same Bearer was not Authenticated result that I am getting in dev.
-
0
hi
Can you share the new logs of API website?
Thanks.
-
0
Hi,
I just emailed the log files for all 3 services.
Thanks,
Karim
-
0
Hi,
I have just given you access, thanks.