Skip to content

fix: wrong hana single tenant credential connection loop#1680

Open
kasimos wants to merge 1 commit into
cap-js:mainfrom
kasimos:fixHanaAuthLoop
Open

fix: wrong hana single tenant credential connection loop#1680
kasimos wants to merge 1 commit into
cap-js:mainfrom
kasimos:fixHanaAuthLoop

Conversation

@kasimos

@kasimos kasimos commented Jul 14, 2026

Copy link
Copy Markdown

Addresses Ticket #1679

Now auth errors in single tenant hana connections will be logged in the debug log and throw an appropriate error, thereby no longer running into a loop and locking the db user

Comment thread hana/lib/HANAService.js
Comment on lines +62 to 67
if (err.code === 10) {
// authentication error
LOG.debug('connection failed:', err)
throw new Error(`Pool failed connecting`, { cause: err })
}
if (attempt < maxRetries) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (err.code === 10) {
// authentication error
LOG.debug('connection failed:', err)
throw new Error(`Pool failed connecting`, { cause: err })
}
if (attempt < maxRetries) {
if (err.code !== 10 && attempt < maxRetries) {

I think the error just needs to bubble up. There's no need to log or wrap it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works except for the initial connection when starting a CAP app. There the proposed change will throw:
"[queue] - Failed to fetch targets for flush Error: Pool resource could not be acquired within 10s"
For requests that are after that hitting the service it will correctly show: "[odata] - 500 - SqlError {message: "authentication failed..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants