HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
19.52k stars 2.42k forks source link

localhost:8080/api/projects/7/members 404 error. #3920

Closed Digital2Slave closed 1 year ago

Digital2Slave commented 1 year ago

Describe the bug

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/projects/7/members

image

To Reproduce Steps to reproduce the behavior:

  1. docker run -d -p 8080:8080 -vpwd:/label-studio/data heartexlabs/label-studio:develop
  2. Refer https://github.com/heartexlabs/label-studio-sdk/blob/master/examples/weak_supervision/weak_supervision.ipynb
  3. Run the following code:

    # Connect to the Label Studio API and check the connection
    ls = Client(url=url, api_key=api_key)
    ls_status = ls.check_connection()
    print(ls_status)
    if ls_status['status'] != 'UP':
        return '-1'
    
    users = ls.get_users()
    projects = ls.get_projects()
    
    for user in users:
        print(f'user_id:{user.id}\nuser_first_name:{user.first_name}\nuser_email:{user.email}')
    
        # define filters    
        user_filters = Filters.create(Filters.AND, [
            Filters.item(
                Column.annotators,
                Operator.CONTAINS,
                Type.String,
                Filters.value(user.id)
            ),
            Filters.item(
                Column.completed_at,
                Operator.IN,
                Type.Datetime,
                Filters.value(
                    datetime(2023, 3, 1),
                    datetime(2023, 3, 31),
                )
            )
        ])
        for project in projects:
            project_params = project.get_params()
            project_title = project_params['title']
            project_members = project.get_members()
            user_tasks = project.get_tasks(filters=user_filters)
            user_tasks_num = len(user_tasks)
            print(f'\tproject_title:{project_title}')
            print(f'\tproject_members:{project_members}')
            print(f'\tuser_tasks_num:{user_tasks_num}')
            # print(f'\t{user_tasks}')
        print('\n\n')

Expected behavior

Output the members of project.

Screenshots

{'status': 'UP'}
user_id:1
user_first_name:Tian
......
    project_members = project.get_members()
  File "/home/tianzx/.virtualenvs/yolov5/lib/python3.7/site-packages/label_studio_sdk/project.py", line 158, in get_members
    response = self.make_request('GET', f'/api/projects/{self.id}/members')
  File "/home/tianzx/.virtualenvs/yolov5/lib/python3.7/site-packages/label_studio_sdk/client.py", line 347, in make_request
    response.raise_for_status()
  File "/home/tianzx/.virtualenvs/yolov5/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/projects/7/members

Environment (please complete the following information):

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:    18.04
Codename:   bionic
# docker image
heartexlabs/label-studio      develop         bbb0e3c4db2f   18 hours ago    1.24GB
# python pip package
label-studio-converter         0.0.33rc5
label-studio-evalme            0.0.18
label-studio-ml                1.0.9
label-studio-sdk               0.0.21
label-studio-tools             0.0.2

image

makseq commented 1 year ago

This endpoint /api/projects/7/members is a part of enterprise app.