Open Closed

EF Core PostgreSQL exception after ABP upgrade to 4.3 #1375


User avatar
0
Repunjay created
  • ABP Framework version: v4.3.0. The ABP packages were upgraded from 3.0.4 to 4.3.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • After Upgrading to Latest framework 4.3.0 and related Volo.Abp.Identity.EntityFrameworkCore and Volo.Abp.EntityFrameworkCore.PostgreSql, We are facing issues connecting to each table. for every repository call, even if it is not a relationship and plain table, we are getting the following error

Npgsql.PostgresException (0x80004005): 42P01: relation "XXX" does not exist at Npgsql.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|194_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior) at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.Enumerator.InitializeReader(DbContext _, Boolean result) at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.Enumerator.MoveNext() Exception data: Severity: ERROR SqlState: 42P01 MessageText: relation "XXX" does not exist Position: 23 File: parse_relation.c Line: 1180 Routine: parserOpenTable

  • Steps to reproduce the issue:

36 Answer(s)
  • User Avatar
    0
    Repunjay created

    we have shared the bare minimal project without depedencies for you to reproduce the issue locally.

    I can't use the project you shared before, as I said in the meeting, you should provide a project and steps that only depend on the local PostgreSQL database.

    I remember another friend had agreed to do this in the meeting,

    Yes, please check your email. We have just shared the project that depends on local PostgreSQL database. Kindly confirm.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    HI

    I checked the inbox,trash,spam did not receive any mail,

    liming.ma@volosoft.com

  • User Avatar
    0
    Repunjay created

    HI

    I checked the inbox,trash,spam did not receive any mail,

    liming.ma@volosoft.com

    Strange you didn't received it. May be the attachment and network connection could be causing it. Could you please check it after some time and confirm. I'll also try to send it from my personal email address.

  • User Avatar
    0
    Repunjay created

    HI

    I checked the inbox,trash,spam did not receive any mail,

    liming.ma@volosoft.com

    Strange you didn't received it. May be the attachment and network connection could be causing it. Could you please check it after some time and confirm. I'll also try to send it from my personal email address.

    I've resend the email and project from my official (repunjay.soni@ness.com) and personal (repunjaysoni@gmail.com) email addresses. Please check and confirm.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I got your mail I will check it asap. : )

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Here is my steps:

    1. Replace all connection strings with my locally.
    2. Run modules\litmus-core\src\SCV.Litmus.DbMigrator\SCV.Litmus.DbMigrator
    3. Run dotnet ef database update in SCV.Litmus.ProfileManagement.HttpApi.Host project.
    4. Run SCV.Litmus.IdentityServer and SCV.Litmus.ProfileManagement.HttpApi.Host.
    5. Call https://localhost:44398/profile/api/ProfileManagement/sample get success result.
    6. Add a tenant in database.
    7. Then Call https://localhost:44398/profile/api/ProfileManagement/sample get success result.

    @Repunjay Am I miss some steps?

  • User Avatar
    0
    Repunjay created

    hi

    Here is my steps:

    1. Replace all connection strings with my locally.
    2. Run modules\litmus-core\src\SCV.Litmus.DbMigrator\SCV.Litmus.DbMigrator
    3. Run dotnet ef database update in SCV.Litmus.ProfileManagement.HttpApi.Host project.
    4. Run SCV.Litmus.IdentityServer and SCV.Litmus.ProfileManagement.HttpApi.Host.
    5. Call https://localhost:44398/profile/api/ProfileManagement/sample get success result.
    6. Add a tenant in database.
    7. Then Call https://localhost:44398/profile/api/ProfileManagement/sample get success result.

    @Repunjay Am I miss some steps?

    Hi maliming,

    I've sent you an email with detailed steps to reproduce the error and do further debugging. Kindly check and advise.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    The structure of the sql you shared is different from the project I received. Please try to reproduce the problem through the code, you can share the necessary code to create the data. Please keep it simple, thanks.

  • User Avatar
    0
    Repunjay created

    The structure of the sql you shared is different from the project I received.
    Please try to reproduce the problem through the code, you can share the necessary code to create the data. Please keep it simple, thanks.

    I'm not sure how does it prevent you to debug the issue. You can create the Litmus_Lenovo_ProfileManagement database thru code migration by executing "update-database" command and selecting "SCV.Litmus.ProfileManagement.HttpApi.Host" project. Once the DB is created, you can setup one record in Samples table using below query -

    INSERT INTO public."Samples"( "Id", "ExtraProperties", "ConcurrencyStamp", "CreationTime", "CreatorId", "LastModificationTime", "LastModifierId", "IsDeleted", "DeleterId", "DeletionTime", "TenantId", "Value") VALUES ('e42f9b05-2e27-41f4-a562-c1c00cf49d39', '{}', '', '0001-01-01 00:00:00', null, null, null, false, null, null, 'd1be844b-d3a2-031a-f036-39f5d4380239', 123);

    The host database Litmus_Admin and tenant database Litmus_Lenovo_Admin needs to be created thru script as it has the neccessary data and tenant information which is required to reproduce the issue. We cannot create all data thru code.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi @Repunjay

    Our problem may be related to migration, so we shouldn't create the host database Litmus_Admin and tenant database Litmus_Lenovo_Admin through SQL.

    We need use migrations of ef core.

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11