Thread: Compatibility Issues with Npgsql and .NET Framework 3.5 after Upgrading to PostgreSQL 16.3

Dear PostgreSQL Community,

After upgrading PostgreSQL to version 16.3, our server encountered the error
"Only AuthenticationClearTextPassword and AuthenticationMD5Password supported for now. Received: 10" when connecting to
thedatabase. 

We are currently using .NET Framework version 3.5. If we upgrade Npgsql to version 8.0.5, will there be compatibility
issues? 
If there are compatibility issues, could you tell me the minimum version of Npgsql that we should use to upgrade
PostgreSQLto 16.3 without upgrading the .NET Framework? 

Looking forward to your reply.

Best regards,
Coder Ma



> On 25 Oct 2024, at 05:45, 馬 騰飛 <ma-tengfei@nec.cn> wrote:
>
> Dear PostgreSQL Community,
>
> After upgrading PostgreSQL to version 16.3, our server encountered the error
> "Only AuthenticationClearTextPassword and AuthenticationMD5Password supported for now. Received: 10" when connecting
tothe database. 
>
> We are currently using .NET Framework version 3.5. If we upgrade Npgsql to version 8.0.5, will there be compatibility
issues? 
> If there are compatibility issues, could you tell me the minimum version of Npgsql that we should use to upgrade
PostgreSQLto 16.3 without upgrading the .NET Framework? 

Try PostgreSQL 16.4 instead, there was a known regression for very old Npgsql
versions in 16.3.

--
Daniel Gustafsson




Thank you very much for your reply. 
However, after installing PostgreSQL 16.4, our server still encounters the following error when connecting to the
database,just like with version 16.3:
 
“Only AuthenticationClearTextPassword and AuthenticationMD5Password supported for now. Received: 10”.
Could you please advise how to resolve this error? Should we also update Npgsql? If Npgsql needs to be updated, to
whichversion should we update it?
 
Looking forward to your response.

-----Original Message-----
From: Daniel Gustafsson <daniel@yesql.se> 
Sent: Friday, October 25, 2024 7:58 PM
To: 馬 騰飛 <ma-tengfei@nec.cn>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Compatibility Issues with Npgsql and .NET Framework 3.5 after Upgrading to PostgreSQL 16.3

CAUTION:This is an external email. Please be cautious when opening links or attachments in email.



> On 25 Oct 2024, at 05:45, 馬 騰飛 <ma-tengfei@nec.cn> wrote:
>
> Dear PostgreSQL Community,
>
> After upgrading PostgreSQL to version 16.3, our server encountered the 
> error "Only AuthenticationClearTextPassword and AuthenticationMD5Password supported for now. Received: 10" when
connectingto the database.
 
>
> We are currently using .NET Framework version 3.5. If we upgrade Npgsql to version 8.0.5, will there be compatibility
issues?
> If there are compatibility issues, could you tell me the minimum version of Npgsql that we should use to upgrade
PostgreSQLto 16.3 without upgrading the .NET Framework?
 

Try PostgreSQL 16.4 instead, there was a known regression for very old Npgsql versions in 16.3.

--
Daniel Gustafsson


> On 29 Oct 2024, at 04:25, 馬 騰飛 <ma-tengfei@nec.cn> wrote:
>
> Thank you very much for your reply.
> However, after installing PostgreSQL 16.4, our server still encounters the following error when connecting to the
database,just like with version 16.3: 
> “Only AuthenticationClearTextPassword and AuthenticationMD5Password supported for now. Received: 10”.
> Could you please advise how to resolve this error? Should we also update Npgsql? If Npgsql needs to be updated, to
whichversion should we update it? 

I don't know the first thing about Npgsql so I can't offer any advice, but it
sounds like the problems is that the server wants to use SCRAM passwords and
your version of npgsql only support cleartext and md5.  Changing the METHOD in
pg_hba.conf to md5 could fix the immediate problem perhaps but upgrading to a
version that support SCRAM seems the most appropriate (especially since md5
passwords are likely going away soon).

--
Daniel Gustafsson




