How to solve this error... "django.db.utils.OperationalError: near "INNER": syntax error"

Hello guys, im tried to clone a project from github, while setup, after installing the requirements.txt files, i tried to migrate,then i got this error…

 python manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, flatpages, impersonate, judge, redirects, registration, reversion, sessions, sites, social_django
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying auth.0012_alter_user_first_name_max_length... OK
  Applying sites.0001_initial... OK
  Applying flatpages.0001_initial... OK
  Applying impersonate.0001_initial... OK
  Applying judge.0001_squashed_0084_contest_formats... OK
  Applying judge.0085_submission_source... OK
  Applying judge.0086_rating_ceiling... OK
  Applying judge.0087_problem_resource_limits... OK
  Applying judge.0088_private_contests... OK
  Applying judge.0089_submission_to_contest...Traceback (most recent call last):
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 87, in _execute
    return self.cursor.execute(sql)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 324, in execute
    return super().execute(query)
sqlite3.OperationalError: near "INNER": syntax error

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

Traceback (most recent call last):
  File "/home/sumith/Documents/DMOJ/online-judge/manage.py", line 14, in <module>
    execute_from_command_line(sys.argv)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/core/management/base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 356, in handle
    post_migrate_state = executor.migrate(
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 135, in migrate
    state = self._migrate_all_forwards(
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
    state = self.apply_migration(
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/migrations/migration.py", line 132, in apply
    operation.database_forwards(
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/migrations/operations/special.py", line 106, in database_forwards
    self._run_sql(schema_editor, self.sql)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/migrations/operations/special.py", line 133, in _run_sql
    schema_editor.execute(statement, params=None)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 201, in execute
    cursor.execute(sql, params)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 87, in _execute
    return self.cursor.execute(sql)
  File "/home/sumith/Documents/DMOJ/online-judge/env/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 324, in execute
    return super().execute(query)
django.db.utils.OperationalError: near "INNER": syntax error

Im using sqlite3 , can anynone help me with this?

You didn’t share which project you were using, which makes it hard for anyone to help.

But I eventually found that it’s GitHub - DMOJ/online-judge: A modern open-source online judge and contest platform system.

Searching the project’s Issues for “sqlite” I found this issue: Error django.db.utils.OperationalError: near "INNER": syntax erro · Issue #1929 · DMOJ/online-judge · GitHub

it looks like you are using SQLite, which we don’t support.