{"record":{"id":"dadd3f8e3cc95e89","repo":"langchain-ai/deepagents","slug":"remote-source-must-be-an-absolute-https-url","errorCode":null,"errorMessage":"remote source must be an absolute HTTPS URL","messagePattern":"remote source must be an absolute HTTPS URL","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/configuration/types.py","lineNumber":77,"sourceCode":"    from urllib.parse import urlsplit\n\n    if len(source) > REMOTE_SOURCE_MAX_CHARS:\n        msg = \"remote source is too long\"\n        raise ValueError(msg)\n    if any(char.isspace() or not char.isprintable() for char in source):\n        msg = \"remote source must not contain whitespace or control characters\"\n        raise ValueError(msg)\n    try:\n        parsed = urlsplit(source)\n    except ValueError as exc:\n        msg = \"remote source is not a valid URL\"\n        raise ValueError(msg) from exc\n    if not source.isascii():\n        msg = \"remote source must contain only ASCII URI characters\"\n        raise ValueError(msg)\n    if parsed.scheme.lower() != \"https\" or not parsed.hostname:\n        msg = \"remote source must be an absolute HTTPS URL\"\n        raise ValueError(msg)\n    if parsed.username is not None or parsed.password is not None:\n        msg = \"remote source must not contain credentials\"\n        raise ValueError(msg)\n    if parsed.query or parsed.fragment:\n        msg = \"remote source must not contain a query string or fragment\"\n        raise ValueError(msg)\n    try:\n        port = parsed.port\n    except ValueError as exc:\n        msg = \"remote source has an invalid port\"\n        raise ValueError(msg) from exc\n    host = parsed.hostname.rstrip(\".\")\n    netloc = f\"[{host}]\" if \":\" in host else host\n    if port is not None:\n        netloc = f\"{netloc}:{port}\"\n    return parsed._replace(scheme=\"https\", netloc=netloc).geturl()\n\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/configuration/types.py#L59-L95","documentation":"This ValueError is raised by `_validate_remote_source_url` in deepagents_code/configuration/types.py when a remote source URL fails to parse as an absolute HTTPS URL. The library requires remote provider/config sources to be plain https:// URLs with a hostname so they can be fetched safely and unambiguously; anything else (http, bare hosts, relative paths) is rejected at dataclass construction time via `__post_init__`.","triggerScenarios":"Constructing a dataclass (e.g. a remote provider/remote_source descriptor) whose __post_init__ calls _validate_remote_source_url with a source that is not 'https' scheme or has no hostname: e.g. 'http://example.com/src.toml', 'example.com/src.toml', 'ftp://example.com/x', or a URL whose scheme was mangled ('https:example.com' with empty hostname).","commonSituations":"Typing 'http://' instead of 'https://' in a config file; pasting a URL without scheme ('example.com/config.toml'); hand-building the remote source from an env var that lost its scheme; using a file path or git URL where an HTTPS URL is expected.","solutions":["Use a fully qualified HTTPS URL with a hostname, e.g. 'https://example.com/path/config.toml'","Add the missing 'https://' scheme if you passed a bare host","If the server only supports HTTP, serve the source over HTTPS instead; plain HTTP is not accepted","Verify the value comes from the correct env/config key and was not truncated"],"exampleFix":"// before\nRemoteSource(source=\"http://example.com/config.toml\")\n// after\nRemoteSource(source=\"https://example.com/config.toml\")","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse\n\ndef is_valid_remote_source(source: str) -> bool:\n    parsed = urlparse(source)\n    return parsed.scheme.lower() == \"https\" and bool(parsed.hostname)\n\n# call before constructing\nif not is_valid_remote_source(src):\n    src = f\"https://{src}\"  # or surface a config error","typeGuard":"def is_https_url(value: object) -> bool:\n    if not isinstance(value, str) or not value.isascii():\n        return False\n    parsed = urlparse(value)\n    return parsed.scheme.lower() == \"https\" and bool(parsed.hostname)","tryCatchPattern":"try:\n    RemoteSource(source=src)\nexcept ValueError as exc:\n    logger.error(\"invalid remote source %r: %s\", src, exc)\n    raise ConfigError(f\"remote source {src!r} must be an absolute HTTPS URL\") from exc","preventionTips":["Always include the https:// scheme in config values; never accept bare hosts","Lint config files for scheme before deployment","Validate env-sourced URLs at startup, not deep in the run"],"tags":["validation","configuration","url","https"],"backgroundTag":"invalid-remote-source-url","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}