Skip to content

fix(core): preserve Unix socket SQL config in DbServiceFactory#198

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/dbservice-unix-socket-config
Jul 11, 2026
Merged

fix(core): preserve Unix socket SQL config in DbServiceFactory#198
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/dbservice-unix-socket-config

Conversation

@TDannhauer

@TDannhauer TDannhauer commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix DbServiceFactory::buildConnectionConfig() dropping protocol=unix and forcing localhost:3306, which broke rampage admin pages on PostgreSQL Unix-socket deployments
  • Add unit tests for the config normalization

Motivation

Opening /admin/authentication/provider/ (or any rampage route that resolves PermissionService) on an instance using PostgreSQL over a Unix socket failed with PDOException: SQLSTATE[08006] ... localhost:3306 refused. PermissionServiceFactory resolves its connection through DbServiceFactory, which rebuilt the SQL config from a key whitelist with MySQL TCP defaults instead of preserving the socket settings from conf.php.

Changes

  • buildConnectionConfig() now applies the same normalization as DbAdapterFactory (hostspec -> host, drop driverconfig, default charset) and passes everything else through -- protocol/socket reach the adapter untouched, and no host/port defaults are invented
  • New test: test/Unit/Factory/DbServiceFactoryTest.php

Review follow-up

Split per review: this PR now contains only the SQL topic. The OAuth repository fallback was dropped entirely (see horde/base#134 for the conclusion on that side).

Test plan

  • vendor/bin/phpunit -c phpunit.xml.dist test/Unit/Factory/DbServiceFactoryTest.php
  • Verified PermissionService connects with protocol=unix PostgreSQL config
  • Manual: /horde/admin/authentication/provider/ renders on a PostgreSQL Unix-socket deployment

@ralflang ralflang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please factor out the SQL topic from the OAuth topic into separate PRs. The OAuth topic looks wrong, the SQL topic looks mostly correct.

@TDannhauer TDannhauer force-pushed the fix/dbservice-unix-socket-config branch from 85747aa to a4f924d Compare July 10, 2026 10:52
@TDannhauer

Copy link
Copy Markdown
Contributor Author

Done — the PR is now SQL-only. buildConnectionConfig() mirrors the normalization DbAdapterFactory already applies instead of inventing driver-specific host/port defaults. The OAuth table probe is gone; you were right that it conflated "DB unavailable" with "OAuth not configured" — conclusion on that side is in horde/base#134.

@TDannhauer TDannhauer requested a review from ralflang July 10, 2026 10:59
Ensure the parameter filter doesn't drop unix socket parameters and defaults to localhost tcp/ip connection
@ralflang ralflang force-pushed the fix/dbservice-unix-socket-config branch from a4f924d to e62577d Compare July 11, 2026 08:48
@ralflang ralflang merged commit f035639 into FRAMEWORK_6_0 Jul 11, 2026
1 check 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