firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Authentication error / Connection shutdown problems

Open lwennekers opened this issue 2 years ago • 14 comments

First of all I don’t know of this is the correct group to post the issue, but however….

We are using Firebird 4.0.1 with the .net dataprovider 8.5.4 on our application. The application is active on a failover cluster (W2022 Server). We also use the replication engine between the servers. The system was active in a test environment for several weeks and there were no firebird problems detected during that period.

After that we installed the system in a production environment. Also there it was running for more than a week with without any problems.

Suddenly the application was not able to perform database actions anymore and the dataprovider reported an error were it stated that the information on the error could be found in the firebird.log file. This file contained a lot errors with the following lines inside one error:

Authentication error Connection shutdown

There was no other information inside the log file that could give the information on the error. I’ve tried to find some information on this kind of error but I didn’t found it. The only thing I’ve seen that it has something to do with a login procedure and it’s cache and even that I’m not sure of. By the way there were no replication errors.

I know that this is very little information and I’m hoping to find more about those kind of errors so we can exclude those error in the future. So I’m hoping that you could me more information about those errors or perhaps some methods to get more information on such errors.

Thank you already for your help

lwennekers avatar Apr 20 '22 09:04 lwennekers

On 20.04.2022 12:40, lwennekers wrote:

First of all I don’t know of this is the correct group to post the issue, but however….

Sooner of all yes.

Suddenly the application was not able to perform database actions anymore and the dataprovider reported an error were it stated that the information on the error could be found in the firebird.log file. This file contained a lot errors with the following lines inside one error:

Authentication error Connection shutdown

There was no other information inside the log file that could give the information on the error. I’ve tried to find some information on this kind of error but I didn’t found it. The only thing I’ve seen that it has something to do with a login procedure and it’s cache and even that I’m not sure of. By the way there were no replication errors.

I know that this is very little information and I’m hoping to find more about those kind of errors so we can exclude those error in the future. So I’m hoping that you could me more information about those errors or perhaps some methods to get more information on such errors.

Typically that happens when firebird server is shutting down but clients proceed with login attempts. Something interesting in system log?

AlexPeshkoff avatar Apr 20 '22 15:04 AlexPeshkoff

Ok, I can imagine. However the Firebird service was running and there were no lines inside the logging indicating whether the service was stopped and restarted nor inside the windows events logging. So I presume that the service was not stopping at all nor has it been restarted. Are there perhaps other situations where this error message doesn't give an error number? Thanks already for your time.

lwennekers avatar Apr 28 '22 14:04 lwennekers

For security database I see no other abilities - provided you did not enable remote access to it.

With remote access that error also takes place when attachment was deleted from mon$attachments. And even in this case authentication plugin will restore connection to database, i.e. that may happen not more than once per one delete from mon$attachments. Taking into an account that there are lot of 'Connection shutdown' records in firebird.log I highly doubt that this is a case.

AlexPeshkoff avatar Apr 29 '22 12:04 AlexPeshkoff

Remote access wasn't enabled so it should be the thing you were thinking of. I don't have further information for now. If the problem will occur again I will inform you and hopefully we will find more information on the problem. Thanks for now

lwennekers avatar May 03 '22 13:05 lwennekers

The problem seems to be occurred again last week. Exactly the same. No further information for now but I was wondering if our changes inside the firebird.conf file could be of any use for you. firebird4.conf.txt

As stated before we use the .net dataprovider 8.5.4. and perhaps the connectionstring would contain anomalies so therefor our connectionstring

data source=127.0.0.1;initial catalog="C:\Data\Database\W074_SMS.FDB";user id=SYSDBA;password=********;pooling=False;minpoolsize=0;maxpoolsize=1000;packetsize=16384;charset=WIN1252;wire crypt=Enabled;connection lifetime=0;connection timeout=15;port number=3050;command timeout=0 Thanks already in advance for your support

lwennekers avatar May 17 '22 09:05 lwennekers

Additional information: I've 3 other systems which are almost identical as the one described above. They however got one significant difference. The 3 other systems got a client with a permanent connection to Firebird. This is not the case with the system that has the described problems. Perhaps this information can help you further. Thanks in advance and hopefully you can provide me with some information on this issue.

lwennekers avatar May 23 '22 11:05 lwennekers

We had similar problem fixed in https://github.com/FirebirdSQL/firebird/issues/7112, but it's MacOS specific.

We fixed it disabling plugins unload.

In Windows, let's say your code (in case of embedded) or your server configuration loads (LoadLibrary/LoadLibraryEx) some plugin library in not expected way, the bug should happen.

That may happen if you had multiple engines DLLs configured to load the same set of plugins.

asfernandes avatar Jun 25 '22 01:06 asfernandes

On 6/25/22 04:24, Adriano dos Santos Fernandes wrote:

We had similar problem fixed in #7112 https://github.com/FirebirdSQL/firebird/issues/7112, but it's MacOS specific.

We fixed it disabling plugins unload.

In Windows, let's say your code (in case of embedded) or your server configuration loads (LoadLibrary/LoadLibraryEx) some plugin library in not expected way, the bug should happen.

That may happen if you had multiple engines DLLs configured to load the same set of plugins.

Looking at conf file:

AuthClient = Srp, Win_Sspi AuthServer = Srp, Win_Sspi DefaultDbCachePages = 1500 FileSystemCacheThreshold = 2M LockHashSlots = 49999 LockMemSize = 40M ServerMode = SuperClassic TempBlockSize = 2M TempCacheLimit = 3000M UserManager = Srp WireCrypt = Required

It's clear that there are no multiplr engines and taking into an account that there is auth error that's not embedded.

AlexPeshkoff avatar Jun 27 '22 07:06 AlexPeshkoff

Can this https://github.com/FirebirdSQL/firebird/issues/7199 be related? Did you try fresh snapshots?

AlexPeshkoff avatar Jun 27 '22 10:06 AlexPeshkoff

If an UDF or external routine loads (through LoadLibrary/dlopen) some plugin library by any reason, the scenario I mentioned happens.

asfernandes avatar Jun 28 '22 00:06 asfernandes

The high rate attach/detach operations could be in some situations but it should be very rare so I don't know for sure. The 4 systems I got for testing are now disassembled for other purposes so I'm not able to check again. For the same reason I didn't try the snapshot. I'm not able to test it again on short notice. :(

lwennekers avatar Jun 28 '22 05:06 lwennekers

We have the same problem with a few customers also with FB 3.0.6. We got de PBDs and tracket to a issue with "JRD shutdown". The FB (in our case Classic) server hangs when someone disconnects from the server. If we kill the firebird.exe process that holds de JRD Shutdown then everything runs again.

I think one workaround for this problem could be Firebird 4 connection POOL, so less disconnections are generated and less this problem could happen.

Can a firebird.exe process DUMP could help? We don't have one but next time it occurs we can get.

FabianoKureck avatar Aug 15 '22 12:08 FabianoKureck

On 8/15/22 15:53, FabianoKureck wrote:

We have the same problem with a few customers also with FB 3.0.6.

First of all upgrade please...

AlexPeshkoff avatar Aug 15 '22 12:08 AlexPeshkoff

I forgot to tell, we are upgrading all customers to FB 4 (now with 4.0.2). If the problem persists I will tell again. Thanks.

FabianoKureck avatar Aug 15 '22 13:08 FabianoKureck

I have the same problem, but only in 1 of 400 clients. I can't find the origin of the problem yet. The problem still occurs with non TCP connection.

wellington1993 avatar Oct 04 '23 18:10 wellington1993