Bug 54173 - 40ucs-school-import-http-api.inst fails after upgrading from 4.4v9 to 5.0v1
40ucs-school-import-http-api.inst fails after upgrading from 4.4v9 to 5.0v1
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
UCS@school 5.0
Other Windows NT
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-30 14:57 CET by Michael Grandjean
Modified: 2023-06-12 16:05 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022120721000205
Bug group (optional): Workaround is available
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grandjean univentionstaff 2021-11-30 14:57:44 CET
I upgraded from 4.4-8 errata1111 to 5.0-0 errata159 including UCS@school.

After the upgrade, one joinscript is pending:

> root@ucs0044:~# univention-check-join-status
> Warning: 'ucs-school-import-http-api' is not configured.
> Error: Not all install files configured: 1 missing

The join.log reveals a traceback in djangos utils.py while trying to upgrade the database schema from UCS@school 4.4 to UCS@school 5.0:

[...]
RUNNING 40ucs-school-import-http-api.inst
2021-11-30 14:49:47.838278999+01:00 (in joinscript_init)
Object exists: cn=ucsschoolImportGroup,cn=UCSschool,cn=custom attributes,cn=univention,dc=lernen,dc=hamburg
Object exists: cn=ucsschoolSchool-ImportSchool,cn=UCSschool,cn=custom attributes,cn=univention,dc=lernen,dc=hamburg
Object exists: cn=ucsschoolSchool-ImportRole,cn=UCSschool,cn=custom attributes,cn=univention,dc=lernen,dc=hamburg
Using existing secret for Django service.
Using existing password for RabbitMQ.
Using existing RabbitMQ user and vhost.
Using existing password for PostgreSQL.
Setting password on existing PostgreSQL user.
ALTER ROLE
Using existing PostgreSQL database.
System check identified some issues:

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.

System check identified 1 issue (0 silenced).
Collecting static files...

0 static files symlinked to '/var/lib/ucs-school-import-http-api/static', 97 unmodified.
Upgrading database schema from UCS@school 4.4 to UCS@school 5.0...
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: FEHLER:  Relation »import_api_userimportjob« existiert nicht
LINE 1: SELECT (1) AS "a" FROM "import_api_userimportjob" LIMIT 1
                               ^


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

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/ucsschool/http_api/manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/django/core/management/commands/shell.py", line 95, in handle
    exec(options['command'])
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 673, in exists
    return self.query.has_results(using=self.db)
  File "/usr/lib/python3/dist-packages/django/db/models/sql/query.py", line 517, in has_results
    return compiler.has_results()
  File "/usr/lib/python3/dist-packages/django/db/models/sql/compiler.py", line 858, in has_results
    return bool(self.execute_sql(SINGLE))
  File "/usr/lib/python3/dist-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
  File "/usr/lib/python3/dist-packages/django/db/models/sql/compiler.py", line 889, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python3/dist-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: FEHLER:  Relation »import_api_userimportjob« existiert nicht
LINE 1: SELECT (1) AS "a" FROM "import_api_userimportjob" LIMIT 1
                               ^

40ucs-school-import-http-api.inst:
EXITCODE=1
Comment 1 Michael Grandjean univentionstaff 2021-11-30 15:58:13 CET
Workaround: 

univention-run-join-scripts --force --run-scripts 40ucs-school-import-http-api.inst