- ABP Framework version: v8.3.1
- UI Type: MVC
- Database System: EF Core (SQL Server) / MongoDB
- Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
- Exception message and full stack trace:
2024-11-06 16:27:09.312 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0
2024-11-06 16:27:11.207 +07:00 [INF] Received HTTP response headers after 1893.3172ms - 200
2024-11-06 16:27:11.210 +07:00 [INF] End processing HTTP request after 1908.0361ms - 200
2024-11-06 16:27:11.258 +07:00 [INF] Start processing HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0
2024-11-06 16:27:11.258 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0
2024-11-06 16:27:11.724 +07:00 [INF] Received HTTP response headers after 466.1528ms - 200
2024-11-06 16:27:11.725 +07:00 [INF] End processing HTTP request after 467.0009ms - 200
2024-11-06 16:27:11.971 +07:00 [DBG] Get dynamic claims cache for user: 60cd42b7-b510-7522-219f-3a15c02808ce
2024-11-06 16:27:11.973 +07:00 [DBG] Refresh dynamic claims for user: 60cd42b7-b510-7522-219f-3a15c02808ce from remote service.
2024-11-06 16:27:11.975 +07:00 [INF] Start processing HTTP request POST http://localhost:44331/api/account/dynamic-claims/refresh
2024-11-06 16:27:11.975 +07:00 [INF] Sending HTTP request POST http://localhost:44331/api/account/dynamic-claims/refresh
2024-11-06 16:27:13.921 +07:00 [INF] Received HTTP response headers after 1946.4158ms - 200
2024-11-06 16:27:13.922 +07:00 [INF] End processing HTTP request after 1946.7416ms - 200
2024-11-06 16:27:13.924 +07:00 [WRN] Failed to refresh remote dynamic claims cache for user: 60cd42b7-b510-7522-219f-3a15c02808ce
Volo.Abp.AbpException: Failed to refresh remote claims for user: 60cd42b7-b510-7522-219f-3a15c02808ce
at Volo.Abp.Security.Claims.RemoteDynamicClaimsPrincipalContributorCacheBase
1.GetAsync(Guid userId, Nullable
1 tenantId) at Volo.Abp.Security.Claims.RemoteDynamicClaimsPrincipalContributorBase`2.ContributeAsync(AbpClaimsPrincipalContributorContext context) 2024-11-06 16:27:13.928 +07:00 [INF] Executing endpoint '/DocumentsManagement/DocumentInboxes/Index' 2024-11-06 16:27:13.942 +07:00 [INF] Route matched with {page = "/DocumentsManagement/DocumentInboxes/Index", action = "", controller = "", area = ""}. Executing page /DocumentsManagement/DocumentInboxes/Index 2024-11-06 16:27:13.944 +07:00 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy 2024-11-06 16:27:13.965 +07:00 [INF] Start processing HTTP request GET http://localhost:44322/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 2024-11-06 16:27:13.965 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 2024-11-06 16:27:14.023 +07:00 [INF] Received HTTP response headers after 58.0335ms - 200 2024-11-06 16:27:14.024 +07:00 [INF] End processing HTTP request after 58.4179ms - 200 2024-11-06 16:27:14.025 +07:00 [INF] Start processing HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 2024-11-06 16:27:14.025 +07:00 [INF] Sending HTTP request GET http://localhost:44322/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 2024-11-06 16:27:14.119 +07:00 [INF] Received HTTP response headers after 93.2711ms - 200 2024-11-06 16:27:14.119 +07:00 [INF] End processing HTTP request after 93.6022ms - 200 2024-11-06 16:27:14.135 +07:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": { "ActivatorChain": "DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel" }, "validationErrors": null }
2024-11-06 16:27:14.135 +07:00 [ERR] An exception was thrown while activating DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel. Autofac.Core.DependencyResolutionException: An exception was thrown while activating DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel' can be invoked with the available services and parameters: Cannot resolve parameter 'DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService documentInboxesAppService' of constructor 'Void .ctor(DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService)'.
See https://autofac.rtfd.io/help/no-constructors-bindable for more info. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.
2024-11-06 16:27:14.140 +07:00 [INF] Executed page /DocumentsManagement/DocumentInboxes/Index in 194.5335ms 2024-11-06 16:27:14.140 +07:00 [INF] Executed endpoint '/DocumentsManagement/DocumentInboxes/Index' 2024-11-06 16:27:14.157 +07:00 [ERR] An unhandled exception has occurred while executing the request. Autofac.Core.DependencyResolutionException: An exception was thrown while activating DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'DocumentsManagement.Web.Pages.DocumentsManagement.DocumentInboxes.IndexModel' can be invoked with the available services and parameters: Cannot resolve parameter 'DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService documentInboxesAppService' of constructor 'Void .ctor(DocumentsManagement.DocumentInboxes.IDocumentInboxesAppService)'.
See https://autofac.rtfd.io/help/no-constructors-bindable for more info. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.
- Steps to reproduce the issue: Run the application, click the Document Inboxes menu item
I am trying to create my own service (Called DocumentManagement). I created a DocumentService (microservice infrastructure) and DocumentsManagement (DDD Principle). After running the application, I am facing with 2 issues: The first one is an exception I have posted log above The second is swagger error (status code is 502) when trying to access the APIs at /swagger/index.html?urls.primaryName=Documents%20API
You can teach me what I wrong, how to does not repeat in the future. Is there any detailed documentation to implement step by step.
If the supporter is maliming, you should access my Github (Shared with you last time) and run the application.
Many thanks.
31 Answer(s)
-
0
hi
Can you share your github url again?
Thanks.
-
0
hi
Can you share your github url again?
Thanks.
I have shared, please check your email
-
0
ok, I will check it.
-
0
hi
Please add
DocumentsManagement.Application
andDocumentsManagement.HttpApi
to yourservices/documents/TSD.DOCS.DocumentsService/TSD.DOCS.DocumentsService.csproj
You can check other services to see which module needs to depend on in
DocumentsService
project -
0
I have updated the dependencies as you suggested. And still have the same issues.
Please pull code again to check.
Thank you.
-
0
hi
Can you add
<ProjectReference Include="../../../services/documents-management/src/DocumentsManagement.HttpApi.Client/DocumentsManagement.HttpApi.Client.csproj" />
toapps/web
project? -
0
-
0
hi
Please share the error logs of 502 error.
Thanks.
-
0
Hi maliming,
There are the detailed logs:
2024-11-07 15:14:28.369 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/index.html?urls.primaryName=Documents%20API - null null 2024-11-07 15:14:28.371 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/index.html?urls.primaryName=Documents%20API - 200 null text/html;charset=utf-8 2.0706ms 2024-11-07 15:14:28.772 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - null null 2024-11-07 15:14:28.773 +07:00 [INF] Executing endpoint 'DocumentsSwagger' 2024-11-07 15:14:28.774 +07:00 [INF] Proxying to http://localhost:44308/swagger/v1/swagger.json HTTP/2 RequestVersionOrLower no-streaming 2024-11-07 15:14:32.816 +07:00 [INF] "Request": An error was encountered before receiving a response. System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (localhost:44308) ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. 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.<ConnectAsync>g__WaitForConnectWithCancellation|285_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 --- at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem) at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Yarp.ReverseProxy.Forwarder.HttpForwarder.SendAsync(HttpContext context, String destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer, CancellationToken cancellationToken) 2024-11-07 15:14:32.816 +07:00 [INF] Executed endpoint 'DocumentsSwagger' 2024-11-07 15:14:32.816 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - 502 0 null 4043.979ms
-
0
-
0
Hi maliming, I dont know why the DocumentService lauchsettings.json point to 44377 but I have changed to 44308
And this is detailed logs after I changed port number
2024-11-07 20:41:17.093 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.js - null null 2024-11-07 20:41:17.108 +07:00 [INF] Sending file. Request path: '/swagger/ui/abp.js'. Physical path: 'N/A' 2024-11-07 20:41:17.109 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.js - 200 3122 application/javascript 16.0826ms 2024-11-07 20:41:17.139 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.swagger.js - null null 2024-11-07 20:41:17.139 +07:00 [INF] Sending file. Request path: '/swagger/ui/abp.swagger.js'. Physical path: 'N/A' 2024-11-07 20:41:17.140 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.swagger.js - 200 4527 application/javascript 1.0109ms 2024-11-07 20:41:17.178 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-bundle.js - null null 2024-11-07 20:41:17.183 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-standalone-preset.js - null null 2024-11-07 20:41:17.183 +07:00 [INF] Sending file. Request path: '/swagger-ui-bundle.js'. Physical path: 'N/A' 2024-11-07 20:41:17.184 +07:00 [INF] Sending file. Request path: '/swagger-ui-standalone-preset.js'. Physical path: 'N/A' 2024-11-07 20:41:17.196 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-standalone-preset.js - 200 312163 text/javascript 12.9733ms 2024-11-07 20:41:17.196 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-bundle.js - 200 1061536 text/javascript 17.5968ms 2024-11-07 20:41:18.014 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - null null 2024-11-07 20:41:18.031 +07:00 [INF] Executing endpoint 'DocumentsSwagger' 2024-11-07 20:41:18.079 +07:00 [INF] Proxying to http://localhost:44308/swagger/v1/swagger.json HTTP/2 RequestVersionOrLower no-streaming 2024-11-07 20:41:23.013 +07:00 [INF] "Request": An error was encountered before receiving a response. System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (localhost:44308) ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. 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.<ConnectAsync>g__WaitForConnectWithCancellation|285_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 --- at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem) at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Yarp.ReverseProxy.Forwarder.HttpForwarder.SendAsync(HttpContext context, String destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer, CancellationToken cancellationToken) 2024-11-07 20:41:23.032 +07:00 [INF] Executed endpoint 'DocumentsSwagger' 2024-11-07 20:41:23.035 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - 502 0 null 5021.3847ms
-
0
-
0
Hi maliming,
It works correctly.
As you know, I created two support tickets and my problem is very common, based on configure solution. The exception does not show detailed issues so I don't know how to fix it. Could you share anything with me that I can resolve in the future?
-
0
hi
You can troubleshoot problems by
logs.txt
I also learned that you didn't depend on
AbpAspNetCoreMvcUiMultiTenancyModule
based on logs.txt -
0
Yeah, thank you for your help. Can I open this ticket for some days? I may need your help when implementing functions.
-
0
hi
The bot will close the question. But you can open it anytime if you have the same problem.
-
0
After running the application, access to /DocumentsManagement/DocumentInboxes, another AbpException, please help me what I wrong. Every request of the DocumentsServie is not found
at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.GetActionApiDescriptionModel(IAbpMethodInvocation invocation) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at lambda_method2073(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
-
0
hi
You should use a static proxy in your module.
The database name is constant.
services\documents-management\src\DocumentsManagement.HttpApi.Client>abp generate-proxy -t csharp -url http://localhost:44308/ -m DocumentsManagement --without-contracts
Please check my changes. https://github.com/quocduong/TSD-POC-Microservice/commit/4fe28736db2143304a2231500682f2cda98da037
-
0
hi
You should use a static proxy in your module.
Do you have any other ways? Because our developers are working in a no-internet environment so we can not use the abp cli
-
0
Hi maliming,
I want to add more properties to the ICurrentUser at login time and use for every service. How can I do it?
For example: I want to store long? NodeId & short? UserType
-
0
hi
Because our developers are working in a no-internet environment so we can not use the abp cli
ABP CLI
generate-proxy
command doesn't need the internet. -
0
I want to add more properties to the ICurrentUser at login time and use for every service. How can I do it?
Can you create a new question?
Thanks.
-
0
Hi maliming,
I have created a new API: DocumentInboxController.cs
[HttpGet] // [Route("getAll")]: I am trying to add this but does not success. public Task<List<DocumentInboxForViewDto>> GetAllAsync(GetDocumentInboxesInput input) { return _documentInboxesAppService.GetAllAsync(input); }
This is the existing method: [HttpGet] public virtual Task<PagedResultDto<DocumentInboxDto>> GetListAsync(GetDocumentInboxesInput input) { return _documentInboxesAppService.GetListAsync(input); }
When running the swagger, I got the error: Conflicting method/path combination "GET api/documents-management/document-inboxes" for actions - DocumentsManagement.DocumentInboxes.DocumentInboxController.GetAllAsync (DocumentsManagement.HttpApi),DocumentsManagement.DocumentInboxes.DocumentInboxController.GetListAsync (DocumentsManagement.HttpApi). Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround
How can I use many APIs with the same HTTP method?
-
0
I use Route("get-All")], it works but I dont want the dash
-
0
hi
You have to use a different URL for the same
GET
actions.[HttpGet] [Route("all")] public Task<List<DocumentInboxForViewDto>> GetAllAsync(GetDocumentInboxesInput input) { return _documentInboxesAppService.GetAllAsync(input); } [HttpGet] public virtual Task<PagedResultDto<DocumentInboxDto>> GetListAsync(GetDocumentInboxesInput input) { return _documentInboxesAppService.GetListAsync(input); }