sqlmapproject/sqlmap · error · SqlmapConnectionException

SQLAlchemy connection issue

Error message

SQLAlchemy connection issue ('%s')

What it means

Catch-all in SQLAlchemyConnector.connect: engine construction or the initial connection raised TypeError/ValueError not matching any known-bug signature; the original exception text is embedded in the message.

Solutions

  1. Read the embedded exception text to identify the malformed URL or driver argument
  2. Verify the connection string syntax and installed DB-API driver
  3. Fix driver/version mismatches indicated by the message
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at lib/utils/sqlalchemy.py:97 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/791b46a2530e8133. Report an issue: GitHub.

Appendix: source

Thrown at lib/utils/sqlalchemy.py:97

                if self.dialect == "sqlite":
                    engine = _sqlalchemy.create_engine(self.address, connect_args={"check_same_thread": False})
                elif self.dialect == "oracle":
                    engine = _sqlalchemy.create_engine(self.address)
                else:
                    engine = _sqlalchemy.create_engine(self.address, connect_args={})

                self.connector = engine.connect()
            except (TypeError, ValueError) as ex:
                if "_get_server_version_info" in traceback.format_exc():
                    try:
                        import pymssql
                        if int(pymssql.__version__[0]) < 2:
                            raise SqlmapConnectionException("SQLAlchemy connection issue (obsolete version of pymssql ('%s') is causing problems)" % pymssql.__version__)
                    except ImportError:
                        pass
                    # Note: surface (as a proper SqlmapConnectionException) instead of silently continuing with self.connector left None
                    raise SqlmapConnectionException("SQLAlchemy connection issue ('%s')" % getSafeExString(ex))
                elif "invalid literal for int() with base 10: '0b" in traceback.format_exc():
                    raise SqlmapConnectionException("SQLAlchemy connection issue ('https://bitbucket.org/zzzeek/sqlalchemy/issues/3975')")
                else:
                    # Note: raise as SqlmapConnectionException (like the generic handler below) so the caller's native-connector
                    # fallback engages and no raw TypeError/ValueError can reach sqlmap's top-level handler
                    raise SqlmapConnectionException("SQLAlchemy connection issue ('%s')" % getSafeExString(ex))
            except SqlmapFilePathException:
                raise
            except Exception as ex:
                raise SqlmapConnectionException("SQLAlchemy connection issue ('%s')" % getSafeExString(ex))

            self.printConnected()
        else:
            raise SqlmapMissingDependence("SQLAlchemy not available (e.g. 'pip%s install SQLAlchemy')" % ('3' if six.PY3 else ""))

    def fetchall(self):
        try:
            retVal = []

View on GitHub (pinned to 0a35b20e39)