{"record":{"id":"ee7d0868dcfc3912","repo":"apache/shardingsphere","slug":"unknown-stream-channel-type-s","errorCode":null,"errorMessage":"Unknown stream channel type `%s`.","messagePattern":"Unknown stream channel type `(.+?)`\\.","errorType":"exception","errorClass":"PipelineInvalidParameterException","httpStatus":null,"severity":"error","filePath":"kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/distsql/handler/transmission/update/AlterTransmissionRuleExecutor.java","lineNumber":50,"sourceCode":"import org.apache.shardingsphere.distsql.segment.TransmissionRuleSegment;\nimport org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;\nimport org.apache.shardingsphere.infra.instance.metadata.InstanceType;\nimport org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;\nimport org.apache.shardingsphere.mode.manager.ContextManager;\n\n/**\n * Alter transmission rule executor.\n */\npublic final class AlterTransmissionRuleExecutor implements DistSQLUpdateExecutor<AlterTransmissionRuleStatement> {\n    \n    private final PipelineProcessConfigurationPersistService processConfigPersistService = new PipelineProcessConfigurationPersistService();\n    \n    @Override\n    public void executeUpdate(final AlterTransmissionRuleStatement sqlStatement, final ContextManager contextManager) {\n        PipelineProcessConfiguration processConfig = convertToProcessConfiguration(sqlStatement.getProcessConfigSegment());\n        AlgorithmConfiguration streamChannel = processConfig.getStreamChannel();\n        if (null != streamChannel && !TypedSPILoader.findService(PipelineChannelCreator.class, streamChannel.getType()).isPresent()) {\n            throw new PipelineInvalidParameterException(\"Unknown stream channel type `\" + streamChannel.getType() + \"`.\");\n        }\n        String jobType = TypedSPILoader.getService(PipelineJobType.class, sqlStatement.getJobTypeName()).getType();\n        processConfigPersistService.persist(new PipelineContextKey(InstanceType.PROXY), jobType, processConfig);\n    }\n    \n    private PipelineProcessConfiguration convertToProcessConfiguration(final TransmissionRuleSegment segment) {\n        return new PipelineProcessConfiguration(\n                convertToReadConfiguration(segment.getReadSegment()), convertToWriteConfiguration(segment.getWriteSegment()), convertToAlgorithm(segment.getStreamChannel()));\n    }\n    \n    private PipelineReadConfiguration convertToReadConfiguration(final ReadOrWriteSegment readSegment) {\n        return null == readSegment\n                ? null\n                : new PipelineReadConfiguration(readSegment.getWorkerThread(), readSegment.getBatchSize(), readSegment.getShardingSize(), convertToAlgorithm(readSegment.getRateLimiter()));\n    }\n    \n    private PipelineWriteConfiguration convertToWriteConfiguration(final ReadOrWriteSegment writeSegment) {\n        return null == writeSegment ? null : new PipelineWriteConfiguration(writeSegment.getWorkerThread(), writeSegment.getBatchSize(), convertToAlgorithm(writeSegment.getRateLimiter()));","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/distsql/handler/transmission/update/AlterTransmissionRuleExecutor.java#L32-L68","documentation":"ALTER TRANSMISSION RULE validates the stream channel algorithm segment before persisting process configuration. It loads PipelineChannelCreator via TypedSPILoader by the configured type string; if no SPI implementation is registered under that name, findService returns empty and a PipelineInvalidParameterException is thrown with the offending type name.","triggerScenarios":"Executing ALTER TRANSMATION RULE ... with a STREAM CHANNEL clause whose type (e.g. 'mymemory', 'netty', custom name) is not a registered PipelineChannelCreator SPI. Also when the JDBC driver class needed by a channel implementation is missing from the proxy classpath so the SPI fails to load.","commonSituations":"Typos in the channel type; writing a custom stream channel SPI and forgetting to register it in META-INF/services (or the new ServiceLoader metadata) inside the proxy lib directory; copying a rule from docs of a different ShardingSphere version where the bundled channel set differs.","solutions":["Use a built-in stream channel type shipped with the distribution (e.g. MEMORY); check available types via SHOW TRANSMISSION RULE / documentation for your version.","Fix typos in the STREAM CHANNEL type string.","For custom channels: implement PipelineChannelCreator, register it in the SPI metadata file, and place the jar in the proxy's lib directory before restarting.","Ensure the JDBC driver required by the channel exists in the proxy lib directory."],"exampleFix":"-- before\nALTER TRANSMISSION RULE ... STREAM CHANNEL(NAME='mymemory');\n-- after\nALTER TRANSMISSION RULE ... STREAM CHANNEL(NAME='memory');","handlingStrategy":"validation","validationCode":"// Before ALTER TRANSMISSION RULE, confirm the channel type is resolvable\nboolean known = TypedSPILoader.findService(PipelineChannelCreator.class, \"memory\").isPresent();\nif (!known) { throw new IllegalArgumentException(\"stream channel type not available\"); }","typeGuard":null,"tryCatchPattern":"try {\n    proxy.execute(\"ALTER TRANSMISSION RULE ...\");\n} catch (final PipelineInvalidParameterException ex) {\n    // check message for unknown type, then SHOW TRANSMISSION RULE to list valid config\n}","preventionTips":["Use channel types documented for your exact ShardingSphere version.","Place custom SPI jars and their SPI registration files in proxy lib before issuing DistSQL.","Copy rule syntax from the version-matched documentation."],"tags":["distsql","transmission","spi","configuration"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}