horilla
horilla copied to clipboard
[Bug] `no such column: accessibility_defaultaccessibility.is_enabled` after upgrading version
Description
This came after upgrading versions to the latest commit (as of writing) using ./entrypoint.sh, here's the full stacktrace:
Django Version: 4.2.11
Python Version: 3.10.17
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'notifications',
'mathfilters',
'corsheaders',
'simple_history',
'django_filters',
'base',
'employee',
'recruitment',
'leave',
'pms',
'onboarding',
'asset',
'attendance',
'payroll',
'widget_tweaks',
'django_apscheduler',
'accessibility',
'horilla_audit',
'horilla_widgets',
'horilla_crumbs',
'horilla_documents',
'horilla_views',
'horilla_automations',
'auditlog',
'biometric',
'helpdesk',
'offboarding',
'horilla_backup',
'project',
'rest_framework',
'rest_framework_simplejwt',
'drf_yasg',
'horilla_api',
'geofencing',
'facedetection']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'corsheaders.middleware.CorsMiddleware',
'simple_history.middleware.HistoryRequestMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'auditlog.middleware.AuditlogMiddleware',
'base.middleware.CompanyMiddleware',
'horilla.horilla_middlewares.MethodNotAllowedMiddleware',
'horilla.horilla_middlewares.ThreadLocalMiddleware',
'accessibility.middlewares.AccessibilityMiddleware',
'accessibility.middlewares.AccessibilityMiddleware',
'base.middleware.ForcePasswordChangeMiddleware',
'attendance.middleware.AttendanceMiddleware']
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute
return super().execute(query, params)
The above exception (no such column: accessibility_defaultaccessibility.is_enabled) was the direct cause of the following exception:
File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/app/accessibility/middlewares.py", line 48, in __call__
update_accessibility_cache(cache_key, request)
File "/app/accessibility/middlewares.py", line 19, in update_accessibility_cache
feature_accessible[accessibility] = check_is_accessible(
File "/app/accessibility/methods.py", line 22, in check_is_accessible
).first()
File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 1057, in first
for obj in queryset[:1]:
File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 398, in __iter__
self._fetch_all()
File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 1881, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 91, in __iter__
results = compiler.execute_sql(
File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/usr/local/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute
return super().execute(query, params)
Exception Type: OperationalError at /employee/employee-view/
Exception Value: no such column: accessibility_defaultaccessibility.is_enabled
Steps to Reproduce
- Update Horilla with an existing database (from somewhere in February, likely 1.2.3)
Expected Behavior
It should be able to migrate the missing field and function as intended.
Actual Behavior
Application crashes and shows the error message
Screenshots
No response
Django Version
4.2.11
Python Version
3.10.17
Operating System
Docker
Browser
No response
Additional Information
No response
Possible Solution
No response
Labels
bug
Priority
Medium
Assignees
No response
Related Issues
No response
Submission Checklist
- [x] I have searched for duplicate issues
- [x] I have provided as much detail as possible
I've had this happen...
First try making and applying migrations from inside the source container:
python manage.py makemigrations
python manage.py migrate
If that doesn't do it, you need to delete all of the migration files that do not end with *initial.py and the cache files and run the migration again.
This should do it for you:
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
Hi,
We are closing this issue due to inactivity.
It seems that there hasn't been any recent activity or discussion, and we believe it may have been resolved or is no longer relevant. If you feel this issue is still important and should be addressed, please feel free to reopen it or create a new issue with updated details.
With Regards, Team Horilla