On 10/29/24 04:01, Daniel Gustafsson wrote:
>> On 29 Oct 2024, at 04:25, 馬 騰飛 <ma-tengfei@nec.cn> wrote:
>>
>> Thank you very much for your reply.
>> However, after installing PostgreSQL 16.4, our server still encounters the following error when connecting to the
database,just like with version 16.3:
 
>> “Only AuthenticationClearTextPassword and AuthenticationMD5Password supported for now. Received: 10”.
>> Could you please advise how to resolve this error? Should we also update Npgsql? If Npgsql needs to be updated, to
whichversion should we update it?
 
> 
> I don't know the first thing about Npgsql so I can't offer any advice, but it
> sounds like the problems is that the server wants to use SCRAM passwords and
> your version of npgsql only support cleartext and md5.  Changing the METHOD in
> pg_hba.conf to md5 could fix the immediate problem perhaps but upgrading to a
> version that support SCRAM seems the most appropriate (especially since md5
> passwords are likely going away soon).

Potential issue with above per:

https://www.postgresql.org/docs/current/auth-password.html

"To ease transition from the md5 method to the newer SCRAM method, if 
md5 is specified as a method in pg_hba.conf but the user's password on 
the server is encrypted for SCRAM (see below), then SCRAM-based 
authentication will automatically be chosen instead."

Therefore a roles password could still be in SCRAM. You would need to 
change the actual passwords also.


According to the issue below Npgsql supports SCRAM:

https://github.com/npgsql/npgsql/issues/5593

Which translates into Npgsql 3.2.7:

https://github.com/npgsql/npgsql/releases/tag/v3.2.7

> 
> --
> Daniel Gustafsson
> 
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Thank you very much for your response.
After changing the "password_encryption" option to "md5" in the postgresql.conf file, the server can now successfully
connectto the database.
 
Thanks again for your help.

-----Original Message-----
From: Adrian Klaver <adrian.klaver@aklaver.com> 
Sent: Wednesday, October 30, 2024 12:06 AM
To: Daniel Gustafsson <daniel@yesql.se>; 馬 騰飛 <ma-tengfei@nec.cn>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Compatibility Issues with Npgsql and .NET Framework 3.5 after Upgrading to PostgreSQL 16.3

CAUTION:This is an external email. Please be cautious when opening links or attachments in email.



On 10/29/24 04:01, Daniel Gustafsson wrote:
>> On 29 Oct 2024, at 04:25, 馬 騰飛 <ma-tengfei@nec.cn> wrote:
>>
>> Thank you very much for your reply.
>> However, after installing PostgreSQL 16.4, our server still encounters the following error when connecting to the
database,just like with version 16.3:
 
>> “Only AuthenticationClearTextPassword and AuthenticationMD5Password supported for now. Received: 10”.
>> Could you please advise how to resolve this error? Should we also update Npgsql? If Npgsql needs to be updated, to
whichversion should we update it?
 
>
> I don't know the first thing about Npgsql so I can't offer any advice, 
> but it sounds like the problems is that the server wants to use SCRAM 
> passwords and your version of npgsql only support cleartext and md5.  
> Changing the METHOD in pg_hba.conf to md5 could fix the immediate 
> problem perhaps but upgrading to a version that support SCRAM seems 
> the most appropriate (especially since md5 passwords are likely going away soon).

Potential issue with above per:

https://www.postgresql.org/docs/current/auth-password.html

"To ease transition from the md5 method to the newer SCRAM method, if
md5 is specified as a method in pg_hba.conf but the user's password on the server is encrypted for SCRAM (see below),
thenSCRAM-based authentication will automatically be chosen instead."
 

Therefore a roles password could still be in SCRAM. You would need to change the actual passwords also.


According to the issue below Npgsql supports SCRAM:

https://github.com/npgsql/npgsql/issues/5593

Which translates into Npgsql 3.2.7:

https://github.com/npgsql/npgsql/releases/tag/v3.2.7

>
> --
> Daniel Gustafsson
>
>
>

--
Adrian Klaver
adrian.klaver@aklaver.com