esitarski/RaceDB

License Holders Import Excel

Closed this issue · 2 comments

Receive error when trying to upload a .xlsx file. Below log file:

Running init scripts stored in /docker-entrypoint-init.d
RaceDBVersion=v3.0.43-20210505130116
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/01-logstart.sh
databaseEngine="django.db.backends.postgresql"

databaseName="racedb"
RACEDB STARTED Fri May 7 10:32:49 UTC 2021
ServerTimeZone="Africa/Johannesburg"

python="3.9.5 (default, May 4 2021, 18:15:18)
/usr/sbin/entrypoint.sh: running bash script: /docker-entrypoint-init.d/02-postgres.sh
[GCC 8.3.0]"
Waiting for Postgres to start up...
logFileName="/racedb-data/RaceDB-log.txt"
Checking if the racedb exists...
RaceDBVersion=v3.0.43-20210505130116
RaceDB DB already exists. Not creating.
databaseEngine="django.db.backends.postgresql"

databaseName="racedb"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/10-configure.sh
ServerTimeZone="Africa/Johannesburg"
Configuring RaceDB for psql-local
python="3.9.5 (default, May 4 2021, 18:15:18)
Configured Date/Time for ISO format
[GCC 8.3.0]"

logFileName="/racedb-data/RaceDB-log.txt"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/20-data.sh
Not Found: /favicon.ico
Database already initialized.
WARNING:django.request:Not Found: /favicon.ico

psql: FATAL: the database system is starting up
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/30-backup.sh
RaceDBVersion=v3.0.43-20210505130116
Backing up database to /racedb-data/backups/racedb-backup-20210507-103250.json
databaseEngine="django.db.backends.postgresql"

databaseName="racedb"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/40-import.sh
ServerTimeZone="Africa/Johannesburg"
No SQLITE data to import from /racedb-data/RaceDB.sqlite3
python="3.9.5 (default, May 4 2021, 18:15:18)
No JSON data to import from /racedb-data/racedb-import.json
[GCC 8.3.0]"

logFileName="/racedb-data/RaceDB-log.txt"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/95-start.sh
RaceDBVersion=v3.0.43-20210505130116
Starting RaceDB...
databaseEngine="django.db.backends.postgresql"
Operations to perform:
databaseName="racedb"
Apply all migrations: admin, auth, contenttypes, core, sessions
ServerTimeZone="Africa/Johannesburg"
Running pre-migrate handlers for application admin
python="3.9.5 (default, May 4 2021, 18:15:18)
Running pre-migrate handlers for application auth
[GCC 8.3.0]"
Running pre-migrate handlers for application contenttypes
logFileName="/racedb-data/RaceDB-log.txt"
Running pre-migrate handlers for application sessions
psql: FATAL: the database system is starting up
Running pre-migrate handlers for application django_extensions
RaceDBVersion=v3.0.43-20210505130116
Running pre-migrate handlers for application core
databaseEngine="django.db.backends.postgresql"
Running migrations:
databaseName="racedb"
No migrations to apply.
ServerTimeZone="Africa/Johannesburg"
Running post-migrate handlers for application admin
python="3.9.5 (default, May 4 2021, 18:15:18)
Running post-migrate handlers for application auth
[GCC 8.3.0]"
Running post-migrate handlers for application contenttypes
logFileName="/racedb-data/RaceDB-log.txt"
Running post-migrate handlers for application sessions
RaceDBVersion=v3.0.43-20210505130116
Running post-migrate handlers for application django_extensions
databaseEngine="django.db.backends.postgresql"
Running post-migrate handlers for application core
databaseName="racedb"
Running init scripts stored in /docker-entrypoint-init.d
ServerTimeZone="Africa/Johannesburg"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/01-logstart.sh
python="3.9.5 (default, May 4 2021, 18:15:18)

[GCC 8.3.0]"
RACEDB STARTED Fri May 7 12:22:54 UTC 2021
logFileName="/racedb-data/RaceDB-log.txt"

psql: FATAL: the database system is starting up
/usr/sbin/entrypoint.sh: running bash script: /docker-entrypoint-init.d/02-postgres.sh
RaceDBVersion=v3.0.43-20210505130116
Waiting for Postgres to start up...
databaseEngine="django.db.backends.postgresql"
Postgres is unavailable - sleeping
databaseName="racedb"
Checking if the racedb exists...
ServerTimeZone="Africa/Johannesburg"
RaceDB DB already exists. Not creating.
python="3.9.5 (default, May 4 2021, 18:15:18)

