Is python grpc client support retry? - grpc-python

I'using grpc in Python, and I found that the communication between two node accidentally encountering StatusCode.UNAVAILABLE.
I found a solution which said UNAVAILABLE is a retry-able error, we should retry:https://github.com/grpc/grpc/issues/16515.
So I looked up the documentation and found this:https://github.com/grpc/proposal/blob/master/A6-client-retries.md. This documentation shows a config demo as shown bellow.
"retryPolicy": {
"maxAttempts": 4,
"initialBackoff": "0.1s",
"maxBackoff": "1s",
"backoffMultiplier": 2,
"retryableStatusCodes": [
"UNAVAILABLE"
]
}
I tried following the two examples in this question, but it still doesn't work: Use retryPolicy with python GRPC client
Here is my code, there is another problem here, too. I don't quite understand the meaning of "." :
json_config = json.dumps(
{
"methodConfig": [
{
# "name": [{"service": "<package>.<service>"}],
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.1s",
"maxBackoff": "10s",
"backoffMultiplier": 2,
"retryableStatusCodes": ["UNAVAILABLE"],
},
}
]
}
)
options = [
('grpc.service_config', json_config)
]
taf_grpc_client = GrpcRpcClient(RpcConfig(taf_server_host, self._taf_server_port, options=options),
taf_server_proto_pb2_grpc.TafServerStub)
self._taf_grpc_client_dict[taf_server_host] = taf_grpc_client
What I want to know is whether or not Python GRPC supports "retry", and what's the proper usage of it.

The service config you specified is correct. Since there isn't a reproduction case, I applied your code to our HelloWorld example:
async def run() -> None:
json_config = json.dumps({
"methodConfig": [{
"name": [{
"service": "helloworld.Greeter"
}],
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.1s",
"maxBackoff": "10s",
"backoffMultiplier": 2,
"retryableStatusCodes": ["UNAVAILABLE"],
},
}]
})
async with grpc.aio.insecure_channel('localhost:50051',
options=(('grpc.service_config',
json_config),)) as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = await stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)
If you ran it with env GRPC_VERBOSITY=debug, you should observe multiple attempt to retry to connect. If there are other issues, please file an issue to https://github.com/grpc/grpc/issues.

