invoke-ai/InvokeAI · error · ValueError

the http logging module can only log to HTTP URLs, but {url.

Error message

the http logging module can only log to HTTP URLs, but {url.scheme} was specified

What it means

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.

Source

Thrown at invokeai/backend/util/logging.py:422

                    syslog_args["address"] = arg_name
        except Exception:
            raise ValueError(f"{args} is not a value argument list for syslog logging")
        return logging.handlers.SysLogHandler(**syslog_args)

    @staticmethod
    def _parse_file_args(args: Optional[str] = None) -> logging.Handler:  # noqa D102
        if not args:
            raise ValueError("please provide filename for file logging using format 'file=/path/to/logfile.txt'")
        return logging.FileHandler(args)

    @staticmethod
    def _parse_http_args(args: Optional[str] = None) -> logging.Handler:  # noqa D102
        if not args:
            raise ValueError("please provide destination for http logging using format 'http=url'")
        arg_list = args.split(",")
        url = urllib.parse.urlparse(arg_list.pop(0))
        if url.scheme != "http":
            raise ValueError(f"the http logging module can only log to HTTP URLs, but {url.scheme} was specified")
        host = url.hostname
        path = url.path
        port = url.port or 80

        syslog_args: Dict[str, Any] = {}
        for a in arg_list:
            arg_name, *arg_value = a.split(":", 2)
            if arg_name == "method":
                method = arg_value[0] if len(arg_value) > 0 else "GET"
                syslog_args[arg_name] = method
            else:  # TODO: Provide support for SSL context and credentials
                pass
        return logging.handlers.HTTPHandler(f"{host}:{port}", path, **syslog_args)

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Change the scheme to plain http in the logging URL (the HTTPHandler sends POSTs to it).
  2. If the endpoint only accepts https, front it with a local reverse proxy that terminates TLS and forwards over http.
  3. Alternatively choose a different handler type (file, syslog) for secured remote logging.

Example fix

// before
--logging http=https://logs.example.com/ingest
// after
--logging http=http://logs.example.com/ingest
Defensive patterns

Strategy: validation

Validate before calling

import urllib.parse
url = urllib.parse.urlparse("https://logs.example.com/ingest")
assert url.scheme == "http", f"logging HTTPHandler requires http scheme, got {url.scheme}"

Try / catch

try:
    get_loggers(app, level, format=f"http={url}")
except ValueError as e:
    if "can only log to HTTP URLs" in str(e):
        log.warning("Falling back to file logging; https unsupported by HTTPHandler")
        get_loggers(app, level, format="file=/var/log/invokeai.log")

Prevention

When it happens

Trigger: Passing logging='http=https://myserver/logs' (or any scheme != 'http') to get_loggers / InvokeAI logging config.

Common situations: Users naturally assume https works; copying an https log-ingestion endpoint from a SaaS provider; proxy URLs with custom schemes.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/4570ba7fee95b7e8. Report an issue: GitHub.