cvat: Error when creating superuser in fresh install
My actions before raising this issue
- Read/searched the docs
- Searched past issues
Expected Behaviour
After building the docker I expect to be able to create a super user with the following command from the installation guide:
docker exec -it cvat bash -ic 'python3 ~/manage.py createsuperuser'
Current Behaviour
Instead I get the following error message:
You have 54 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): account, admin, auth, authtoken, contenttypes, engine, git, sessions, sites, socialaccount.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/django/manage.py", line 21, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 61, in execute
return super().execute(*args, **options)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.5/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 82, in handle
default_username = get_default_username()
File "/usr/local/lib/python3.5/dist-packages/django/contrib/auth/management/__init__.py", line 140, in get_default_username
auth_app.User._default_manager.get(username=default_username)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/cacheops/query.py", line 359, in get
return qs._no_monkey.get(qs, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 402, in get
num = len(clone)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 256, in __len__
self._fetch_all()
File "/usr/local/lib/python3.5/dist-packages/cacheops/query.py", line 279, in _fetch_all
return self._no_monkey._fetch_all(self)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 1242, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.5/dist-packages/django/db/models/query.py", line 55, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/usr/local/lib/python3.5/dist-packages/django/db/models/sql/compiler.py", line 1140, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.5/dist-packages/cacheops/transaction.py", line 93, in execute
result = self._no_monkey.execute(self, sql, params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.5/dist-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
Perhaps something with a database?
Possible Solution
?
Steps to Reproduce (for bugs)
- git clone https://github.com/opencv/cvat.git
- docker-compose build
- docker-compose up -d
- docker exec -it cvat bash -ic ‘python3 ~/manage.py createsuperuser’
Context
I tried this on a pc which had an older version of CVAT running without problems. I also tried it on another pc which did not have a previous install of CVAT to be sure.
Your Environment
- Git hash commit (
git log -1):
- Docker version
docker version(e.g. Docker 17.0.05):
- Are you using Docker Swarm or Kubernetes? I don’t know, for sure not kubernetes.
- Operating System and version (e.g. Linux, Windows, MacOS):

- Code example or link to GitHub repo or gist to reproduce problem:
- Other diagnostic information / logs:
Logs from `cvat` container
Next steps
You may join our Gitter channel for community support.
I also raised this issue on gitter.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (5 by maintainers)
Update: A
sudo chmod -R o+rX .after thegit clone ...andcd cvatmakes it work even if I haveumask 077as my usermask. Seems to be a permissions thing on something in the repo. I recommend finding what that thing is and maybe changing permissions in the docker container. IMHO, people should be able to have restrictive permissions in their home dir.