Tested with the code below, when timeout is enabled, the retry policy doesn't take effect. Especially, the logs don't explicitly distinguish between retries for channel connection and those for grpc call, i.e. helloworld_pb2.HelloRequest, and thus it's difficult to tell that retry for grpc call really happens. Please correct me if there is any misunderstanding here.
Package version:
python 3.9.4
grpcio 1.40.0
json_config = json.dumps({
"methodConfig": [{
"name": [{
"service": "helloworld.Greeter"
}],
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.1s",
"maxBackoff": "2s",
"backoffMultiplier": 2,
"retryableStatusCodes": ["UNAVAILABLE", "DEADLINE_EXCEEDED"],
},
}]
})
async with grpc.aio.insecure_channel('localhost:50051',
options=(('grpc.service_config',
json_config),)) as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
try:
response = await stub.SayHello(helloworld_pb2.HelloRequest(name='you'), timeout=3)
print("Greeter client received: " + response.message)
except Exception as e:
print(e)
time.sleep(60)
Logs:
D0828 22:22:08.717000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "grpclb"
D0828 22:22:08.720000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "priority_experimental"
D0828 22:22:08.723000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "weighted_target_experimenta
l"
D0828 22:22:08.726000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "pick_first"
D0828 22:22:08.731000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "round_robin"
D0828 22:22:08.733000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "ring_hash_experimental"
D0828 22:22:08.735000000 19852 src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc:320] Using native dns resolver
D0828 22:22:08.738000000 19852 src/core/ext/xds/certificate_provider_registry.cc:33] registering certificate provider factory for "file_watcher"
D0828 22:22:08.740000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "cds_experimental"
D0828 22:22:08.742000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "xds_cluster_impl_experiment
al"
D0828 22:22:08.745000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "xds_cluster_resolver_experi
mental"
D0828 22:22:08.747000000 19852 src/core/ext/filters/client_channel/lb_policy_registry.cc:42] registering LB policy factory for "xds_cluster_manager_experim
ental"
D0828 22:22:08.753000000 19852 src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc:267] Start resolving.
I0828 22:22:10.806000000 31236 src/core/ext/filters/client_channel/subchannel.cc:1012] Connect failed: {"created":"#1661696530.806000000","description":"OS
Error","file":"src/core/lib/iomgr/tcp_client_windows.cc","file_line":106,"os_error":"No connection could be made because the target machine actively refus
ed it.\r\n","syscall":"ConnectEx","wsa_error":10061}
<AioRpcError of RPC that terminated with:
status = StatusCode.DEADLINE_EXCEEDED
details = "Deadline Exceeded"
debug_error_string = "{"created":"#1661696531.755000000","description":"Deadline Exceeded","file":"src/core/ext/filters/deadline/deadline_filter.cc
","file_line":81,"grpc_status":4}"
>
I0828 22:22:12.988000000 31236 src/core/ext/filters/client_channel/subchannel.cc:1012] Connect failed: {"created":"#1661696532.987000000","description":"OS
Error","file":"src/core/lib/iomgr/tcp_client_windows.cc","file_line":106,"os_error":"No connection could be made because the target machine actively refus
ed it.\r\n","syscall":"ConnectEx","wsa_error":10061}
D0828 22:22:13.007000000 31236 src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc:245] In cooldown from last resolution (from 4255 ms
ago). Will resolve again in 25745 ms
I0828 22:22:13.013000000 31236 src/core/ext/filters/client_channel/subchannel.cc:955] Subchannel 000001FC0A0AA500: Retry immediately
I0828 22:22:13.015000000 31236 src/core/ext/filters/client_channel/subchannel.cc:980] Failed to connect to channel, retrying
I0828 22:22:15.053000000 31236 src/core/ext/filters/client_channel/subchannel.cc:1012] Connect failed: {"created":"#1661696535.052000000","description":"OS
Error","file":"src/core/lib/iomgr/tcp_client_windows.cc","file_line":106,"os_error":"No connection could be made because the target machine actively refus
ed it.\r\n","syscall":"ConnectEx","wsa_error":10061}
I0828 22:22:15.060000000 31236 src/core/ext/filters/client_channel/subchannel.cc:955] Subchannel 000001FC0A1184E0: Retry immediately
I0828 22:22:15.062000000 31236 src/core/ext/filters/client_channel/subchannel.cc:980] Failed to connect to channel, retrying
I0828 22:22:17.091000000 31236 src/core/ext/filters/client_channel/subchannel.cc:1012] Connect failed: {"created":"#1661696537.091000000","description":"OS
Error","file":"src/core/lib/iomgr/tcp_client_windows.cc","file_line":106,"os_error":"No connection could be made because the target machine actively refus
ed it.\r\n","syscall":"ConnectEx","wsa_error":10061}
I0828 22:22:17.099000000 31236 src/core/ext/filters/client_channel/subchannel.cc:955] Subchannel 000001FC0A0AA500: Retry immediately
I0828 22:22:17.101000000 31236 src/core/ext/filters/client_channel/subchannel.cc:980] Failed to connect to channel, retrying

Related

RabbitMQ Connection refused 127.0.0.1:5672

I am preparing a simple ASP.NET Core MVC web application.
I have installed RabbitMQ server to my laptop. RabbitMQ Management UI is running on localhost:15672.
Rabbit MQ cluster name is like: rabbit#CR00001.ABC.COM.LOCAL
I am trying to send message to rabbitmq in controller. But I am getting None of the specified endpoints were reachable error.
If I use 'localhost' as host name, I get Connection refused 127.0.0.1:5672 in inner exceptions.
If I use rabbit as host name, I get Name or service not known
I've tried to solve the problem according to other StackOverflow questions, however, none of them could solved my problem.
Home controller:
[HttpPost]
public void SendMessage([FromBody]Message message)
{
try
{
var factory = new ConnectionFactory()
{
UserName = _username,
Password = _password,
HostName = _hostname,
VirtualHost = "/",
Port = _port,
};
using (var connection = factory.CreateConnection())
using (var channel = connection.CreateModel())
{
channel.QueueDeclare(queue: _queueName,
durable: false,
exclusive: false,
autoDelete: false,
arguments: null);
var body = Encoding.UTF8.GetBytes(message.Text);
channel.BasicPublish(exchange: "",
routingKey: _queueName,
basicProperties: null,
body: body);
}
}
catch (Exception ex)
{
}
}
appsettings.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"RabbitMq": {
"Hostname": "localhost",
"QueueName": "WordQueue",
"UserName": "test",
"Password": "test",
"Port": 5672
}
}
Here is test user configuration in Rabbit MQ Management UI
Have you setup your test user in the UI portal? This is probably the cause of your connection refused error. You can setup users via http://localhost:15672/#/users.
You should also debug your factory to check that your config values are being passed in correctly
I would also suggest that you pop some code in your catch to ensure you aren't missing an exception
The references to http://rabbit are for use within containers. These will only work if you are running both your ASPNET and Rabbit applications within a containerised network (for example Docker Compose). I found using containers was a much better approach for learning RabbitMq.
Apprciate that this is going a little off-topic now, but if you are not familiar with containerisation I would suggest taking a look at this post (and the respective series) from Wolfgang Ofner https://www.programmingwithwolfgang.com/rabbitmq-in-an-asp-net-core-3-1-microservice/ and the getting started with Docker from Brad Traversy on YouTube https://www.youtube.com/watch?v=Kyx2PsuwomE
After create user, do not forget set permissions,
basicaly,
can access virtual hosts (/)
set topic permission (AMQP default)
Note: of course you can use rabbitmq ui for this operation (create user and permissions).
var factory = new ConnectionFactory() { HostName = "hostname_or_ip_adres_here", UserName="username here..", Password="psw here.."
};
this will work !

