{"record":{"id":"8f05cd1dee0cdce0","repo":"apache/seatunnel","slug":"protocol-error","errorCode":"PROTOCOL_ERROR","errorMessage":"For non-subscription mode, URL must start with http:// or https://","messagePattern":"For non-subscription mode, URL must start with http:// or https://","errorType":"error_code","errorClass":"GraphQLConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-graphql/src/main/java/org/apache/seatunnel/connectors/seatunnel/graphql/util/GraphQLUtil.java","lineNumber":60,"sourceCode":"    private static final Option[] DEFAULT_OPTIONS = {\n        Option.SUPPRESS_EXCEPTIONS, Option.DEFAULT_PATH_LEAF_TO_NULL\n    };\n\n    private static final Configuration jsonConfiguration =\n            Configuration.defaultConfiguration().addOptions(DEFAULT_OPTIONS);\n\n    private static void checkHttpProtocol(String url) {\n        checkProtocol(\n                url,\n                \"http://\",\n                \"https://\",\n                \"For non-subscription mode, URL must start with http:// or https://\");\n    }\n\n    private static void checkProtocol(\n            String url, String prefix, String prefix1, String errorMessage) {\n        if (!url.startsWith(prefix) && !url.startsWith(prefix1)) {\n            throw new GraphQLConnectorException(\n                    GraphQLConnectorErrorCode.PROTOCOL_ERROR, errorMessage);\n        }\n    }\n\n    private static void checkWebSocketProtocol(String url) {\n        checkProtocol(\n                url,\n                \"ws://\",\n                \"wss://\",\n                \"For subscription mode, URL must start with ws:// or wss://\");\n    }\n\n    public static OperationDefinition.Operation parseOperationType(String query) {\n        Document document = new Parser().parseDocument(query);\n        return document.getDefinitionsOfType(OperationDefinition.class).stream()\n                .findFirst()\n                .map(OperationDefinition::getOperation)\n                .orElse(null);","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-graphql/src/main/java/org/apache/seatunnel/connectors/seatunnel/graphql/util/GraphQLUtil.java#L42-L78","documentation":"GraphQLUtil.checkProtocol validates the configured URL scheme before building a reader/writer. In non-subscription mode the URL must start with http:// or https://; otherwise GraphQLConnectorException(PROTOCOL_ERROR) is thrown with this message.","triggerScenarios":"checkHttpProtocol or checkWebSocketProtocol receives a URL lacking the required prefix, e.g. a ws:// URL passed while subscription (enableSubscription) is false.","commonSituations":"User configured a ws:// or wss:// endpoint but did not set subscription mode; URL missing scheme entirely (\"myserver/graphql\"); typos like htp://.","solutions":["Set url to an http:// or https:// endpoint for non-subscription mode","If you intended a websocket endpoint, enable subscription mode in source config","Add the scheme prefix if you omitted it (https://host/graphql)","Fix typos in the scheme"],"exampleFix":"// before\nurl = \"myserver/graphql\"\n// after\nurl = \"https://myserver/graphql\"","handlingStrategy":"validation","validationCode":"function checkUrl(u) { return u.startsWith('http://') || u.startsWith('https://'); }  // for non-subscription mode","typeGuard":"function isHttpUrl(String u) { return u != null && (u.startsWith(\"http://\") || u.startsWith(\"https://\")); }","tryCatchPattern":"try { GraphQLUtil.checkHttpProtocol(url); } catch (GraphQLConnectorException e) { url = \"https://\" + stripScheme(url); }","preventionTips":["Always include the scheme in the url config option","Use wss:// URLs only with subscription mode enabled","Lint config values for scheme prefixes before submit"],"tags":["graphql","config","url","protocol"],"backgroundTag":"invalid-url-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}