Closed curtishall closed 2 months ago
Hi @curtishall , We have tried to reproduce the issue mentioned above, but couldn't reproduce it. We have tested in Ubuntu 18, 20 and 22 with python version 3.8, 3.10 and 3.12. And also with blank database and test database provided. From the issue that we have seen in the report, we have added a solution to it which we think will work for you. Please use the latest code from the github and check again. If you still face the issues, please let us know.
With Regards, Team Horilla
Thanks for the quick response. What file do I need to remove to start the database seeding process again?
makemigrations will not seed again even if I drop the database so I was deleting the entire directory and recloning but surely there is a better way.
Hi @curtishall , You don't have to remove any file to start the process again. If you are working on a new blank database, I would suggest that you remove all the migrations file from the apps and start again as a fresh start.
You can just run the makemigrations and migrate command again which will fix the issue.
Also we haven't created the fixtures for seeding the data into the database. Time being we have provided a test database within the repo itself for testing purpose which is already set inside the settings.py file.
We'll soon release the fixture along with a database manager for restoring, backing up and creating new database from the front end without the use of changing values from the backend. The RnD is currently under progress on this and features are completed. We are currently working on the method for dynamically changing the database from the frontend menu with which multiple database concept can be implemented.
With Regards, Team Horilla
Still having the same issue:
alter_unique_together
self.execute(self._create_unique_sql(model, fields))
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/schema.py", line 201, in execute
cursor.execute(sql, params)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/usr/local/lib/python3.10/dist-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/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.10/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.10/dist-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/local/lib/python3.10/dist-packages/MySQLdb/connections.py", line 254, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'address' used in key specification without a key length")
Are you testing with the test database provided in the git or a new blank database?
I did not use the database provided. I ended up switching to mariadb and was able to complete the install.
Hi @curtishall , Happy to hear that. We'll try to solve the issue you faced with the mysql database.
With Regards, Team Horilla
Last question...the server runs on localhost 8000 but doesn't bind to any other interface. How can I access the app remotely? I tried nginx proxy manager and it says bad gateway.
If you can update the documentation to show how to bind to all interfaces:
python3 manage.py runserver 0.0.0.0:8000
And then if using a proxy edit CSRF_TRUSTED_ORIGINS in horilla/settings.py and put in the FQDN with the schema (https://....)
Hi @curtishall , Thanks for the suggestion. We'll add it in the documentation. We are on a major update to the git documentation and we'll add it to the docs.
If you can update the documentation to show how to bind to all interfaces:
python3 manage.py runserver 0.0.0.0:8000
And then if using a proxy edit CSRF_TRUSTED_ORIGINS in horilla/settings.py and put in the FQDN with the schema (https://....)
With Regards, Team Horilla
Last question...the server runs on localhost 8000 but doesn't bind to any other interface. How can I access the app remotely? I tried nginx proxy manager and it says bad gateway.
Is this fixed? If you are hosting locally in your system and want to host to the system in your network, you can use your public ip and share it with your colleagues and use a cloud system and host Horilla in it.
With Regards, Team Horilla
Yes, fixed.
Hi @curtishall , I have come across the same issue. I just tried with the latest code, but still facing the exact same error mentioned above. I would like to use mysql only. Is there any solution?
I followed the exact same steps - I have ubuntu 20.4 , python 3.8.10 and Django 4.2.11
$ sudo python3 manage.py migrate
System check identified some issues:
WARNINGS:
employee.Employee: (models.W036) MySQL does not support unique constraints with conditions.
HINT: A constraint won't be created. Silence this warning if you don't care about it.
Operations to perform:
Apply all migrations: admin, asset, attendance, auth, base, contenttypes, django_apscheduler, employee, helpdesk, horilla_audit, horilla_documents, leave, notifications, offboarding, onboarding, payroll, pms, recruitment, sessions
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 horilla_audit.0001_initial... OK
Applying base.0001_initial... OK
Applying employee.0001_initial...Job "recurring_holiday (trigger: interval[0:00:10], next run at: 2024-05-01 22:58:42 IST)" raised an exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
MySQLdb.ProgrammingError: (1146, "Table 'horilla.leave_holiday' doesn't exist")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/nishit/Documents/Lab/horilla/horilla/leave/scheduler.py", line 44, in recurring_holiday
for recurring_holiday in recurring_holidays:
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 398, in __iter__
self._fetch_all()
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1881, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 91, in __iter__
results = compiler.execute_sql(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1146, "Table 'horilla.leave_holiday' doesn't exist")
Job "leave_reset (trigger: interval[0:00:10], next run at: 2024-05-01 22:58:42 IST)" raised an exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
MySQLdb.ProgrammingError: (1146, "Table 'horilla.leave_leavetype' doesn't exist")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/nishit/Documents/Lab/horilla/horilla/leave/scheduler.py", line 16, in leave_reset
for leave_type in leave_types:
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 398, in __iter__
self._fetch_all()
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1881, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 91, in __iter__
results = compiler.execute_sql(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1146, "Table 'horilla.leave_leavetype' doesn't exist")
OK
Applying asset.0001_initial... OK
Applying asset.0002_initial... OK
Applying leave.0001_initial... OK
Applying attendance.0001_initial... OK
Applying attendance.0002_initial... 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 base.0002_initial...Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
MySQLdb.OperationalError: (1170, "BLOB/TEXT column 'address' used in key specification without a key length")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/commands/migrate.py", line 356, in handle
post_migrate_state = executor.migrate(
File "/usr/local/lib/python3.8/dist-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
File "/usr/local/lib/python3.8/dist-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
File "/usr/local/lib/python3.8/dist-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/usr/local/lib/python3.8/dist-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/usr/local/lib/python3.8/dist-packages/django/db/migrations/operations/models.py", line 659, in database_forwards
alter_together(
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/schema.py", line 563, in alter_unique_together
self.execute(self._create_unique_sql(model, fields))
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/schema.py", line 201, in execute
cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'address' used in key specification without a key length")
Bug Report
Installing under Ubuntu 22.04, latest updates.
Description
Using mysql, confirmed credentials.
[A brief description of the bug or issue you're encountering.]
Steps to Reproduce
Clean install of Ubuntu 22.04, install packages per instruction.
Environment