AWS .NET Core Worker Service using AWS local profile for development is trying to access IAM credentials from instance profile?

I have a .NET Core Worker service using AWS SQS to read messages off a queue. For local development I'm using a default profile with access/secret key stored in that. My appSettings.json is set up as follows:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
},
"TargetCloudWatchGroup": "/aws/insite/workers"
},
"App": {
"TaskProcessDelay": 10000,
"Environment": "NA",
"WorkerType": "INCOMING"
},
"AWS": {
"Region": "ap-southeast-2",
"Profile": "default",
"ProfilesLocation": "C:\\Users\\JMatson\\.aws\\credentials",
"AwsQueueLongPollTimeSeconds": 5,
"QueueUrl": "https://sqs.ap-southeast-2.amazonaws.com/712510509017/insite-incoming-dev"
}
}
I'm using DI to set up the services:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
//var options = hostContext.Configuration.GetAWSOptions();
services.AddDefaultAWSOptions(hostContext.Configuration.GetAWSOptions());
services.AddHostedService<Worker>();
services.AddSingleton<ILogger, Logger>(); // Using my own basic wrapper around NLog for the moment, pumped to CloudWatch.
services.AddAWSService<IAmazonSQS>();
});
But when I run the program in debug, it fails to read a message off the queue within Worker.cs with the following error:
An exception of type 'Amazon.Runtime.AmazonServiceException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'Unable to get IAM security credentials from EC2 Instance Metadata Service.'
On startup it seems like after a couple of tries along the credentials chain it finds my credentials?
[40m[32minfo[39m[22m[49m: AWSSDK[0]
Failed to find AWS credentials for the profile default
AWSSDK: Information: Failed to find AWS credentials for the profile default
[40m[32minfo[39m[22m[49m: AWSSDK[0]
Found credentials using the AWS SDK's default credential search
AWSSDK: Information: Found credentials using the AWS SDK's default credential search
So why is it failing? If I check the immediate window I can see it's picking up my setttings:
?hostContext.Configuration.GetAWSOptions().Profile
"default"
?hostContext.Configuration.GetAWSOptions().ProfilesLocation
"C:\\Users\\JMatson\\.aws\\credentials"

Unable to call watson language translator using proxy

when I called watson language translator service over a public network its responded with no error. meanwhile, its not able to get response body over my private network
I am using the NGINX has my load balancer and have configure a proxy_http for it on the configuration.
The error is
{ Error: Response not received. Body of error is HTTP ClientRequest object
at formatError (root\node_modules\ibm-cloud-sdk-core\lib\requestwrapper.js:115:17)
at D:\Rafiki Project\production build\Rafiki Production Files 1\ecobot-orchestrator-master_23_9-orch_persistency_fixes\node_modules\ibm-cloud-sdk-core\lib\requestwrapper.js:265:19
at process._tickCallback (internal/process/next_tick.js:68:7)
var languageTranslator = new LanguageTranslatorV2({
username:'8******************',
password:'*************',
url: 'https://gateway.watsonplatform.net/language-translator/api/',
version: '2017-05-26'
});
function translateToWSPLan(req, res, callback){
console.log("the request for translation is::");
console.log(JSON.stringify(req));
console.log("======================");
languageTranslator.identify(req.body.identifyParams, function(err, data){
if(err){
console.log('=================error==========');
console.log(err);
console.log('=================================');
var errorLog = {name: err.name, message: err.message};
callback(errorLog);
}else {
}
})
See this issue raised on the Node.js SDK for Watson - https://github.com/watson-developer-cloud/node-sdk/issues/900#issuecomment-509257669
To enable proxy routing, add proxy settings to the constructor
var languageTranslator = new LanguageTranslatorV2({
username:'8******************',
password:'*************',
url: 'https://gateway.watsonplatform.net/language-translator/api/',
version: '2017-05-26',
// other params...
proxy: '<some proxy config>',
httpsAgent: '<or some https agent config>'
});
If you take a look at the issue, then there is a problem with accessing IAM tokens which does not work when there is a proxy, but as you appear to be using a userid / password combination, you should be OK. That is until cloud boundary style credentials are suspended and superseded by IAM credentials for all existing Watson services.

Connection to Azure Cosmosdb failed using web socket

I have a script that connects to CosmosDB to make some operations, am using CosmosDB as graphDB, however, am using a node module called gremlin-secure which connects to cosmosDB through web sockets, however, recently, I could not connect to the Database as below error
events.js:160
throw er; // Unhandled 'error' event
^
Error: unexpected server response (200)
at ClientRequest._req.on (/Users/abshahin/dev/azure-cosmos-db-graph-nodejs-getting-started/node_modules/ws/lib/WebSocket.js:656:26)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:473:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
at TLSSocket.socketOnData (_http_client.js:362:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
my code looks like this
"use strict";
var Gremlin = require('gremlin-secure');
var config = require("./config");
const client = Gremlin.createClient(
443,
config.endpoint,
{
"session": false,
"ssl": true,
"user": `/dbs/${config.database}/colls/${config.collection}`,
"password": config.primaryKey
});
client.execute("g.addV('employee').property('id', 'abshahin')", { }, (err, results) => {
if (err) return console.error(err);
console.log(JSON.stringify(results));
});
and this is my config
var config = {}
config.endpoint = "xxxxxxxx.graphs.azure.com";
config.primaryKey = "super secret key";
config.database = "dbname"
config.collection = "collectionName"
module.exports = config;
I contacted Microsoft and they advised to post here, any help.
Check to make sure that the url of the db looks like xxx.graphs.azure.com the ulr displayed in the azure portal was not correct in my case.
This looks a bit similar to a problem I faced recently. Make sure you have latest OpenSSL version
openssl version -a
Azure CosmosDB enforces SSL/TLS 1.2 which is not supported by older versions of OpenSSL

IdentityServer4 along with Asp.Net 4.5 MVC Client

I am trying to authenticate an existing MVC application built with old Asp.Net (not the core version) with MVC framework.
By following IdentityServer4 and IdentityServer3 examples I have managed to get to a point where my user information is stored in LocalDB using EntityFramework and when I try to access to a restricted page in my client application I get redirected to the Login page provided by the IdentityServer4. However after successful login (based on what I see on the log) It does not redirect to the appropriate page. Address bar stays with something like http://localhost:5000/.... followed by lots of parameters and hashed values. Port 5000 is where I run my identity server and my application is hosted at port 44300 yet I couldn't manage to get back to there.
Has someone faced this kind of issue before or can someone please point me to an example which consists of IdentityServer4 along with a none Core version of Asp.Net.
Edit 1: Implementation Details
Server: IdentityServer4 implementation is almost clone of IdentityServer4 Quickstarts 6-AspNetIdentity.
Config File:
public class Config
{
public static IEnumerable<IdentityResource> GetIdentityResources()
{
return new List<IdentityResource>
{
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
};
}
// clients want to access resources (aka scopes)
public static IEnumerable<Client> GetClients()
{
// client credentials client
return new List<Client>
{
new Client
{
ClientId = "webapp",
ClientName = "Client WebApp",
AllowedGrantTypes = GrantTypes.Hybrid,
RedirectUris = { "http://localhost:44300/signin-oidc" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile
},
AllowOfflineAccess = true
}
};
}
}
Client: Client implementation I am using is a dummy and It originates from IdentityServer3 Client examples "MVC OWIN Client (Hybrid)".
Startup.cs:
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "Cookies"
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
AuthenticationType = "oidc",
SignInAsAuthenticationType = "Cookies",
ClientSecret = "secret",
Authority = "http://localhost:5000", //ID Server
RedirectUri = "http://localhost:44300/signin-oidc",
ClientId = "webapp",
ResponseType = "id_token code",
Scope = "openid profile",
});
}
}
Log Output: Log output after clicking secured page -> IS Login Page -> Clicking Login.
...
...
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware[3]
HttpContext.User merged via AutomaticAuthentication from authenticationScheme: Identity.Application.
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware[8]
AuthenticationScheme: Identity.Application was successfully authenticated.
dbug: IdentityServer4.Hosting.EndpointRouter[0]
Request path /connect/authorize/login matched to endpoint type Authorize
dbug: IdentityServer4.Hosting.EndpointRouter[0]
Mapping found for endpoint: Authorize, creating handler: IdentityServer4.Endpoints.AuthorizeEndpoint
info: IdentityServer4.Hosting.IdentityServerMiddleware[0]
Invoking IdentityServer endpoint: IdentityServer4.Endpoints.AuthorizeEndpoint for /connect/authorize/login
dbug: IdentityServer4.Endpoints.AuthorizeEndpoint[0]
Start authorize request (after login)
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware[8]
AuthenticationScheme: Identity.Application was successfully authenticated.
dbug: IdentityServer4.Endpoints.AuthorizeEndpoint[0]
User in authorize request: df21b123-d4b6-40ef-beed-e918bdfd56e9
dbug: IdentityServer4.Validation.AuthorizeRequestValidator[0]
Start authorize request protocol validation
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware[8]
AuthenticationScheme: Identity.Application was successfully authenticated.
dbug: IdentityServer4.Validation.AuthorizeRequestValidator[0]
Calling into custom validator: IdentityServer4.Validation.DefaultCustomAuthorizeRequestValidator
info: IdentityServer4.Endpoints.AuthorizeEndpoint[0]
ValidatedAuthorizeRequest
{
"ClientId": "webapp",
"ClientName": "Client WebApp",
"RedirectUri": "http://localhost:44300/signin-oidc",
"AllowedRedirectUris": [
"http://localhost:44300/signin-oidc"
],
"SubjectId": "df21b123-d4b6-40ef-beed-e918bdfd56e9",
"ResponseType": "code id_token",
"ResponseMode": "form_post",
"GrantType": "hybrid",
"RequestedScopes": "openid profile",
"State": "OpenIdConnect.AuthenticationProperties=m1ybV84KFOLgklhcmtb8iR6VFuDBxWSzJKpTy83w7RF3zRTwd9zHBbdSyiAHbuea2D6FM1MjCJvMbql9qjcTntyu95POoCAWGwDML0nkiaYnKPKtJxgZ7FagyvYvz87C6pYlJWmL2zbrTFkYh7IPmX-Qv9rPOfyp4uwhhbZZ731vfL1mSxuhh_p1dPVNFJJav4E8bZXyadg94EXJbqb3ecc_jQHWn1F_eiJsoVMSRdk",
"Nonce": "636268234716844341.OTFhNGE1ZTEtNTMyYy00Y2MyLWFjOGMtMDE1NjBmNDY3ZGM1NWFmNzIxMjItYTgzZC00NjJhLTk4YWMtNDExOTA0N2I4MjNl",
"SessionId": "61d148313b2a7485dd27e3110ea61fff",
"Raw": {
"client_id": "webapp",
"redirect_uri": "http://localhost:44300/signin-oidc",
"response_mode": "form_post",
"response_type": "id_token code",
"scope": "openid profile",
"state": "OpenIdConnect.AuthenticationProperties=m1ybV84KFOLgklhcmtb8iR6VFuDBxWSzJKpTy83w7RF3zRTwd9zHBbdSyiAHbuea2D6FM1MjCJvMbql9qjcTntyu95POoCAWGwDML0nkiaYnKPKtJxgZ7FagyvYvz87C6pYlJWmL2zbrTFkYh7IPmX-Qv9rPOfyp4uwhhbZZ731vfL1mSxuhh_p1dPVNFJJav4E8bZXyadg94EXJbqb3ecc_jQHWn1F_eiJsoVMSRdk",
"nonce": "636268234716844341.OTFhNGE1ZTEtNTMyYy00Y2MyLWFjOGMtMDE1NjBmNDY3ZGM1NWFmNzIxMjItYTgzZC00NjJhLTk4YWMtNDExOTA0N2I4MjNl",
"x-client-SKU": "ID_NET",
"x-client-ver": "1.0.40306.1554"
}
}
info: Microsoft.EntityFrameworkCore.Storage.IRelationalCommandBuilderFactory[1]
Executed DbCommand (0ms) [Parameters=[#__get_Item_0='?' (Size = 450)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [e].[Id], [e].[AccessFailedCount], [e].[ConcurrencyStamp], [e].[DefaultDatabaseName], [e].[DefaultDatabaseServer], [e].[Email], [e].[EmailConfirmed], [e].[HierarchyIds], [e].[LockoutEnabled], [e].[LockoutEnd], [e].[NormalizedEmail], [e].[NormalizedUserName], [e].[PasswordHash], [e].[PhoneNumber], [e].[PhoneNumberConfirmed], [e].[SecurityStamp], [e].[TwoFactorEnabled], [e].[UserName]
FROM [AspNetUsers] AS [e]
WHERE [e].[Id] = #__get_Item_0
info: IdentityServer4.ResponseHandling.AuthorizeInteractionResponseGenerator[0]
Showing consent: User has not yet consented
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 138.8585ms 302
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/consent?returnUrl=%2Fconnect%2Fauthorize%2Fconsent%3Fclient_id%3Dwebapp%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A44300%252Fsignin-oidc%26response_mode%3Dform_post%26response_type%3Did_token%2520code%26scope%3Dopenid%2520profile%26state%3DOpenIdConnect.AuthenticationProperties%253Dm1ybV84KFOLgklhcmtb8iR6VFuDBxWSzJKpTy83w7RF3zRTwd9zHBbdSyiAHbuea2D6FM1MjCJvMbql9qjcTntyu95POoCAWGwDML0nkiaYnKPKtJxgZ7FagyvYvz87C6pYlJWmL2zbrTFkYh7IPmX-Qv9rPOfyp4uwhhbZZ731vfL1mSxuhh_p1dPVNFJJav4E8bZXyadg94EXJbqb3ecc_jQHWn1F_eiJsoVMSRdk%26nonce%3D636268234716844341.OTFhNGE1ZTEtNTMyYy00Y2MyLWFjOGMtMDE1NjBmNDY3ZGM1NWFmNzIxMjItYTgzZC00NjJhLTk4YWMtNDExOTA0N2I4MjNl%26x-client-SKU%3DID_NET%26x-client-ver%3D1.0.40306.1554
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware[3]
HttpContext.User merged via AutomaticAuthentication from authenticationScheme: Identity.Application.
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware[8]
AuthenticationScheme: Identity.Application was successfully authenticated.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 32.5652ms 404
Your application running an older version of .NET isn't relevant.
In this video, one of the authors of IdentityServer demonstrates how he was able to connect a WinForm application with IDS4.
The communication to the IDS4 is made through HTTP requests, your client could be anything really as long as it can handle the communication with the IDS4.
I suggest that you open fiddler and monitor the requests to view the parameters passing.
You could also use one of the quickstarts as a base to your IDS, or compare it to your setup to check what's wrong.
From your logs, it is showing that your user has not yet consented to the scopes being requested and so is attempting to navigate to a page on the Identity Server where the user can consent.
`Request starting HTTP/1.1 GET http://localhost:5000/consent?returnUrl=%2Fconnect%2Fauthorize%2Fconsent%3Fclient_id%3Dwebapp%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A44300%252Fsignin-oidc%26response_mode%3Dform_post%26response_type%3Did_token%2520code%26scope%3Dopenid%2520profile%26state%3DOpenIdConnect.AuthenticationProperties%253Dm1ybV84KFOLgklhcmtb8iR6VFuDBxWSzJKpTy83w7RF3zRTwd9zHBbdSyiAHbuea2D6FM1MjCJvMbql9qjcTntyu95POoCAWGwDML0nkiaYnKPKtJxgZ7FagyvYvz87C6pYlJWmL2zbrTFkYh7IPmX-Qv9rPOfyp4uwhhbZZ731vfL1mSxuhh_p1dPVNFJJav4E8bZXyadg94EXJbqb3ecc_jQHWn1F_eiJsoVMSRdk%26nonce%3D636268234716844341.OTFhNGE1ZTEtNTMyYy00Y2MyLWFjOGMtMDE1NjBmNDY3ZGM1NWFmNzIxMjItYTgzZC00NjJhLTk4YWMtNDExOTA0N2I4MjNl%26x-client-SKU%3DID_NET%26x-client-ver%3D1.0.40306.1554`
This step takes place before redirecting back to your calling website, so I'm guessing you haven't implemented this page on IdSvr yet,

Resources