prestodb/presto · error · PrestoException

INVALID_SESSION_PROPERTY

INVALID_SESSION_PROPERTY

Error message

Unknown connector 

What it means

INVALID_SESSION_PROPERTY PrestoException thrown by SessionPropertyManager.getConnectorSessionPropertyMetadata when no session-property metadata is registered for the given ConnectorId. The manager keeps a map connectorId -> properties; a null or empty map means the connector is unknown to the session property manager, so any lookup for its properties fails.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/metadata/SessionPropertyManager.java:261

        connectorSessionProperties.remove(connectorId);
    }

    public Optional<PropertyMetadata<?>> getSystemSessionPropertyMetadata(String name)
    {
        requireNonNull(name, "name is null");
        if (systemSessionProperties.get(name) == null) {
            return Optional.ofNullable(memoizedWorkerSessionProperties.get().get(name));
        }
        return Optional.ofNullable(systemSessionProperties.get(name));
    }

    public Optional<PropertyMetadata<?>> getConnectorSessionPropertyMetadata(ConnectorId connectorId, String propertyName)
    {
        requireNonNull(connectorId, "connectorId is null");
        requireNonNull(propertyName, "propertyName is null");
        Map<String, PropertyMetadata<?>> properties = connectorSessionProperties.get(connectorId);
        if (properties == null || properties.isEmpty()) {
            throw new PrestoException(INVALID_SESSION_PROPERTY, "Unknown connector " + connectorId);
        }

        return Optional.ofNullable(properties.get(propertyName));
    }

    private Map<String, PropertyMetadata<?>> getWorkerSessionProperties()
    {
        List<PropertyMetadata<?>> workerSessionPropertiesList = workerSessionPropertyProviders.values().stream()
                .flatMap(manager -> manager.getSessionProperties().stream())
                .collect(toImmutableList());
        Map<String, PropertyMetadata<?>> workerSessionProperties = new ConcurrentHashMap<>();
        workerSessionPropertiesList.forEach(sessionProperty -> {
            requireNonNull(sessionProperty, "sessionProperty is null");
            // TODO: Implement fail fast in case of duplicate entries.
            workerSessionProperties.put(sessionProperty.getName(), sessionProperty);
        });
        return workerSessionProperties;
    }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the catalog is configured and loaded on the coordinator (check catalog config properties files)
  2. Use the current ConnectorId for the catalog (connector ids may be versioned, e.g. catalog@version)
  3. Register the connector's session properties via addConnectorSessionProperties before querying them
  4. Restart the cluster/coordinator after adding the catalog so property metadata is registered

Example fix

// before
PropertyMetadata<?> p = sessionPropertyManager.getConnectorSessionPropertyMetadata(new ConnectorId("mycat"), "prop");
// after
ConnectorId id = metadata.getCatalogHandle(session, "mycat").orElseThrow(...);
Optional<PropertyMetadata<?>> p = sessionPropertyManager.getConnectorSessionPropertyMetadata(id, "prop"); // after addConnectorSessionProperties(id, ...)
Defensive patterns

Strategy: validation

Validate before calling

// Verify the catalog exists before touching its session properties
if (!metadata.getCatalogHandle(session, catalogName).isPresent()) {
    throw new IllegalArgumentException("Unknown catalog: " + catalogName);
}

Type guard

boolean connectorKnown(SessionPropertyManager m, ConnectorId id) {
    try { return !m.getConnectorSessionProperties(id).isEmpty(); }
    catch (PrestoException e) { return false; }
}

Try / catch

try {
    Optional<PropertyMetadata<?>> p = manager.getConnectorSessionPropertyMetadata(connectorId, name);
} catch (PrestoException e) {
    if (e.getErrorCode().getCode() == StandardErrorCode.INVALID_SESSION_PROPERTY.getCode()) {
        // re-fetch the ConnectorId via metadata.getCatalogHandle or check catalog config
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling getConnectorSessionPropertyMetadata (directly or via property()/propertyMetadata()) with a ConnectorId that was never registered via addConnectorSessionProperties, or a connectorId that was removed/renamed (e.g. after catalog redeploy with a new versioned connector id).

Common situations: Accessing session properties of a catalog that failed to start or was dropped; stale cached ConnectorId from before a coordinator restart; catalogs configured on workers but not registered on the coordinator path executing the code.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/ef9c619af2899c71. Report an issue: GitHub.