sqlmapproject/sqlmap · error · OperationalError

could not connect to '%s:%s' (%s)

Error message

could not connect to '%s:%s' (%s)

What it means

Error "could not connect to '%s:%s' (%s)" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/sybase.py:411

            elif token == _TOKEN_RETURNSTATUS:
                off += 4
            elif token == _TOKEN_ROWFMT2:
                raise NotSupportedError("the server answered with the wide ROWFMT2 format")
            else:
                off += 2 + _u16(data, off)      # every other TDS 5 token is 2-byte length prefixed
        if error is not None:
            if login:
                raise OperationalError(error[1])
            _raise_server_error(*error)
        return description, rows, affected

def connect(host=None, port=5000, user=None, password=None, database=None, connect_timeout=None, **kwargs):
    charset, codec = kwargs.get("charset", "utf8"), "utf-8"
    try:
        sock = socket.create_connection((host or "localhost", int(port or 5000)), timeout=connect_timeout)
        keepalive(sock)
    except (socket.error, socket.timeout) as ex:
        raise OperationalError("could not connect to '%s:%s' (%s)" % (host, port, ex))

    connection = Connection(sock, codec)
    try:
        login = _loginrec("dbwire", user or "", password or "", "dbwire", host or "localhost", charset, _PACKET_SIZE)
        _send_message(sock, _PKT_LOGIN, login, _LOGIN_CHUNK)
        connection._read_response(login=True)
        handshake_done(sock)
        if database:
            if not _IDENTIFIER.match(database):
                raise ProgrammingError("unsupported database name %r" % database)
            connection._query("USE %s" % database)
    except (DatabaseError, InterfaceError):
        connection.close()
        raise
    except Exception as ex:
        connection.close()
        raise OperationalError("Sybase login failed (%s)" % ex)
    return connection

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/sybase.py:411 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/bc743095a522eb00. Report an issue: GitHub.