{"record":{"id":"d5640aa6f3c4d95f","repo":"jumpserver/jumpserver","slug":"unable-to-collect-oracle-system-privileges-s","errorCode":null,"errorMessage":"Unable to collect Oracle system privileges: %s","messagePattern":"Unable to collect Oracle system privileges: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/libs/ansible/modules/oracle_info.py","lineNumber":245,"sourceCode":"        if roles_error:\n            self.module.warn(\n                'Unable to collect Oracle role memberships: %s'\n                % roles_error\n            )\n            roles = []\n        if isinstance(roles, dict):\n            roles = [roles]\n\n        privileges_sql = \"\"\"\n            SELECT SP.GRANTEE, SP.PRIVILEGE\n            FROM DBA_SYS_PRIVS SP\n            JOIN DBA_USERS U ON U.USERNAME = SP.GRANTEE\n        \"\"\"\n        privileges, privileges_error = self.oracle_client.execute(\n            privileges_sql\n        )\n        if privileges_error:\n            self.module.warn(\n                'Unable to collect Oracle system privileges: %s'\n                % privileges_error\n            )\n            privileges = []\n        if isinstance(privileges, dict):\n            privileges = [privileges]\n\n        roles_by_user = {}\n        for role in roles or []:\n            roles_by_user.setdefault(role['grantee'], []).append(\n                role['granted_role']\n            )\n        privileges_by_user = {}\n        for privilege in privileges or []:\n            privileges_by_user.setdefault(\n                privilege['grantee'], []\n            ).append(privilege['privilege'])\n","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/jumpserver/jumpserver/blob/6ec464fabd61b95912d539455a3a5f15f5c59fe0/apps/libs/ansible/modules/oracle_info.py#L227-L263","documentation":"Companion warning to 657: the query for system privileges (DBA_TAB_PRIVS/DBA_SYS_PRIVS-style query joined to DBA_USERS) errored, so the module sets privileges = [] and continues without system privilege data for users. Same root causes as the role-membership warning — almost always a privileges problem on the DBA dictionary views.","triggerScenarios":"Running oracle_info with a connection that cannot SELECT the system-privilege dictionary views (e.g. DBA_SYS_PRIVS) joined to DBA_USERS; execute() returns a truthy error.","commonSituations":"Non-DBA monitoring accounts, hardened databases where PUBLIC lacks dictionary access (O7_DICTIONARY_ACCESSIBILITY=FALSE), multitenant confusion over which container holds the views.","solutions":["Grant SELECT on the relevant DBA privilege views (DBA_SYS_PRIVS, DBA_USERS) to the module's connect user","Connect with a user holding the DBA role or SELECT_CATALOG_ROLE","Treat the absence of privileges data as acceptable if not required for your use case"],"exampleFix":"-- before\n-- module user: app_monitor (no dictionary grants) -> warning, privileges=[]\n\n-- after\nGRANT SELECT_CATALOG_ROLE TO app_monitor;","handlingStrategy":"fallback","validationCode":"# preflight: verify access to system-privilege dictionary views\ncur.execute('SELECT COUNT(*) FROM DBA_SYS_PRIVS')","typeGuard":null,"tryCatchPattern":"result = oracle_info(module_args={'filter': ['users']})\nif not result['users'][0].get('sys_privs'):\n    warn('privilege collection failed; check dictionary grants')","preventionTips":["Use a DBA-role or SELECT_CATALOG_ROLE account for complete collection","Audit grants whenever the connect user changes","Treat warnings 657/658 together — same root cause, fix grants once"],"tags":["ansible","oracle","dba-views","privileges","graceful-degradation"],"backgroundTag":"insufficient-database-privileges","analyzedSha":"6ec464fabd61b95912d539455a3a5f15f5c59fe0","analyzedAt":"2026-08-28T11:33:00.925Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}