microsoft/semantic-kernel · critical · MemoryConnectorConnectionException
Error creating Oracle connection pool.
Error message
Error creating Oracle connection pool.
What it means
Thrown by OracleSettings.create_connection_pool when oracledb.create_pool_async raises any exception (bad credentials, unreachable DSN, invalid wallet, bad pool params). The original error is chained as __cause__ for diagnostics.
Source
Thrown at python/semantic_kernel/connectors/oracle.py:265
async def create_connection_pool(self, **kwargs: Any) -> oracledb.AsyncConnectionPool:
"""Creates an async Oracle connection pool."""
try:
# Create pool with extra user-supplied kwargs
self._connection_pool = oracledb.create_pool_async(
user=self.user,
password=self.password.get_secret_value() if self.password else None,
dsn=self.connection_string,
wallet_location=self.wallet_location,
wallet_password=self.wallet_password.get_secret_value() if self.wallet_password else None,
min=self.min,
max=self.max,
increment=self.increment,
**kwargs, # extra pool params
)
except Exception as err:
raise MemoryConnectorConnectionException("Error creating Oracle connection pool.") from err
return self._connection_pool
# region: Oracle Collections
@release_candidate
class OracleCollection(
VectorStoreCollection[TKey, TModel],
VectorSearch[TKey, TModel],
Generic[TKey, TModel],
):
"""Oracle implementation of VectorStoreCollection + VectorSearch."""
connection_pool: oracledb.AsyncConnectionPool | None = None
db_schema: str | None = None
pool_args: dict[str, Any] | None = NoneView on GitHub (pinned to c028a0c7dc)
Solutions
- Verify ORACLE_USER, ORACLE_PASSWORD, and ORACLE_CONNECTION_STRING are correct and the host:port is reachable
- Inspect the chained exception (raise ... from err) - check exc.__cause__ for the real oracledb error
- Test connectivity independently with oracledb or sqlplus using the same DSN/credentials
- Validate wallet_location/wallet_password if using wallet-based auth
- Ensure pool params are valid: min <= max, increment >= 1
Defensive patterns
Strategy: try-catch
Validate before calling
import oracledb
def can_connect(user, password, dsn) -> bool:
try:
with oracledb.connect(user=user, password=password, dsn=dsn) as conn:
return conn.ping() is None or True
except oracledb.Error:
return False
# run before create_connection_pool Try / catch
from semantic_kernel.exceptions import MemoryConnectorConnectionException
try:
pool = await settings.create_connection_pool()
except MemoryConnectorConnectionException as e:
cause = e.__cause__ # the real oracledb error
logger.error('Pool creation failed: %s', cause)
raise Prevention
- Validate ORACLE_* env vars and DSN reachability before starting the app
- Always inspect the chained __cause__ for the underlying oracledb error
- Keep min <= max and increment >= 1 in pool params
- Use a Secrets manager for credentials rather than hardcoding
When it happens
Trigger: Wrong ORACLE_USER/ORACLE_PASSWORD; unreachable ORACLE_CONNECTION_STRING (network/firewall on port 1521); missing or invalid wallet_location/wallet_password; invalid pool params (min > max, negative increment).
Common situations: Env vars not set or mis-scoped; DSN typo; firewall blocking the DB port; wallet misconfigured for mTLS; ORACLE_POOL_MIN > ORACLE_POOL_MAX.
Related errors
- Collection has no connection pool.
- Failed to create Azure OpenAI settings: {exc}
- Please provide an Azure OpenAI endpoint
- Please provide an Azure OpenAI deployment name
- Agent Failure - No agents present to select.
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/5974a416e010de5e.
Report an issue: GitHub.