infiniflow/ragflow · warning · AdminException

not implement: create role: {role_name}, description: {descr

Error message

not implement: create role: {role_name}, description: {description}

What it means

RoleMgr.create_role (admin/server/roles.py:28) is an unimplemented stub: it logs 'not implement: create role: ...' and immediately raises AdminException. The entire RoleMgr role-management API surface is placeholder code — calling create_role never performs work, it only reports that the feature is not yet built. There is no default AdminException status, so it surfaces as a generic 500-style admin error.

Source

Thrown at admin/server/roles.py:28

#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#
import logging

from typing import Dict, Any

from api.common.exceptions import AdminException


class RoleMgr:
    @staticmethod
    def create_role(role_name: str, description: str):
        error_msg = f"not implement: create role: {role_name}, description: {description}"
        logging.error(error_msg)
        raise AdminException(error_msg)

    @staticmethod
    def update_role_description(role_name: str, description: str) -> Dict[str, Any]:
        error_msg = f"not implement: update role: {role_name} with description: {description}"
        logging.error(error_msg)
        raise AdminException(error_msg)

    @staticmethod
    def delete_role(role_name: str) -> Dict[str, Any]:
        error_msg = f"not implement: drop role: {role_name}"
        logging.error(error_msg)
        raise AdminException(error_msg)

    @staticmethod
    def list_roles() -> Dict[str, Any]:
        error_msg = "not implement: list roles"
        logging.error(error_msg)
        raise AdminException(error_msg)

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Do not call this API — role creation is not implemented in this RAGFlow version.
  2. Manage authorization where it is implemented: is_superuser flags on users and tenant roles (UserTenantRole) in the DB.
  3. Track/patch the upstream implementation if you need RBAC, or implement RoleMgr.create_role against your own permission store.
Defensive patterns

Strategy: try-catch

Validate before calling

# there is no supported role store to validate against; treat create_role as unavailable
from admin.server.roles import RoleMgr
ROLE_APIS_IMPLEMENTED = False  # guard your tooling on this flag

Try / catch

from api.common.exceptions import AdminException
try:
    RoleMgr.create_role(name, desc)
except AdminException as e:
    if str(e).startswith("not implement"):
        return {"supported": False, "reason": str(e)}  # degrade gracefully
    raise

Prevention

When it happens

Trigger: Invoking RoleMgr.create_role(role_name, description) directly, or hitting whichever admin route/CLI command delegates to it (role creation in the admin console).

Common situations: Users exploring the admin API for RBAC and assuming roles are supported; automated scripts generated from API docs that list role endpoints.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/6de1ade23ddbfa36. Report an issue: GitHub.