{"record":{"id":"3361a440c1c35a1c","repo":"lfnovo/open-notebook","slug":"invalid-url-scheme-parsed-scheme-only-http-a","errorCode":null,"errorMessage":"Invalid URL scheme: '{parsed.scheme}'. Only http and https are allowed.","messagePattern":"Invalid URL scheme: '(.+?)'\\. Only http and https are allowed\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"open_notebook/utils/url_validation.py","lineNumber":73,"sourceCode":"    - AWS's IPv6 metadata address (fd00:ec2::254)\n    - Hostnames that resolve to any of the above\n\n    Args:\n        url: The URL to validate\n        provider: The provider name (for logging/context)\n\n    Raises:\n        ValueError: If the URL is invalid\n    \"\"\"\n    if not url or not url.strip():\n        return  # Empty URLs handled elsewhere\n\n    try:\n        parsed = urlparse(url.strip())\n\n        # Validate scheme - only http/https allowed\n        if parsed.scheme not in (\"http\", \"https\"):\n            raise ValueError(\n                f\"Invalid URL scheme: '{parsed.scheme}'. Only http and https are allowed.\"\n            )\n\n        # Extract hostname\n        hostname = parsed.hostname\n        if not hostname:\n            raise ValueError(\"Invalid URL: hostname could not be determined.\")\n\n        # Try to parse as IP address to check for dangerous addresses\n        try:\n            ip = ipaddress.ip_address(hostname)\n            _reject_dangerous_ip(ip, hostname)\n\n        except ValueError as ve:\n            # Re-raise our own ValueErrors\n            if \"Link-local\" in str(ve) or \"Invalid URL\" in str(ve) or \"metadata\" in str(ve):\n                raise\n            # Not an IP address, it's a hostname - need to resolve and check","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/lfnovo/open-notebook/blob/a7de90d38aaf18ee85fd661854d35c11e44613e2/open_notebook/utils/url_validation.py#L55-L91","documentation":"Error \"Invalid URL scheme: '{parsed.scheme}'. Only http and https are allowed.\" thrown in lfnovo/open-notebook.","triggerScenarios":"Thrown at open_notebook/utils/url_validation.py:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7de90d38aaf18ee85fd661854d35c11e44613e2","analyzedAt":"2026-08-27T02:39:58.166Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}