{"record":{"id":"4570ba7fee95b7e8","repo":"invoke-ai/InvokeAI","slug":"the-http-logging-module-can-only-log-to-http-urls","errorCode":null,"errorMessage":"the http logging module can only log to HTTP URLs, but {url.scheme} was specified","messagePattern":"the http logging module can only log to HTTP URLs, but (.+?) was specified","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/util/logging.py","lineNumber":422,"sourceCode":"                    syslog_args[\"address\"] = arg_name\n        except Exception:\n            raise ValueError(f\"{args} is not a value argument list for syslog logging\")\n        return logging.handlers.SysLogHandler(**syslog_args)\n\n    @staticmethod\n    def _parse_file_args(args: Optional[str] = None) -> logging.Handler:  # noqa D102\n        if not args:\n            raise ValueError(\"please provide filename for file logging using format 'file=/path/to/logfile.txt'\")\n        return logging.FileHandler(args)\n\n    @staticmethod\n    def _parse_http_args(args: Optional[str] = None) -> logging.Handler:  # noqa D102\n        if not args:\n            raise ValueError(\"please provide destination for http logging using format 'http=url'\")\n        arg_list = args.split(\",\")\n        url = urllib.parse.urlparse(arg_list.pop(0))\n        if url.scheme != \"http\":\n            raise ValueError(f\"the http logging module can only log to HTTP URLs, but {url.scheme} was specified\")\n        host = url.hostname\n        path = url.path\n        port = url.port or 80\n\n        syslog_args: Dict[str, Any] = {}\n        for a in arg_list:\n            arg_name, *arg_value = a.split(\":\", 2)\n            if arg_name == \"method\":\n                method = arg_value[0] if len(arg_value) > 0 else \"GET\"\n                syslog_args[arg_name] = method\n            else:  # TODO: Provide support for SSL context and credentials\n                pass\n        return logging.handlers.HTTPHandler(f\"{host}:{port}\", path, **syslog_args)\n","sourceCodeStart":404,"sourceCodeEnd":436,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/util/logging.py#L404-L436","documentation":"HTTP log handlers in Python only support the http scheme. After parsing the URL from the 'http=url' argument, _parse_http_args checks url.scheme and raises this ValueError if it is anything other than 'http' (e.g. https, tcp). The library deliberately rejects non-HTTP destinations because logging.handlers.HTTPHandler cannot speak other protocols.","triggerScenarios":"Passing logging='http=https://myserver/logs' (or any scheme != 'http') to get_loggers / InvokeAI logging config.","commonSituations":"Users naturally assume https works; copying an https log-ingestion endpoint from a SaaS provider; proxy URLs with custom schemes.","solutions":["Change the scheme to plain http in the logging URL (the HTTPHandler sends POSTs to it).","If the endpoint only accepts https, front it with a local reverse proxy that terminates TLS and forwards over http.","Alternatively choose a different handler type (file, syslog) for secured remote logging."],"exampleFix":"// before\n--logging http=https://logs.example.com/ingest\n// after\n--logging http=http://logs.example.com/ingest","handlingStrategy":"validation","validationCode":"import urllib.parse\nurl = urllib.parse.urlparse(\"https://logs.example.com/ingest\")\nassert url.scheme == \"http\", f\"logging HTTPHandler requires http scheme, got {url.scheme}\"","typeGuard":null,"tryCatchPattern":"try:\n    get_loggers(app, level, format=f\"http={url}\")\nexcept ValueError as e:\n    if \"can only log to HTTP URLs\" in str(e):\n        log.warning(\"Falling back to file logging; https unsupported by HTTPHandler\")\n        get_loggers(app, level, format=\"file=/var/log/invokeai.log\")","preventionTips":["Use http:// scheme; remember Python's HTTPHandler has no TLS support.","Terminate https with a local reverse proxy if the remote endpoint requires TLS.","Parse and check the scheme with urllib.parse before wiring the config."],"tags":["python","logging","url","https","valueerror"],"backgroundTag":"unsupported-url-scheme","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}