SimpleIdServer icon indicating copy to clipboard operation
SimpleIdServer copied to clipboard

v6.0.1 Problem was discovered

Open qq1176914912 opened this issue 9 months ago • 9 comments

Hello, I downloaded the latest project of your master branch. When I changed the database to POSTGRE and used an empty database, when starting the project, the table creation failed: Image An error will occur if the table creation has not started after startup: Image After starting the creation, an error will still occur: Image Then I created all the tables using the project of v5.0.4-rc1. When I started the project of v6.0.1 again, an error still occurred:

Image

Image

qq1176914912 avatar May 07 '25 01:05 qq1176914912

I changed the database type to INMEMORY. The project could start, but when accessing 5002 and clicking to log in, an error occurred:

view.zip

qq1176914912 avatar May 07 '25 01:05 qq1176914912

2、 I tried to check the new features of acrs and registration on your official website, but when I opened it, it was blank. F12 found that it kept reporting errors, and the same was true for registration Image

qq1176914912 avatar May 07 '25 03:05 qq1176914912

Hello,

Since version 6.0.1, the ClientType column is now an integer instead of a string. Therefore, a pre-deployment script must be executed to convert the ClientType string values into their corresponding integer representations.

The NpgsqlConnector exception is thrown because the ClientTypeDataSeeder class cannot convert the string value of ClientType into an integer—most likely because the client-type field has been translated.

Could you please execute an SQL script to update the client-type to the correct enumeration value, or alternatively, set the client-type to 0?

public enum ClientTypes
{
    SPA = 0,
    MACHINE = 1,
    WEBSITE = 2,
    MOBILE = 3,
    EXTERNAL = 4,
    WALLET = 5,
    DEVICE = 6,
    HIGHLYSECUREDWEBSITE = 7,
    GRANTMANAGEMENT = 8,
    SAML = 9,
    CREDENTIALISSUER = 10,
    FEDERATION = 11,
    WSFEDERATION = 12
}

Unfortunately, authentication is currently not working because the lib.js JavaScript file is not correctly referenced. To fix this, open the solution, edit the Views\Shared\_FormBuilderLayout.cshtml file, and replace the text FormBuilder with SidFormBuilder.

This issue has already been resolved in the release/v6.0.2 branch.

KR,

SID

simpleidserver avatar May 07 '25 12:05 simpleidserver

Hello,

Since version 6.0.1, the ClientType column is now an integer instead of a string. Therefore, a pre-deployment script must be executed to convert the ClientType string values into their corresponding integer representations.

The NpgsqlConnector exception is thrown because the ClientTypeDataSeeder class cannot convert the string value of ClientType into an integer—most likely because the client-type field has been translated.

Could you please execute an SQL script to update the client-type to the correct enumeration value, or alternatively, set the client-type to 0?

public enum ClientTypes
{
    SPA = 0,
    MACHINE = 1,
    WEBSITE = 2,
    MOBILE = 3,
    EXTERNAL = 4,
    WALLET = 5,
    DEVICE = 6,
    HIGHLYSECUREDWEBSITE = 7,
    GRANTMANAGEMENT = 8,
    SAML = 9,
    CREDENTIALISSUER = 10,
    FEDERATION = 11,
    WSFEDERATION = 12
}

Unfortunately, authentication is currently not working because the lib.js JavaScript file is not correctly referenced. To fix this, open the solution, edit the Views\Shared\_FormBuilderLayout.cshtml file, and replace the text FormBuilder with SidFormBuilder.

This issue has already been resolved in the release/v6.0.2 branch.

KR,

SID

1、Thank you for your reply. My understanding is that the operation of executing the sql statement to change the "ClientType" type should apply to the existing database tables. But as I said before, I have an empty database with no tables in it. An error occurred during the automatic table creation process. This should be abnormal, right? I set a breakpoint in the ClientTypeDataSeeder class and found that this method was not entered during the process of creating the table.

2、I created the table using 5.0.4 and then modified the type through the following sql statement:

SET "ClientType" = CASE "ClientType"
    WHEN 'SPA' THEN '0'
    WHEN 'MACHINE' THEN '1'
    WHEN 'WEBSITE' THEN '2'
    WHEN 'MOBILE' THEN '3'
    WHEN 'EXTERNAL' THEN '4'
    WHEN 'WALLET' THEN '5'
    WHEN 'DEVICE' THEN '6'
    WHEN 'HIGHLYSECUREDWEBSITE' THEN '7'
    WHEN 'GRANTMANAGEMENT' THEN '8'
    WHEN 'SAML' THEN '9'
    WHEN 'CREDENTIALISSUER' THEN '10'
    WHEN 'FEDERATION' THEN '11'
    WHEN 'WSFEDERATION' THEN '12'
    ELSE NULL 
END;
ALTER TABLE "Clients"
ALTER COLUMN "ClientType" TYPE INT USING ("ClientType"::INT);

After the modification is completed, when I start the 6.0.1 project and use the modified library, an error will be reported: I don't know if there is a problem with my operation or if there is a problem with the compatibility of the new version with the old library

Image

Image

qq1176914912 avatar May 08 '25 01:05 qq1176914912

3、I downloaded your 6.0.2 branch and set the database type to "INMEMORY". After starting the project and accessing 5002, there was a problem displayed on the page

Image

Image

Image

qq1176914912 avatar May 08 '25 01:05 qq1176914912

  1. Migration issue: The migration works correctly with SQL Server, MySQL, and SQLite, but not with PostgreSQL. This issue has been fixed in the release/v6.0.2 branch.
  2. UI issue: The problem with the UI has also been fixed in the release/v6.0.2 branch.

simpleidserver avatar May 08 '25 12:05 simpleidserver

Image When I run samples IdserverPostgre will encouter this issue. @simpleidserver

littlesmilelove avatar Jun 08 '25 06:06 littlesmilelove

Hello,

There is indeed a mistake in the documentation and samples. The MigrationAssembly for the FormBuilder is incorrect. Could you please replace the code with something like this?

const string connectionString = "";
...
.AddDeveloperSigningCredential()
.UseEfStore(e =>
{
    e.UseNpgsql(connectionString, o =>
    {
        o.MigrationsAssembly("SimpleIdServer.IdServer.PostgreMigrations");
        o.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
    });
}, e =>
{
    e.UseNpgsql(connectionString, o =>
    {
        o.MigrationsAssembly("SidFormBuilder.PostgreMigrations");
        o.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
    });
})

The documentation and samples have been corrected in the release/v6.0.3 branch.

KR,

SID

simpleidserver avatar Jun 10 '25 12:06 simpleidserver

Thank you for your answer, it works now. @simpleidserver

littlesmilelove avatar Jun 10 '25 14:06 littlesmilelove