Open Closed

ABP-upgrade-to-911-Angular-ConfigStateService--cause-Administration-Micro-service--500-error #9219


User avatar
0
DominaTang created

Our angular project has account module source code from ABP 7.2.3. The personal-setting.component.ts, when click save button, it calls the line this.configState.refreshAppState(); and throw 500 error. From network table it trying to reach the Administration Micro Service's ps://localhost:44325/api/abp/application-configuration?includeLocalizationResources=false 500 (Internal Server Error) But if directly call Administration Micros service's swagger API, there is no any issue. From the Gateway Log: [INF] Proxying to https://localhost:44367/api/abp/application-configuration?includeLocalizationResources=false HTTP/2 RequestVersionOrLower [INF] Received HTTP/2.0 response 500.

From Administration Micro Service log: 2025-04-29 15:34:28.792 -04:00 [INF] CORS policy execution failed. 2025-04-29 15:34:28.792 -04:00 [INF] Request origin http://localhost:4200 does not have permission to access the resource. 2025-04-29 15:34:28.797 -04:00 [ERR] An error occurred using the connection to database '' on server ''. 2025-04-29 15:34:28.797 -04:00 [ERR] An exception occurred while iterating over the results of a query for context type 'Bdo.Ess.IdentityService.EntityFrameworkCore.IdentityServiceDbContext'. System.InvalidOperationException: The ConnectionString property has not been initialized.

It looks like that Administration Service try to access identity Service and database connection string is empty? The weird thing is, after click go to the home and click save button on use setting page, there is no exception thrown.


3 Answer(s)
  • User Avatar
    0
    erdem.caygor created
    Support Team

    Hello, and thanks for reporting this issue.

    Based on the logs from your Administration Service, it appears that the service is encountering both a CORS policy error and a missing connection string for the Identity Service.

    Could you try making the following changes to see if it resolves the issue?

    Missing Connection String It appears that the IdentityService connection string is not defined in your Administration Service configuration. Please make sure to define a valid connection string for the Identity Service under the ConnectionStrings section in your appsettings.json.

    CORS Configuration Could you please add UI domain (http://localhost:4200) into the CorsOrigins configuration, like so:

    "CorsOrigins": "http://localhost:4200,http://localhost:44368"
    

    After making these changes, restart the service and see if the issue still occurs. Let me know the result

  • User Avatar
    0
    DominaTang created

    Add connection string to Identity Db in Administration Service works. Though after click save button, Angular app somehow automatically navigate to the home page. I comment this line since from that component code, when updating personal info (roles are not updated). There is no need to call refreshAppState().

  • User Avatar
    0
    erdem.caygor created
    Support Team

    Hello, I wasn’t able to reproduce the redirection issue on my local environment, but as you mentioned, the refreshAppState() call does seem unnecessary in this context, especially since the updated information doesn’t affect roles or permissions. Removing that line makes sense and is a valid solution. Best regards

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on May 15, 2025, 10:28