Posts

Sentinel One Strikes Again. No internet connection. Uninstall Sentinel One Agent.

This happened to a co-worker of mine a while back when his test application file was marked as suspicious by Sentinel One antivirus and had his internet on his laptop disabled. Today, it happened to me without any suspicious file. Probably suspicious activity, who knows. On Microsoft Edge, it says "Hmmm... your Internet access is blocked.", "Firewall or antivirus software may have blocked the connection", and "ERR_NETWORK_ACCESS_DENIED". So, I worked with my IT to uninstall the agent, but uninstalling is not without a fight. Here are the steps that I took: Since it is a Windows 11 machine with Bitlocker, I have to first get the Bitlocker key. From command prompt run: manage-bde -protectors -get C: After I verified it is the same key that the IT has, I saved the key outside of the machine. Then go to system configuration by searching for "sysconfig" or run msconfig. Under "boot" tab, check the "Safe boot" option, then click ...

Error When Generating OpenAPI Documents: Missing required option '--project'

After I installed Microsoft.Extensions.ApiDescription.Server package, I encountered the following error message when I attempted to generate OpenAPI documents at build-time on .NET 9. Missing required option '--project' The command "dotnet "..."" exited with code 1 Apparently, it was due to end slash on my attempt to change the output directory. On my csproj file, I have the following entry: <PropertyGroup> <OpenApiDocumentsDirectory>../directory/</OpenApiDocumentsDirectory> </PropertyGroup> It works correctly after I removed the end slash: <PropertyGroup> <OpenApiDocumentsDirectory>../directory</OpenApiDocumentsDirectory> </PropertyGroup>

Logitech Mouse and Keyboard do not Work

I found a Logitech mouse and keyboard combo on clearance. The model is MK470 and it looks returned. For the steep discounted price, I decided to give a try. Expectedly, it didn't work, so that starts my troubleshooting. Battery is fine, no on/off button on keyboard, both mouse and keyboard are not working, no sign of damage, dongle is properly inserted into the USB port. Short while later, I found that Logitech has a neat Connection Utility software . I downloaded it and ran it twice, once to reconnect the mouse and once for the keyboard. My guess is the frequency and channel somehow was not lining up between the mouse and keyboard and the dongle. The previous buyer probably returned it because they were not working. But the connection is finally restored.

AWS Cognito Error on Sign Up

I was exploring AWS Cognito for authentication. It works great, but I got the following error message after I tested the sign up process: An error was encountered with the requested page. I found out later that I misunderstood the AutoVerifiedAttributes field in my CloudFormation. I thought it would mark an email or phone number as verified without actually verifying them. Apparently, it means it will try to verify either email or phone number. So, when I set it to email, it sent a verification email and the sign up process went without error.

ASP.NET Application Crashed without Error Message

I encountered a strange error with ASP.NET Web API application. It runs fine locally, but when we deployed to Kubernetes cluster, it crashed as soon as it starts. And no error message was thrown. So, I pulled the application to my local and it crashed as well no matter how I run it, dotnet cli, Docker Desktop, Visual Studio debug. The only one that runs fine is the version from the repo. At this point, there are only two possibilities, either the environment is the issue or the application is the issue, so I decided to deploy it to a different environment and it's still not working, so it must be something with the application. Since it is the application, I tried to change the log level to Trace to get more information but no new error message that provides a hint on what's going on. Memory dump didn't work as the collector didn't have enough time to collect before the application crashed. At the end, I decided to approach this the hard way. So, in my local, there are ...

JWT is not well formed in ASP.NET Web API JwtBearer .NET 8

 It never caused a problem for me to implement JwtBearer token validator, but this time it is really take my time to troubleshoot what's going on. Long story short, there's a breaking change going to .NET 8 and on top of that, the default package version doesn't solve the issue. Here's how I implement my service: services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, options => ...removed for brevity); services.AddAuthorization(); ... app.UseAuthentication(); app.UseAuthorization(); But checking the bearer token, it was a completely valid token. I retrieved the token using a quick custom middleware. app.Use(async (context, next) => { await next.Invoke(); Debug.WriteLine(context.Request.Headers.Authorization); }); app.UseAuthentication(); ... Then I validate the token in  https://jwt.io . The error that I received contains: IDX14100: JWT is not well formed, there are no dots (.). Th...

Swagger .NET 8 Error

Swashbuckle CLI was able to output schema of my API before, but this time, it throws this error message: System.InvalidOperationException: A type named 'StartupProduction' or 'Startup' could not be found in assembly I used top level statement with minimal API on .NET 8 and nothing is changed on that, so I was not able to find anything to do with Startup type. After I investigate further by commenting line by line, I found out that the issue is on my switch statement. So it looks like the following: return config.Section?.Key switch { Value1 => services.AddSingleton<Handler1>(), Value2 => services.AddSingleton<Handler2>(), _ => throw new InvalidOperationException(); } Problem is the Section is pulled from appsettings.json and when the CLI runs, it doesn't have value, so it never returned the services object. Changing the above to the following fixed the issue: return config.Section == null ? services : config.Section.Key switch { Value1 =...