[GCC 8.3.0]"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/10-configure.sh
logFileName="/racedb-data/RaceDB-log.txt"
Database already configured.
RaceDBVersion=v3.0.43-20210505130116
Configured Date/Time for ISO format
databaseEngine="django.db.backends.postgresql"

databaseName="racedb"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/20-data.sh
ServerTimeZone="Africa/Johannesburg"
Database already initialized.
python="3.9.5 (default, May 4 2021, 18:15:18)

[GCC 8.3.0]"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/30-backup.sh
logFileName="/racedb-data/RaceDB-log.txt"
Backing up database to /racedb-data/backups/racedb-backup-20210507-122305.json

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/40-import.sh
No SQLITE data to import from /racedb-data/RaceDB.sqlite3
No JSON data to import from /racedb-data/racedb-import.json

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/95-start.sh
Starting RaceDB...
Operations to perform:
Apply all migrations: admin, auth, contenttypes, core, sessions
Running pre-migrate handlers for application admin
Running pre-migrate handlers for application auth
Running pre-migrate handlers for application contenttypes
Running pre-migrate handlers for application sessions
Running pre-migrate handlers for application django_extensions
Running pre-migrate handlers for application core
Running migrations:
No migrations to apply.
Running post-migrate handlers for application admin
Running post-migrate handlers for application auth
Running post-migrate handlers for application contenttypes
Running post-migrate handlers for application sessions
Running post-migrate handlers for application django_extensions
Running post-migrate handlers for application core
Running init scripts stored in /docker-entrypoint-init.d
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/01-logstart.sh

RaceDBVersion=v3.0.43-20210505130116
RACEDB STARTED Fri May 7 15:33:58 UTC 2021
databaseEngine="django.db.backends.postgresql"

databaseName="racedb"
/usr/sbin/entrypoint.sh: running bash script: /docker-entrypoint-init.d/02-postgres.sh
ServerTimeZone="Africa/Johannesburg"
Waiting for Postgres to start up...
python="3.9.5 (default, May 4 2021, 18:15:18)
Postgres is unavailable - sleeping
[GCC 8.3.0]"
Checking if the racedb exists...
logFileName="/racedb-data/RaceDB-log.txt"
RaceDB DB already exists. Not creating.
RaceDBVersion=v3.0.43-20210505130116

databaseEngine="django.db.backends.postgresql"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/10-configure.sh
databaseName="racedb"
Database already configured.
ServerTimeZone="Africa/Johannesburg"
Configured Date/Time for ISO format
python="3.9.5 (default, May 4 2021, 18:15:18)

[GCC 8.3.0]"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/20-data.sh
logFileName="/racedb-data/RaceDB-log.txt"
Database already initialized.

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/30-backup.sh
Backing up database to /racedb-data/backups/racedb-backup-20210507-153409.json

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/40-import.sh
No SQLITE data to import from /racedb-data/RaceDB.sqlite3
No JSON data to import from /racedb-data/racedb-import.json

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/95-start.sh
Starting RaceDB...
Traceback (most recent call last):
Operations to perform:
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
Apply all migrations: admin, auth, contenttypes, core, sessions
return self.cursor.execute(sql, params)
Running pre-migrate handlers for application admin
psycopg2.errors.AdminShutdown: terminating connection due to administrator command
Running pre-migrate handlers for application auth
server closed the connection unexpectedly
Running pre-migrate handlers for application contenttypes
This probably means the server terminated abnormally
Running pre-migrate handlers for application sessions
before or while processing the request.
Running pre-migrate handlers for application django_extensions
Running pre-migrate handlers for application core
Running migrations:
The above exception was the direct cause of the following exception:
No migrations to apply.
Running post-migrate handlers for application admin
Traceback (most recent call last):
Running post-migrate handlers for application auth
File "/RaceDB/manage.py", line 38, in
Running post-migrate handlers for application contenttypes
execute_from_command_line(sys.argv)
Running post-migrate handlers for application sessions
File "/usr/local/lib/python3.9/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
Running post-migrate handlers for application django_extensions
utility.execute()
Running post-migrate handlers for application core
File "/usr/local/lib/python3.9/site-packages/django/core/management/init.py", line 413, in execute
Running init scripts stored in /docker-entrypoint-init.d
self.fetch_command(subcommand).run_from_argv(self.argv)
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/01-logstart.sh
File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv

