-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when getting connection from pool #343
Comments
Have you tried to call dbPool.get with async/await? |
Yes, I've tried in many different ways. With async/await, creating an async function:
And then calling with await:
I got the same error. Putting all operations in separared async functions using promises, like that:
And calling runQuery inside forEach loop, sometimes get the same error. I tried to use the classic attachment mode (attach instead pool.get) and the error persist, then I really think the problem is creating the connections and not the connections pool management. I've already tried to review the node-firebird sources, but I don't have enough knowledge about Firebird connection protocols. I've been having this problem for a long time, but it's bothering me. Off course, we can always check the results and try sending the request again when it fails, but then we'll dealing with the consequences and not the problem source. If you know of any other approach or suggestion that could be used, let me know and let's try it. |
have you tried process.setMaxListeners(0) ? |
Perhaps it is related to this issue: |
I put this line at the start of file:
But unfortunatelly the result was the same. |
This article treats of Firebird's Classic architecture and I am using only the SuperServer architecture. This error can occur due to connections not closing correctly. I'm wondering if it's not a problem with opening/closing connections in the node-firebird. (only on high-load requests). |
And in nodejs how do the debug logs look like, |
After reviewing node-firebird I noticed that when the error occurs, the node-firebird (at line 466 in connection.js) was trying to fallback authentication to Legacy_Auth mode.
Looking at the node-firebird documentation, for Firebird 4 and above, it recommends using "AuthServer = Srp256, Srp, Legacy_Auth" in firebird.conf, and I was using it exactly like that. So I tried reversing the order to "AuthServer = Legacy_Auth, Srp, Srp256" and (to my surprise), everything seems to work fine now, no more aleatory authentication errors. |
I have an express rest api, and sometimes I get a connection error after the requests, then I made an example to reproduce the error.
I would appreciate it if anyone knows how to avoid this error and can share, or confirm if it's really a bug.
I am aware of the asynchronous nature of the example, the position of the error varies, sometimes it is at the beginning, in the middle or at the end, sometimes everything works well. Please, try again if it works at the first time.
(Please, adjust the connection data for your database)
Thanks,
I'm using:
node: v20.15.1
node-firebird: 1.1.9
Output: (It changes each time)
The text was updated successfully, but these errors were encountered: