{"record":{"id":"f14bef9258addd86","repo":"sqlmapproject/sqlmap","slug":"s-s","errorCode":null,"errorMessage":"%s ('%s')","messagePattern":"%s \\('%s'\\)","errorType":"exception","errorClass":"SqlmapConnectionException","httpStatus":null,"severity":"error","filePath":"lib/utils/api.py","lineNumber":480,"sourceCode":"        of StdDbOut's stderr branch for CLI --report-json runs)\n        \"\"\"\n        logging.Handler.__init__(self)\n        self.setLevel(logging.ERROR)\n        self.collector = collector\n\n    def emit(self, record):\n        try:\n            self.collector.execute(\"INSERT INTO errors VALUES(NULL, ?, ?)\", (REPORT_TASKID, str(record.msg % record.args if record.args else record.msg)))\n        except Exception:\n            pass\n\ndef setRestAPILog():\n    if conf.api:\n        try:\n            conf.databaseCursor = Database(conf.database)\n            conf.databaseCursor.connect(\"client\")\n        except sqlite3.OperationalError as ex:\n            raise SqlmapConnectionException(\"%s ('%s')\" % (ex, conf.database))\n\n        # Set a logging handler that writes log messages to a IPC database\n        logger.removeHandler(LOGGER_HANDLER)\n        LOGGER_RECORDER = LogRecorder()\n        logger.addHandler(LOGGER_RECORDER)\n\n# Generic functions\ndef is_admin(token):\n    return safeCompareStrings(DataStore.admin_token, token)\n\ndef validate_task_options(taskid, options, caller):\n    if not isinstance(options, dict):\n        logger.warning(\"[%s] Invalid JSON options provided to %s()\" % (taskid, caller))\n        return \"Invalid JSON options\"\n\n    for key in options:\n        if key in RESTAPI_UNSUPPORTED_OPTIONS or key in RESTAPI_READONLY_OPTIONS:\n            logger.warning(\"[%s] Unsupported option '%s' provided to %s()\" % (taskid, key, caller))","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/utils/api.py#L462-L498","documentation":"Error \"%s ('%s')\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/utils/api.py:480 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}