self.execute(*args, **cmd_options)

RACEDB STARTED Fri May 7 19:19:00 UTC 2021
File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute

output = self.handle(*args, **options)

/usr/sbin/entrypoint.sh: running bash script: /docker-entrypoint-init.d/02-postgres.sh
File "/RaceDB/core/management/commands/launch.py", line 229, in handle
Waiting for Postgres to start up...
launch_server( self, **options )
Postgres is unavailable - sleeping
File "/RaceDB/core/management/commands/launch.py", line 87, in launch_server
Checking if the racedb exists...
models_fix_data()
RaceDB DB already exists. Not creating.
File "/RaceDB/core/models.py", line 5877, in models_fix_data

fix_finish_times()

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/10-configure.sh
File "/RaceDB/core/models.py", line 5864, in fix_finish_times
Database already configured.
ft = r.compute_finish_time()
Configured Date/Time for ISO format
File "/RaceDB/core/models.py", line 2993, in compute_finish_time

rts = self.get_race_times()

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/20-data.sh
File "/RaceDB/core/models.py", line 2990, in get_race_times
Database already initialized.
return [ rt.total_seconds() for rt in self.get_race_time_query().order_by('race_time').values_list('race_time',flat=True) ]

File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 280, in iter
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/30-backup.sh
self._fetch_all()
Backing up database to /racedb-data/backups/racedb-backup-20210507-191911.json
File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all

self._result_cache = list(self._iterable_class(self))

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/40-import.sh
File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 171, in iter
No SQLITE data to import from /racedb-data/RaceDB.sqlite3
for row in compiler.results_iter(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size):
No JSON data to import from /racedb-data/racedb-import.json
File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1124, in results_iter

results = self.execute_sql(MULTI, chunked_fetch=chunked_fetch, chunk_size=chunk_size)

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/95-start.sh
File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1169, in execute_sql
Starting RaceDB...
cursor.execute(sql, params)
Operations to perform:
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 98, in execute
Apply all migrations: admin, auth, contenttypes, core, sessions
return super().execute(sql, params)
Running pre-migrate handlers for application admin
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
Running pre-migrate handlers for application auth
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
Running pre-migrate handlers for application contenttypes
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
Running pre-migrate handlers for application sessions
return executor(sql, params, many, context)
Running pre-migrate handlers for application django_extensions
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
Running pre-migrate handlers for application core
return self.cursor.execute(sql, params)
Running migrations:
File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in exit
No migrations to apply.
raise dj_exc_value.with_traceback(traceback) from exc_value
Running post-migrate handlers for application admin
File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
Running post-migrate handlers for application auth
return self.cursor.execute(sql, params)
Running post-migrate handlers for application contenttypes
django.db.utils.OperationalError: terminating connection due to administrator command
Running post-migrate handlers for application sessions
server closed the connection unexpectedly
Running post-migrate handlers for application django_extensions
This probably means the server terminated abnormally
Running post-migrate handlers for application core
before or while processing the request.
Running init scripts stored in /docker-entrypoint-init.d
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/01-logstart.sh
RaceDBVersion=v3.0.43-20210505130116

databaseEngine="django.db.backends.postgresql"
RACEDB STARTED Sat May 8 13:11:32 UTC 2021
databaseName="racedb"

ServerTimeZone="Africa/Johannesburg"
/usr/sbin/entrypoint.sh: running bash script: /docker-entrypoint-init.d/02-postgres.sh
python="3.9.5 (default, May 4 2021, 18:15:18)
Waiting for Postgres to start up...
[GCC 8.3.0]"
Checking if the racedb exists...
logFileName="/racedb-data/RaceDB-log.txt"
RaceDB DB already exists. Not creating.
RaceDBVersion=v3.0.43-20210505130116

databaseEngine="django.db.backends.postgresql"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/10-configure.sh
databaseName="racedb"
Database already configured.
ServerTimeZone="Africa/Johannesburg"
Configured Date/Time for ISO format
python="3.9.5 (default, May 4 2021, 18:15:18)

[GCC 8.3.0]"
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/20-data.sh
logFileName="/racedb-data/RaceDB-log.txt"
Database already initialized.
Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/

Traceback (most recent call last):
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/30-backup.sh
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
Backing up database to /racedb-data/backups/racedb-backup-20210508-131133.json
response = get_response(request)

