Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error that occurred during the "Add model": NOT NULL constraint failed. #182

Open
ddddddreamcastle opened this issue May 7, 2024 · 3 comments

Comments

@ddddddreamcastle
Copy link

Traceback (most recent call last):
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.IntegrityError: NOT NULL constraint failed: ml_mlbackend.auth_method

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/rest_framework/generics.py", line 242, in post
    return self.create(request, *args, **kwargs)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/rest_framework/mixins.py", line 19, in create
    self.perform_create(serializer)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/label_studio/ml/api.py", line 94, in perform_create
    ml_backend = serializer.save()
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/rest_framework/serializers.py", line 212, in save
    self.instance = self.create(validated_data)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/rest_framework/serializers.py", line 962, in create
    instance = ModelClass._default_manager.create(**validated_data)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/query.py", line 453, in create
    obj.save(force_insert=True, using=self.db)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/base.py", line 739, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/base.py", line 776, in save_base
    updated = self._save_table(
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/base.py", line 881, in _save_table
    results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/base.py", line 919, in _do_insert
    return manager._insert(
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/query.py", line 1270, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
    cursor.execute(sql, params)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/sentry_sdk/utils.py", line 1711, in runner
    return sentry_patched_function(*args, **kwargs)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/sentry_sdk/integrations/django/__init__.py", line 629, in execute
    result = real_execute(self, sql, params)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/env/miniconda3/envs/rtmdet-sam/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.IntegrityError: NOT NULL constraint failed: ml_mlbackend.auth_method
20240507-181459

Operating system: Ubuntu 20.04
python env: Following the instructions at https://github.com/open-mmlab/playground/tree/main/label_anything

@Visytudz
Copy link

Visytudz commented Jun 7, 2024

Did you solve the problem?

@shanbiu
Copy link

shanbiu commented Jun 17, 2024

I also have this problem.

@Visytudz
Copy link

I also have this problem.

update labelstudio to the newest
pip install -u label-studio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants