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

Migration error 0005_fixup_dynamic_shema_table_names #223

Closed
etj opened this issue Feb 13, 2024 · 0 comments · Fixed by #224
Closed

Migration error 0005_fixup_dynamic_shema_table_names #223

etj opened this issue Feb 13, 2024 · 0 comments · Fixed by #224
Assignees

Comments

@etj
Copy link
Contributor

etj commented Feb 13, 2024

There's an error raised randomly during the db initialization:

dj4gn  | psycopg2.errors.UndefinedTable: ERRORE:  la relazione "dynamic_models_modelschema" non esiste
Full error log
django4geonode_prtv  |   Applying resource.0006_executionrequest_action...ESC[32;1m OKESC[0m
django4geonode_prtv  |   Applying resource.0007_alter_executionrequest_action...ESC[32;1m OKESC[0m
django4geonode_prtv  |   Applying importer.0001_initial...ESC[32;1m OKESC[0m
django4geonode_prtv  |   Applying importer.0002_resourcehandlerinfo_kwargs...ESC[32;1m OKESC[0m
django4geonode_prtv  |   Applying importer.0003_resourcehandlerinfo_execution_id...ESC[32;1m OKESC[0m
django4geonode_prtv  |   Applying importer.0004_rename_execution_id_resourcehandlerinfo_execution_request...ESC[32;1m OKESC[0m
django4geonode_prtv  |   Applying importer.0005_fixup_dynamic_shema_table_names...Traceback (most recent call last):
django4geonode_prtv  |   File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 84, in _execute
django4geonode_prtv  |     return self.cursor.execute(sql, params)
django4geonode_prtv  | psycopg2.errors.UndefinedTable: ERRORE:  la relazione "dynamic_models_modelschema" non esiste
django4geonode_prtv  | LINE 1: ..."dynamic_models_modelschema"."db_table_name" FROM "dynamic_m...
django4geonode_prtv  |                                                              ^
django4geonode_prtv  |
django4geonode_prtv  |
django4geonode_prtv  | The above exception was the direct cause of the following exception:
django4geonode_prtv  |
django4geonode_prtv  | Traceback (most recent call last):
django4geonode_prtv  |   File "/usr/src/geonode_provinciatreviso/manage.py", line 31, in <module>
django4geonode_prtv  |     execute_from_command_line(sys.argv)
django4geonode_prtv  |   File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
django4geonode_prtv  |     utility.execute()
django4geonode_prtv  |   File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 413, in execute
[...]
django4geonode_prtv  |     return executor(sql, params, many, context)
django4geonode_prtv  |   File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 79, in _execute
django4geonode_prtv  |     with self.db.wrap_database_errors:
django4geonode_prtv  |   File "/usr/local/lib/python3.10/dist-packages/django/db/utils.py", line 90, in __exit__
django4geonode_prtv  |     raise dj_exc_value.with_traceback(traceback) from exc_value
django4geonode_prtv  |   File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 84, in _execute
django4geonode_prtv  |     return self.cursor.execute(sql, params)
django4geonode_prtv  | django.db.utils.ProgrammingError: ERRORE:  la relazione "dynamic_models_modelschema" non esiste
django4geonode_prtv  | LINE 1: ..."dynamic_models_modelschema"."db_table_name" FROM "dynamic_m...
django4geonode_prtv  |

Current code check for a match with the English message

if 'relation "dynamic_models_modelschema" does not exist' in e.args[0]:
logging.debug("Dynamic model does not exists yet, skipping")
return

but any other language will mismatch.

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

Successfully merging a pull request may close this issue.

2 participants