{"record":{"id":"9500c7a0059f6e4e","repo":"prestodb/presto","slug":"procedure-not-found-9500c7","errorCode":"PROCEDURE_NOT_FOUND","errorMessage":"Distributed procedure not registered: ","messagePattern":"Distributed procedure not registered: ","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java","lineNumber":1536,"sourceCode":"        protected Scope visitCall(Call call, Optional<Scope> scope)\n        {\n            if (analysis.isDescribe()) {\n                return createAndAssignScope(call, scope);\n            }\n            Optional<QualifiedObjectName> procedureNameOptional = analysis.getProcedureName();\n            QualifiedObjectName procedureName;\n            if (!procedureNameOptional.isPresent()) {\n                procedureName = createQualifiedObjectName(session, call, call.getName(), metadata);\n                analysis.setProcedureName(Optional.of(procedureName));\n            }\n            else {\n                procedureName = procedureNameOptional.get();\n            }\n            ConnectorId connectorId = metadata.getCatalogHandle(session, procedureName.getCatalogName())\n                    .orElseThrow(() -> new SemanticException(MISSING_CATALOG, call, \"Catalog %s does not exist\", procedureName.getCatalogName()));\n\n            if (!metadata.getProcedureRegistry().isDistributedProcedure(connectorId, toSchemaTableName(procedureName))) {\n                throw new SemanticException(PROCEDURE_NOT_FOUND, \"Distributed procedure not registered: \" + procedureName);\n            }\n            DistributedProcedure procedure = metadata.getProcedureRegistry().resolveDistributed(connectorId, toSchemaTableName(procedureName));\n            Object[] values = extractParameterValuesInOrder(call, procedure, metadata, session, analysis.getParameters());\n            accessControl.checkCanCallProcedure(session.getRequiredTransactionId(), session.getIdentity(), session.getAccessControlContext(), procedureName);\n\n            analysis.setUpdateInfo(call.getUpdateInfo());\n            DistributedProcedure.DistributedProcedureType procedureType = procedure.getType();\n            switch (procedureType) {\n                case TABLE_DATA_REWRITE:\n                    TableDataRewriteDistributedProcedure tableDataRewriteDistributedProcedure = (TableDataRewriteDistributedProcedure) procedure;\n                    QualifiedName qualifiedName = QualifiedName.of(tableDataRewriteDistributedProcedure.getSchema(values), tableDataRewriteDistributedProcedure.getTableName(values));\n                    QualifiedObjectName tableName = createQualifiedObjectName(session, call, qualifiedName, metadata);\n\n                    analysis.addAccessControlCheckForTable(\n                            TABLE_INSERT,\n                            new AccessControlInfoForTable(\n                                    accessControl,\n                                    session.getIdentity(),","sourceCodeStart":1518,"sourceCodeEnd":1554,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java#L1518-L1554","documentation":"CALL statements can target either connector-local procedures or distributed procedures. When the statement resolves to a distributed procedure invocation, the analyzer asks the ProcedureRegistry whether the connector has registered that procedure; if not, it raises PROCEDURE_NOT_FOUND with the procedure name appended to a static message string.","triggerScenarios":"Executing a CALL <catalog>.<schema>.<proc>(...) that is treated as a distributed procedure while metadata.getProcedureRegistry().isDistributedProcedure(connectorId, name) returns false — i.e., the connector never registered that procedure as distributed (or registered it only as a local procedure, or not at all).","commonSituations":"Calling a system-style procedure (e.g., sync/expire/compaction) against a connector version that does not implement it; misspelled procedure name; procedure exists in a newer connector release than the deployed coordinator; calling on the wrong catalog whose connector lacks the procedure.","solutions":["Verify the exact procedure name and signature in the connector's documentation and correct the CALL statement.","Upgrade the connector/coordinator to a version that registers the distributed procedure.","Point the CALL at the correct catalog whose connector supports the procedure.","If the connector offers the operation only as a local procedure, use its supported invocation form instead of the distributed one."],"exampleFix":"// before (connector lacks distributed expire_procedure)\nCALL iceberg.system.expire_snapshots('db.t', TIMESTAMP '2026-01-01');\n// after: upgrade connector, or use supported local form\nCALL iceberg.system.expire_snapshots(schema_name => 'db', table_name => 't', older_than => TIMESTAMP '2026-01-01');","handlingStrategy":"try-catch","validationCode":"boolean registered = (boolean) query(\"SELECT count(*) > 0 FROM system.metadata.procedures \" +\n    \"WHERE procedure_name = ? AND catalog_name = ?\", procName, catalog).get(0).get(0);\nif (!registered) throw new IllegalArgumentException(\"Procedure not available on catalog \" + catalog);","typeGuard":null,"tryCatchPattern":"try {\n    execute(callSql);\n} catch (SemanticException e) {\n    if (e.getCode() == PROCEDURE_NOT_FOUND) {\n        log.error(\"Distributed procedure {} not registered on this connector; check version/catalog\", callSql);\n        throw new UnsupportedOperationException(\"Procedure unavailable in deployed connector\", e);\n    }\n    throw e;\n}","preventionTips":["List available procedures via system.metadata.procedures for the target catalog before calling.","Pin coordinator/connector versions so procedure availability matches the SQL you ship.","Spell procedure names from documentation verbatim, including catalog qualifier."],"tags":["presto","call-statement","procedure","connector"],"backgroundTag":"procedure-not-found","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}