Open Closed

Adding, or editing a User or role does not complete #10391


User avatar
0
matt@fleetsafe.ai created

We are working on a new project, we cannot create new users, CreateAsync does not complete and timesout.

We have tried deploying the API host to azure and no errors are logged in app insights for this

  • Template: app
  • Created ABP Studio Version: 2.1.6
  • Current ABP Studio Version: 2.0.2
  • Tiered: Yes
  • Multi-Tenancy: Yes
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: system
  • Theme Menu Placement: side
  • Progressive Web App: No
  • Run Progressive Web App Support: No
  • Database Provider: ef
  • Database Management System: sqlserver
  • Separate Tenant Schema: No
  • Mobile Framework: maui
  • Public Website: No
  • Social Login: No
  • Include Tests: Yes
  • Kubernetes Configuration: No
  • Distributed Event Bus: rabbitmq
  • Use Local References: No
  • Optional Modules:
    • GDPR
    • FileManagement
    • TextTemplateManagement
    • LanguageManagement
    • AuditLogging
    • Chat
    • OpenIddictAdmin
  • Selected Languages: English, Arabic, Chinese (Simplified), Chinese (Traditional), Czech, English (United Kingdom), Finnish, French, German (Germany), Hindi , Hungarian, Icelandic, Italian, Portuguese (Brazil), Romanian (Romania), Russian, Slovak, Spanish, Swedish, Turkish
  • Default Language: English
  • Create Command: abp new FleetAssistant -t app --tiered --ui-framework angular --mobile maui --database-provider ef --database-management-system sqlserver --theme leptonx --skip-migration --skip-migrator --without-cms-kit --sample-crud-page --dont-run-install-libs --dont-run-bundling --no-social-logins -chat -file-management

3 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This symptom (Create/Edit User/Role “never completes” and then times out) is almost always a SQL Server execution timeout caused by blocking/locked rows on ABP Identity tables (AbpUsers, AbpRoles, AbpUserRoles) rather than an ABP “CreateAsync bug”.
    • The exact pattern is: the request reaches Volo.Abp.Identity.IdentityUserController.CreateAsync, then EF Core executes a batch that updates role concurrency stamps + inserts into AbpUserRoles, but SQL Server can’t finish within the default 30s (because it’s blocked or the DB is overloaded). In Azure this can happen with DTU/CPU pressure, long-running transactions, or stuck pods/instances holding locks.

    1) Find and remove the blocker (real fix)

    While reproducing the issue (try creating a user), run this on the same SQL database used by the Identity service:

    -- Who is blocked / blocking right now?
    SELECT
        r.session_id,
        r.status,
        r.command,
        r.blocking_session_id,
        r.wait_type,
        r.wait_time,
        r.wait_resource,
        t.text AS sql_text
    FROM sys.dm_exec_requests r
    OUTER APPLY sys.dm_exec_sql_text(r.sql_handle) t
    WHERE r.session_id > 50;
    

    What to look for:

    • blocking_session_id <> 0
    • wait_type like LCK_M_*
    • statements touching AbpUsers / AbpRoles / AbpUserRoles

    If you see a suspended session coming from one of your app instances/pods (common in tiered + distributed setups), the practical fix is:

    • restart the offending API/AuthServer pod/app instance (this releases locks immediately), and/or
    • fix whatever background job / request is holding a long transaction open.

    2) Immediate mitigation: increase EF Core command timeout (workaround)

    This doesn’t fix blocking, but it prevents failing at exactly 30 seconds while you diagnose:

    In the module where you configure EF Core (your Identity/HttpApiHost EF Core module), configure SQL Server command timeout:

    using Microsoft.EntityFrameworkCore;
    using Volo.Abp.EntityFrameworkCore;
    
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpDbContextOptions>(options =>
        {
            options.UseSqlServer(sqlOptions =>
            {
                sqlOptions.CommandTimeout(120); // seconds
            });
        });
    }
    

    3) Production checklist (to prevent recurrence)

    • Ensure no long-running Unit of Work is updating many users/roles in one transaction.
    • Ensure the Azure SQL tier has enough resources (DTU/vCore). Blocking becomes much more visible under load.
    • If you’re running multiple replicas, verify you don’t have a stuck instance holding transactions (a restart fixing it is a strong indicator).

    (verified) reference

    • https://abp.io/docs/latest/solution-templates/microservice/database-configurations

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    matt@fleetsafe.ai created

    The Sql database is idling, I just scaled to a much larger instance and its still the same

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you enable debug logs and check the logs.txt file?

    https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems

    Thanks

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 v10.2.0-preview. Updated on February 05, 2026, 13:24
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.