File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/40-import.sh
response = wrapped_callback(request, *callback_args, **callback_kwargs)
No SQLITE data to import from /racedb-data/RaceDB.sqlite3
File "/RaceDB/core/views_common.py", line 108, in wrap
No JSON data to import from /racedb-data/racedb-import.json
response = response or decorated_func( request, *args, **kwargs )

File "/RaceDB/core/WriteLog.py", line 90, in new_f
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/95-start.sh
return f( *args, **kwargs)
Starting RaceDB...
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
Operations to perform:
return view_func(request, *args, **kwargs)
Apply all migrations: admin, auth, contenttypes, core, sessions
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
Running pre-migrate handlers for application admin
return view_func(request, *args, **kwargs)
Running pre-migrate handlers for application auth
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
Running pre-migrate handlers for application contenttypes
results_str = handle_license_holder_import_excel(
Running pre-migrate handlers for application sessions
File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
Running pre-migrate handlers for application django_extensions
license_holder_import_excel(
Running pre-migrate handlers for application core
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
Running migrations:
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )
No migrations to apply.
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
Running post-migrate handlers for application admin
reader = ExcelReader(filename, read_only, keep_vba,
Running post-migrate handlers for application auth
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init
Running post-migrate handlers for application contenttypes
self.archive = _validate_archive(fn)
Running post-migrate handlers for application sessions
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
Running post-migrate handlers for application django_extensions
raise InvalidFileException(msg)
Running post-migrate handlers for application core
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'.xmlpk\x05\x06\x00\x00\x00\x00\x10\x00\x10\x00x\x04\x00\x00\xbdy\x00\x00\x00\x00' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
fix_bad_license_codes and emergency contacts...
ERROR:django.request:Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/
fix_nation_codes...
Traceback (most recent call last):
fix_non_unique_number_set_entries...
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
fix_bad_category_hints...
response = get_response(request)
fix_phone_numbers...
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
fix results finish times...
response = wrapped_callback(request, *callback_args, **callback_kwargs)
Shutdown called
File "/RaceDB/core/views_common.py", line 108, in wrap
Running init scripts stored in /docker-entrypoint-init.d
response = response or decorated_func( request, *args, **kwargs )
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/01-logstart.sh
File "/RaceDB/core/WriteLog.py", line 90, in new_f

return f( *args, **kwargs)

RACEDB STARTED Sat May 8 13:16:27 UTC 2021
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

return view_func(request, *args, **kwargs)

/usr/sbin/entrypoint.sh: running bash script: /docker-entrypoint-init.d/02-postgres.sh
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
Waiting for Postgres to start up...
return view_func(request, *args, **kwargs)
Checking if the racedb exists...
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
RaceDB DB already exists. Not creating.
results_str = handle_license_holder_import_excel(

File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/10-configure.sh
license_holder_import_excel(
Database already configured.
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
Configured Date/Time for ISO format
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )

File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/20-data.sh
reader = ExcelReader(filename, read_only, keep_vba,
Database already initialized.
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init

self.archive = _validate_archive(fn)

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/30-backup.sh
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
Backing up database to /racedb-data/backups/racedb-backup-20210508-131628.json
raise InvalidFileException(msg)

openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'.xmlpk\x05\x06\x00\x00\x00\x00\x10\x00\x10\x00x\x04\x00\x00\xbdy\x00\x00\x00\x00' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/40-import.sh
Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/
No SQLITE data to import from /racedb-data/RaceDB.sqlite3
Traceback (most recent call last):
No JSON data to import from /racedb-data/racedb-import.json
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner

response = get_response(request)

/usr/sbin/entrypoint.sh: sourcing bash script: /docker-entrypoint-init.d/95-start.sh
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
Starting RaceDB...
response = wrapped_callback(request, *callback_args, **callback_kwargs)
Operations to perform:
File "/RaceDB/core/views_common.py", line 108, in wrap
Apply all migrations: admin, auth, contenttypes, core, sessions
response = response or decorated_func( request, *args, **kwargs )
Running pre-migrate handlers for application admin
File "/RaceDB/core/WriteLog.py", line 90, in new_f
Running pre-migrate handlers for application auth
return f( *args, **kwargs)
Running pre-migrate handlers for application contenttypes
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
Running pre-migrate handlers for application sessions
return view_func(request, *args, **kwargs)
Running pre-migrate handlers for application django_extensions
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
Running pre-migrate handlers for application core
return view_func(request, *args, **kwargs)
Running migrations:
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
No migrations to apply.
results_str = handle_license_holder_import_excel(
Running post-migrate handlers for application admin
File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
Running post-migrate handlers for application auth
license_holder_import_excel(
Running post-migrate handlers for application contenttypes
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
Running post-migrate handlers for application sessions
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )
Running post-migrate handlers for application django_extensions
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
Running post-migrate handlers for application core
reader = ExcelReader(filename, read_only, keep_vba,
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init
self.archive = _validate_archive(fn)
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
raise InvalidFileException(msg)
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'.xmlpk\x05\x06\x00\x00\x00\x00\x10\x00\x10\x00x\x04\x00\x00\xday\x00\x00\x00\x00' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
ERROR:django.request:Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/RaceDB/core/views_common.py", line 108, in wrap
response = response or decorated_func( request, *args, **kwargs )
File "/RaceDB/core/WriteLog.py", line 90, in new_f
return f( *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
results_str = handle_license_holder_import_excel(
File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
license_holder_import_excel(
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
reader = ExcelReader(filename, read_only, keep_vba,
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init
self.archive = _validate_archive(fn)
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
raise InvalidFileException(msg)
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'.xmlpk\x05\x06\x00\x00\x00\x00\x10\x00\x10\x00x\x04\x00\x00\xday\x00\x00\x00\x00' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/RaceDB/core/views_common.py", line 108, in wrap
response = response or decorated_func( request, *args, **kwargs )
File "/RaceDB/core/WriteLog.py", line 90, in new_f
return f( *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
results_str = handle_license_holder_import_excel(
File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
license_holder_import_excel(
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
reader = ExcelReader(filename, read_only, keep_vba,
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init
self.archive = _validate_archive(fn)
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
raise InvalidFileException(msg)
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
ERROR:django.request:Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/RaceDB/core/views_common.py", line 108, in wrap
response = response or decorated_func( request, *args, **kwargs )
File "/RaceDB/core/WriteLog.py", line 90, in new_f
return f( *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
results_str = handle_license_holder_import_excel(
File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
license_holder_import_excel(
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
reader = ExcelReader(filename, read_only, keep_vba,
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init
self.archive = _validate_archive(fn)
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
raise InvalidFileException(msg)
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/RaceDB/core/views_common.py", line 108, in wrap
response = response or decorated_func( request, *args, **kwargs )
File "/RaceDB/core/WriteLog.py", line 90, in new_f
return f( *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

return view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
results_str = handle_license_holder_import_excel(
File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
license_holder_import_excel(
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
reader = ExcelReader(filename, read_only, keep_vba,
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init
self.archive = _validate_archive(fn)
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
raise InvalidFileException(msg)
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'.xmlpk\x05\x06\x00\x00\x00\x00\r\x00\r\x00l\x03\x00\x00]^\x00\x00\x00\x00' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
ERROR:django.request:Internal Server Error: /RaceDB/LicenseHolders/LicenseHoldersImportExcel/
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/RaceDB/core/views_common.py", line 108, in wrap
response = response or decorated_func( request, *args, **kwargs )
File "/RaceDB/core/WriteLog.py", line 90, in new_f
return f( *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/RaceDB/core/views.py", line 1621, in LicenseHoldersImportExcel
results_str = handle_license_holder_import_excel(
File "/RaceDB/core/views.py", line 1606, in handle_license_holder_import_excel
license_holder_import_excel(
File "/RaceDB/core/license_holder_import_excel.py", line 527, in license_holder_import_excel
wb = load_workbook( filename = worksheet_contents, read_only=True, data_only=True )
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 315, in load_workbook
reader = ExcelReader(filename, read_only, keep_vba,
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 124, in init
self.archive = _validate_archive(fn)
File "/usr/local/lib/python3.9/site-packages/openpyxl/reader/excel.py", line 94, in _validate_archive
raise InvalidFileException(msg)
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'.xmlpk\x05\x06\x00\x00\x00\x00\r\x00\r\x00l\x03\x00\x00]^\x00\x00\x00\x00' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm

Get the same error when trying to upload a PreReg excel file.

openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support b'.xmlpk\x05\x06\x00\x00\x00\x00\r\x00\r\x00l\x03\x00\x00]^\x00\x00\x00\x00' file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm

The problem was that openpyxl wants memory-based excel data to be wrapped in io.BytesIO objects.>

Thank you for the above fix Edward. Issue closed