{"id":"edba20870adaff24","repo":"celery/celery","slug":"still-root-uid-after-drop-privileges","errorCode":null,"errorMessage":"Still root uid after drop privileges!","messagePattern":"Still root uid after drop privileges!","errorType":"exception","errorClass":"SecurityError","httpStatus":null,"severity":"error","filePath":"celery/platforms.py","lineNumber":553,"sourceCode":"\n    If only GID is specified, only the group is changed.\n    \"\"\"\n    if sys.platform == 'win32':\n        return\n    if os.geteuid():\n        # no point trying to setuid unless we're root.\n        if not os.getuid():\n            raise SecurityError('contact support')\n    uid = uid and parse_uid(uid)\n    gid = gid and parse_gid(gid)\n\n    if uid:\n        _setuid(uid, gid)\n    else:\n        gid and setgid(gid)\n\n    if uid and not os.getuid() and not os.geteuid():\n        raise SecurityError('Still root uid after drop privileges!')\n    if gid and not os.getgid() and not os.getegid():\n        raise SecurityError('Still root gid after drop privileges!')\n\n\ndef _setuid(uid, gid):\n    # If GID isn't defined, get the primary GID of the user.\n    if not gid and pwd:\n        gid = pwd.getpwuid(uid).pw_gid\n    # Must set the GID before initgroups(), as setgid()\n    # is known to zap the group list on some platforms.\n\n    # setgid must happen before setuid (otherwise the setgid operation\n    # may fail because of insufficient privileges and possibly stay\n    # in a privileged group).\n    setgid(gid)\n    initgroups(uid, gid)\n\n    # at last:","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/celery/celery/blob/571efe81202341310b6257304980ba7898ab0f60/celery/platforms.py#L535-L571","documentation":"Error \"Still root uid after drop privileges!\" thrown in celery/celery.","triggerScenarios":"Thrown at celery/platforms.py:553 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"571efe81202341310b6257304980ba7898ab0f60","analyzedAt":"2026-08-04T20:17:20.567Z","schemaVersion":2}