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

MySQL issue Tutor upgrade from v15.3.7 to v16.0.3 #887

Closed
nratineau opened this issue Aug 9, 2023 · 4 comments · Fixed by #890
Closed

MySQL issue Tutor upgrade from v15.3.7 to v16.0.3 #887

nratineau opened this issue Aug 9, 2023 · 4 comments · Fixed by #890
Labels
bug Bugs will be investigated and fixed as quickly as possible.

Comments

@nratineau
Copy link

I was able to workaround the issue but wanted to post here if it helps someone with the same issue.

Bug description
Upgrading tutor from v15.3.7 to v16.0.3 changes the MySQL version from 5.7 to 8.0.33.
The upgrade complete successfully, however, after the upgrade when trying to browse the LMS dashboard to list all the courses an error 500 is thrown.
Navigating to the Studio /admin/course_overviews/courseoverview/, the MySQL container crashes completely with the error:

tutor_local-mysql-1  | information that should help you find out what is causing the crash.
tutor_local-mysql-1  | 2023-08-08 00:24:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.33-1.el8 started.
tutor_local-mysql-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
tutor_local-mysql-1  | 2023-08-08T00:24:52.445270Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
tutor_local-mysql-1  | 2023-08-08T00:24:52.447392Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33) starting as process 1
tutor_local-mysql-1  | 2023-08-08T00:24:52.448780Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
tutor_local-mysql-1  | 2023-08-08T00:24:52.448789Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8mb3_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
tutor_local-mysql-1  | 2023-08-08T00:24:52.455542Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
tutor_local-mysql-1  | 2023-08-08T00:24:53.160766Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
tutor_local-mysql-1  | 2023-08-08T00:24:53.684890Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
tutor_local-mysql-1  | 2023-08-08T00:24:53.701989Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
tutor_local-mysql-1  | 2023-08-08T00:24:53.789628Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
tutor_local-mysql-1  | 2023-08-08T00:24:53.789678Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
tutor_local-mysql-1  | 2023-08-08T00:24:53.793370Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
tutor_local-mysql-1  | 2023-08-08T00:24:53.825642Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
tutor_local-mysql-1  | 2023-08-08T00:24:53.825795Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.33'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
tutor_local-mysql-1  | 2023-08-08T00:25:09.195654Z 16 [Warning] [MY-010235] [Server] Following users were specified in CREATE USER IF NOT EXISTS but they already exist. Corresponding entry in binary log used default authentication plugin 'caching_sha2_password' to rewrite authentication information (if any) for them: 'notes'@'%'
tutor_local-mysql-1  | 2023-08-08T00:25:21Z UTC - mysqld got signal 11 ;
tutor_local-mysql-1  | Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
tutor_local-mysql-1  | BuildID[sha1]=8076d8618232dd0b5c9df333b4ee48d26d2170ca
tutor_local-mysql-1  | Thread pointer: 0x7fb5fd375ed0
tutor_local-mysql-1  | Attempting backtrace. You can use the following information to find out
tutor_local-mysql-1  | where mysqld died. If you see no messages after this, something went
tutor_local-mysql-1  | terribly wrong...
tutor_local-mysql-1  | stack_bottom = 7fb66810ac10 thread_stack 0x100000
tutor_local-mysql-1  | /usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x2123181]
tutor_local-mysql-1  | /usr/sbin/mysqld(print_fatal_signal(int)+0x2a2) [0xfe6a12]
tutor_local-mysql-1  | /usr/sbin/mysqld(handle_fatal_signal+0xa5) [0xfe6bc5]
tutor_local-mysql-1  | /lib64/libpthread.so.0(+0x12d40) [0x7fb693fb1d40]
tutor_local-mysql-1  | /usr/sbin/mysqld() [0x22dfba7]
tutor_local-mysql-1  | /usr/sbin/mysqld(row_sel_store_mysql_rec(unsigned char*, row_prebuilt_t*, unsigned char const*, dtuple_t const*, bool, dict_index_t const*, dict_index_t const*, unsigned long const*, bool, lob::undo_vers_t*, mem_block_info_t*&)+0x2d8) [0x22e2ec8]
tutor_local-mysql-1  | /usr/sbin/mysqld(row_search_mvcc(unsigned char*, page_cur_mode_t, row_prebuilt_t*, unsigned long, unsigned long)+0x2e59) [0x22e9f19]
tutor_local-mysql-1  | /usr/sbin/mysqld(ha_innobase::index_read(unsigned char*, unsigned char const*, unsigned int, ha_rkey_function)+0x386) [0x2180426]
tutor_local-mysql-1  | /usr/sbin/mysqld(handler::ha_index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function)+0x3e8) [0x10f9388]
tutor_local-mysql-1  | /usr/sbin/mysqld(read_const(TABLE*, Index_lookup*)+0x1b6) [0xe36786]
tutor_local-mysql-1  | /usr/sbin/mysqld(join_read_const_table(JOIN_TAB*, POSITION*)+0x101) [0xe368d1]
tutor_local-mysql-1  | /usr/sbin/mysqld(JOIN::extract_func_dependent_tables()+0x542) [0xe591a2]
tutor_local-mysql-1  | /usr/sbin/mysqld(JOIN::make_join_plan()+0xc89) [0xe6d5f9]
tutor_local-mysql-1  | /usr/sbin/mysqld(JOIN::optimize(bool)+0xfc5) [0xe6f2b5]
tutor_local-mysql-1  | /usr/sbin/mysqld(Query_block::optimize(THD*, bool)+0xc1) [0xed17e1]
tutor_local-mysql-1  | /usr/sbin/mysqld(Query_expression::optimize(THD*, TABLE*, bool, bool)+0xad) [0xf5033d]
tutor_local-mysql-1  | /usr/sbin/mysqld(Sql_cmd_dml::execute_inner(THD*)+0x34) [0xed0614]
tutor_local-mysql-1  | /usr/sbin/mysqld(Sql_cmd_dml::execute(THD*)+0x187) [0xedb4b7]
tutor_local-mysql-1  | /usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0xae7) [0xe781f7]
tutor_local-mysql-1  | /usr/sbin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x51b) [0xe7b9eb]
tutor_local-mysql-1  | /usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x233d) [0xe7e31d]
tutor_local-mysql-1  | /usr/sbin/mysqld(do_command(THD*)+0x15b) [0xe7eeab]
tutor_local-mysql-1  | /usr/sbin/mysqld() [0xfd6c18]
tutor_local-mysql-1  | /usr/sbin/mysqld() [0x2832314]
tutor_local-mysql-1  | /lib64/libpthread.so.0(+0x81da) [0x7fb693fa71da]
tutor_local-mysql-1  | /lib64/libc.so.6(clone+0x43) [0x7fb692556e73]
tutor_local-mysql-1  | 
tutor_local-mysql-1  | 
tutor_local-mysql-1  | Trying to get some variables.
tutor_local-mysql-1  | Some pointers may be invalid and cause the dump to abort.
tutor_local-mysql-1  | Query (7fb5fca6e780): SELECT `course_overviews_courseoverview`.`created`, `course_overviews_courseoverview`.`modified`, `course_overviews_courseoverview`.`version`, `course_overviews_courseoverview`.`id`, `course_overviews_courseoverview`.`_location`, `course_overviews_courseoverview`.`org`, `course_overviews_courseoverview`.`display_name`, `course_overviews_courseoverview`.`display_number_with_default`, `course_overviews_courseoverview`.`display_org_with_default`, `course_overviews_courseoverview`.`start`, `course_overviews_courseoverview`.`end`, `course_overviews_courseoverview`.`start_date`, `course_overviews_courseoverview`.`end_date`, `course_overviews_courseoverview`.`advertised_start`, `course_overviews_courseoverview`.`announcement`, `course_overviews_courseoverview`.`banner_image_url`, `course_overviews_courseoverview`.`course_image_url`, `course_overviews_courseoverview`.`social_sharing_url`, `course_overviews_courseoverview`.`end_of_course_survey_url`, `course_overviews_courseoverview`.`certificates_display_behavior`, `
tutor_local-mysql-1  | Connection ID (thread ID): 24
tutor_local-mysql-1  | Status: NOT_KILLED
tutor_local-mysql-1  | 
tutor_local-mysql-1  | 
tutor_local-mysql-1  | The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
tutor_local-mysql-1  | information that should help you find out what is causing the crash.
tutor_local-mysql-1  | 2023-08-08 00:25:22+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.33-1.el8 started.
tutor_local-mysql-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
tutor_local-mysql-1  | 2023-08-08T00:25:22.537394Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
tutor_local-mysql-1  | 2023-08-08T00:25:22.539555Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33) starting as process 1
tutor_local-mysql-1  | 2023-08-08T00:25:22.540629Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
tutor_local-mysql-1  | 2023-08-08T00:25:22.540637Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8mb3_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
tutor_local-mysql-1  | 2023-08-08T00:25:22.546193Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
tutor_local-mysql-1  | 2023-08-08T00:25:23.539344Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
tutor_local-mysql-1  | 2023-08-08T00:25:23.999662Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
tutor_local-mysql-1  | 2023-08-08T00:25:24.012428Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
tutor_local-mysql-1  | 2023-08-08T00:25:24.047399Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
tutor_local-mysql-1  | 2023-08-08T00:25:24.047446Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
tutor_local-mysql-1  | 2023-08-08T00:25:24.051479Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
tutor_local-mysql-1  | 2023-08-08T00:25:24.075047Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
tutor_local-mysql-1  | 2023-08-08T00:25:24.075299Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.33'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.

Navigating to the 'about' page of a course throw a 500 as well, the LMS logs have:

tutor_local-lms-1            | 2023-08-08 20:26:46,159 ERROR 6 [root] [user None] [ip None] signals.py:22 - Uncaught exception from None
tutor_local-lms-1            | Traceback (most recent call last):
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
tutor_local-lms-1            |     response = get_response(request)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
tutor_local-lms-1            |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
tutor_local-lms-1            |   File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 75, in inner
tutor_local-lms-1            |     return func(*args, **kwds)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
tutor_local-lms-1            |     response = view_func(request, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/common/djangoapps/util/views.py", line 43, in inner
tutor_local-lms-1            |     response = view_func(request, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/common/djangoapps/util/cache.py", line 90, in wrapper
tutor_local-lms-1            |     return view_func(request, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/views/views.py", line 781, in course_about
tutor_local-lms-1            |     course = get_course_with_access(request.user, permission, course_key)
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/courses.py", line 111, in get_course_with_access
tutor_local-lms-1            |     course = get_course_by_id(course_key, depth)
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/core/lib/courses.py", line 97, in get_course_by_id
tutor_local-lms-1            |     course = modulestore().get_course(course_key, depth=depth)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 84, in inner
tutor_local-lms-1            |     retval = func(field_decorator=strip_key_collection, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 406, in get_course
tutor_local-lms-1            |     return store.get_course(course_key, depth=depth, **kwargs)
tutor_local-lms-1            |   File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 75, in inner
tutor_local-lms-1            |     return func(*args, **kwds)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split_draft.py", line 61, in get_course
tutor_local-lms-1            |     return super().get_course(course_id, depth=depth, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 1106, in get_course
tutor_local-lms-1            |     return self._get_structure(course_id, depth, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 1096, in _get_structure
tutor_local-lms-1            |     result = self._load_items(structure_entry, [root], depth, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 780, in _load_items
tutor_local-lms-1            |     return [runtime.load_item(block_key, course_entry, **kwargs) for block_key in block_keys]
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 780, in <listcomp>
tutor_local-lms-1            |     return [runtime.load_item(block_key, course_entry, **kwargs) for block_key in block_keys]
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/caching_descriptor_system.py", line 121, in _load_item
tutor_local-lms-1            |     block = self.xblock_from_json(class_, course_key, block_key, block_data, course_entry_override, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/caching_descriptor_system.py", line 263, in xblock_from_json
tutor_local-lms-1            |     block._field_data = wrapper(block, block._field_data)  # pylint: disable=protected-access
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/field_overrides.py", line 281, in wrap
tutor_local-lms-1            |     enabled_providers = cls._providers_for_block(block)
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/field_overrides.py", line 304, in _providers_for_block
tutor_local-lms-1            |     enabled_providers = [
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/field_overrides.py", line 305, in <listcomp>
tutor_local-lms-1            |     provider_class for provider_class in cls.provider_classes if provider_class.enabled_for(block)  # lint-amnesty, pylint: disable=not-an-iterable
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/features/content_type_gating/field_override.py", line 71, in enabled_for
tutor_local-lms-1            |     return ContentTypeGatingConfig.enabled_for_course(course_key=course.scope_ids.usage_id.course_key)
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/features/content_type_gating/models.py", line 80, in enabled_for_course
tutor_local-lms-1            |     if not correct_modes_for_fbe(course_key):
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/features/content_type_gating/helpers.py", line 40, in correct_modes_for_fbe
tutor_local-lms-1            |     modes = CourseMode.modes_for_course(course_key, include_expired=True, only_selectable=False)
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/core/lib/cache_utils.py", line 74, in decorator
tutor_local-lms-1            |     result = wrapped(*args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/common/djangoapps/course_modes/models.py", line 436, in modes_for_course
tutor_local-lms-1            |     modes = ([mode.to_tuple() for mode in found_course_modes])
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 280, in __iter__
tutor_local-lms-1            |     self._fetch_all()
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 1324, in _fetch_all
tutor_local-lms-1            |     self._result_cache = list(self._iterable_class(self))
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 51, in __iter__
tutor_local-lms-1            |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
tutor_local-lms-1            |     cursor.execute(sql, params)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
tutor_local-lms-1            |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
tutor_local-lms-1            |     return executor(sql, params, many, context)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
tutor_local-lms-1            |     return self.cursor.execute(sql, params)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 73, in execute
tutor_local-lms-1            |     return self.cursor.execute(query, args)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
tutor_local-lms-1            |     res = self._query(query)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 321, in _query
tutor_local-lms-1            |     self._post_get_result()
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 355, in _post_get_result
tutor_local-lms-1            |     self._rows = self._fetch_row(0)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 328, in _fetch_row
tutor_local-lms-1            |     return self._result.fetch_row(size, self._fetch_type)
tutor_local-lms-1            | UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 9: invalid start byte
tutor_local-lms-1            | 2023-08-08 20:26:46,225 ERROR 6 [django.request] [user 6] [IP <edited>] log.py:224 - Internal Server Error: /courses/course-v1:<edited>/about
tutor_local-lms-1            | Traceback (most recent call last):
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
tutor_local-lms-1            |     response = get_response(request)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
tutor_local-lms-1            |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
tutor_local-lms-1            |   File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 75, in inner
tutor_local-lms-1            |     return func(*args, **kwds)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
tutor_local-lms-1            |     response = view_func(request, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/common/djangoapps/util/views.py", line 43, in inner
tutor_local-lms-1            |     response = view_func(request, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/common/djangoapps/util/cache.py", line 90, in wrapper
tutor_local-lms-1            |     return view_func(request, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/views/views.py", line 781, in course_about
tutor_local-lms-1            |     course = get_course_with_access(request.user, permission, course_key)
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/courses.py", line 111, in get_course_with_access
tutor_local-lms-1            |     course = get_course_by_id(course_key, depth)
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/core/lib/courses.py", line 97, in get_course_by_id
tutor_local-lms-1            |     course = modulestore().get_course(course_key, depth=depth)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 84, in inner
tutor_local-lms-1            |     retval = func(field_decorator=strip_key_collection, *args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 406, in get_course
tutor_local-lms-1            |     return store.get_course(course_key, depth=depth, **kwargs)
tutor_local-lms-1            |   File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 75, in inner
tutor_local-lms-1            |     return func(*args, **kwds)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split_draft.py", line 61, in get_course
tutor_local-lms-1            |     return super().get_course(course_id, depth=depth, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 1106, in get_course
tutor_local-lms-1            |     return self._get_structure(course_id, depth, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 1096, in _get_structure
tutor_local-lms-1            |     result = self._load_items(structure_entry, [root], depth, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 780, in _load_items
tutor_local-lms-1            |     return [runtime.load_item(block_key, course_entry, **kwargs) for block_key in block_keys]
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 780, in <listcomp>
tutor_local-lms-1            |     return [runtime.load_item(block_key, course_entry, **kwargs) for block_key in block_keys]
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/caching_descriptor_system.py", line 121, in _load_item
tutor_local-lms-1            |     block = self.xblock_from_json(class_, course_key, block_key, block_data, course_entry_override, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/caching_descriptor_system.py", line 263, in xblock_from_json
tutor_local-lms-1            |     block._field_data = wrapper(block, block._field_data)  # pylint: disable=protected-access
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/field_overrides.py", line 281, in wrap
tutor_local-lms-1            |     enabled_providers = cls._providers_for_block(block)
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/field_overrides.py", line 304, in _providers_for_block
tutor_local-lms-1            |     enabled_providers = [
tutor_local-lms-1            |   File "/openedx/edx-platform/./lms/djangoapps/courseware/field_overrides.py", line 305, in <listcomp>
tutor_local-lms-1            |     provider_class for provider_class in cls.provider_classes if provider_class.enabled_for(block)  # lint-amnesty, pylint: disable=not-an-iterable
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/features/content_type_gating/field_override.py", line 71, in enabled_for
tutor_local-lms-1            |     return ContentTypeGatingConfig.enabled_for_course(course_key=course.scope_ids.usage_id.course_key)
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/features/content_type_gating/models.py", line 80, in enabled_for_course
tutor_local-lms-1            |     if not correct_modes_for_fbe(course_key):
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/features/content_type_gating/helpers.py", line 40, in correct_modes_for_fbe
tutor_local-lms-1            |     modes = CourseMode.modes_for_course(course_key, include_expired=True, only_selectable=False)
tutor_local-lms-1            |   File "/openedx/edx-platform/./openedx/core/lib/cache_utils.py", line 74, in decorator
tutor_local-lms-1            |     result = wrapped(*args, **kwargs)
tutor_local-lms-1            |   File "/openedx/edx-platform/common/djangoapps/course_modes/models.py", line 436, in modes_for_course
tutor_local-lms-1            |     modes = ([mode.to_tuple() for mode in found_course_modes])
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 280, in __iter__
tutor_local-lms-1            |     self._fetch_all()
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 1324, in _fetch_all
tutor_local-lms-1            |     self._result_cache = list(self._iterable_class(self))
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 51, in __iter__
tutor_local-lms-1            |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
tutor_local-lms-1            |     cursor.execute(sql, params)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
tutor_local-lms-1            |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
tutor_local-lms-1            |     return executor(sql, params, many, context)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
tutor_local-lms-1            |     return self.cursor.execute(sql, params)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 73, in execute
tutor_local-lms-1            |     return self.cursor.execute(query, args)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
tutor_local-lms-1            |     res = self._query(query)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 321, in _query
tutor_local-lms-1            |     self._post_get_result()
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 355, in _post_get_result
tutor_local-lms-1            |     self._rows = self._fetch_row(0)
tutor_local-lms-1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 328, in _fetch_row
tutor_local-lms-1            |     return self._result.fetch_row(size, self._fetch_type)
tutor_local-lms-1            | UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 9: invalid start byte

Connecting to the MySQL container and running a simple select query against the course_overviews_courseoverview table crashes the container as well:

SELECT * FROM course_overviews_courseoverview;

Process used to upgrade (from v15.3.7):

pip install --upgrade "tutor[full]" tutor-indigo
tutor config save
tutor images build openedx
tutor local launch

For testing/troubleshooting, I deleted the overview (using the Django admin) for all courses prior to the upgrade which allow to access the Django course overview section afterwards. However, trying the recreate the course details/overview afterward produce the same issue.

I then tried to set MySQL version to 8.0.32 and 8.0.34 instead of 8.0.33 without success.

The only way I was able to complete the upgrade and not run into the issue was to set the MySQL version back to 5.7

pip install --upgrade "tutor[full]" tutor-indigo
tutor config save --set DOCKER_IMAGE_MYSQL="docker.io/mysql:5.7.43"
tutor images build openedx
tutor local launch

Then once the upgrade was completed to v16.0.3, unset the MySQL parameter version to upgrade to v8.0.33

tutor config save --unset DOCKER_IMAGE_MYSQL
tutor local launch

With this process, tutor is now running properly without issue and the MySQL container is not crashing.

It seems the tutor upgrade which runs a number of migrations and also the MySQL upgrade to v8.0.33 is corrupting the course_overviews_courseoverview table causing the issue.

Environment
Amazon EC2 t3.xlarge
OS: Ubuntu 22.04
Docker version: 24.0.5
Docker compose: 2.20.2
Tutor # of courses: 9
tutor config:

CMS_HOST: <edited>
CMS_OAUTH2_SECRET: <edited>
CONTACT_EMAIL: <edited>
CORS_ORIGIN_ALLOW_ALL: true
DISCOVERY_MYSQL_PASSWORD: <edited>
DISCOVERY_OAUTH2_SECRET: <edited>
DISCOVERY_OAUTH2_SECRET_SSO: <edited>
DISCOVERY_SECRET_KEY: <edited>
ELASTICSEARCH_HEAP_SIZE: 2g
ENABLE_HTTPS: true
ENABLE_WEB_PROXY: false
ID: <edited>
JWT_RSA_PRIVATE_KEY: '-----BEGIN RSA PRIVATE KEY-----

  <edited>

  -----END RSA PRIVATE KEY-----'
LANGUAGE_CODE: en
LMS_HOST: <edited>
MYSQL_ROOT_PASSWORD: <edited>
NOTES_MYSQL_PASSWORD: <edited>
NOTES_OAUTH2_SECRET: <edited>
NOTES_SECRET_KEY: <edited>
OPENEDX_MYSQL_PASSWORD: <edited>
OPENEDX_SECRET_KEY: <edited>
PLATFORM_NAME: <edited>
PLUGINS:
- customcert
- forum
- indigo
- mfe
- ms365-auth
- notes
- webui
PLUGIN_INDEXES:
- https://overhang.io/tutor/main
RUN_SMTP: true
SMTP_HOST: <edited>
SMTP_PASSWORD: <edited>
SMTP_PORT: 587
SMTP_USERNAME: <edited>
SMTP_USE_TLS: true

Plugin customcert:

name: customcert
version: 1.0.0
patches:
  common-env-features: |
    CUSTOM_CERTIFICATE_TEMPLATES_ENABLED: true
    ORGANIZATIONS_APP: true
    CERTIFICATES_HTML_VIEW: true

Plugin ms365-auth:

name: ms365-auth
version: 1.0.0
patches:
  openedx-common-settings: |
     CORS_ORIGIN_WHITELIST.append("https://<edited>")
  common-env-features: |
    "ENABLE_THIRD_PARTY_AUTH": true
  openedx-auth: |
    "SOCIAL_AUTH_OAUTH_SECRETS": {"azuread-oauth2": "<edited>"}
  lms-env: |
    "THIRD_PARTY_AUTH_BACKENDS": ["<edited>"]

I have kept an AWS snapshot on v15.3.7 to help troubleshoot further if needed.

@regisb regisb added the bug Bugs will be investigated and fixed as quickly as possible. label Aug 9, 2023
@regisb
Copy link
Contributor

regisb commented Aug 9, 2023

Thanks for the detailed information @nratineau, this is super useful.

SELECT * FROM course_overviews_courseoverview;

Is it just this query that causes the container to crash, or did you observe the same behaviour with other queries on different tables?

@regisb regisb moved this from Backlog to In Progress in Tutor project management Aug 9, 2023
@nratineau
Copy link
Author

nratineau commented Aug 10, 2023

@regisb I have reconfigured a new test environment with the data.
As mentioned if I run the query:
SELECT * FROM course_overviews_courseoverview;
the mysql container crash.

I can query one item without the mysql container crashing.
Here is a query with on an instance upgrade from v15.3.7 to v16.0.5 which also perform the mysql upgrade:

mysql> select * from course_overviews_courseoverview where course_overviews_courseoverview.id LIKE '%course-v1:Edited+001+basics%';
+----------------------------+----------------------------+-----------+-----------------------------+-----------------------------------------------------+--------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+----------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+----------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------+--------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+----------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
| created                    | modified                   | version   | id                          | _location                                           | display_name | display_number_with_default | display_org_with_default | start                      | end                        | advertised_start | course_image_url                                                     | social_sharing_url | end_of_course_survey_url | certificates_display_behavior | certificates_show_before_end | cert_html_view_enabled | has_any_active_web_certificate | cert_name_short | cert_name_long | lowest_passing_grade | days_early_for_beta | mobile_available | visible_to_staff_only | _pre_requisite_courses_json | enrollment_start           | enrollment_end             | enrollment_domain | invitation_only | max_student_enrollments_allowed | announcement | catalog_visibility | course_video_url | effort | short_description                                           | org    | self_paced | marketing_url | eligible_for_financial_aid | language | certificate_available_date | end_date | start_date | banner_image_url                                                     | has_highlights | allow_proctoring_opt_out | enable_proctored_exams | proctoring_escalation_email | proctoring_provider | entrance_exam_enabled | entrance_exam_id | entrance_exam_minimum_score_pct | external_id |
+----------------------------+----------------------------+-----------+-----------------------------+-----------------------------------------------------+--------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+----------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+----------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------+--------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+----------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
| 0000-00-00 00:00:00.000000 | 2022-05-22 15:59:15.095071 | 430993150 | course-v1:Edited+001+basics | 	M#?  block-v1:Edited+001+basics+type@course+bloc | k@course     | POR                         | TING!0                   | 6286-05-06 28:39:15.612934 | 2022-05-26 00:00:00.000000 | NULL             | ???     /asset-v1:Edited+001+basics+type@asset+block@Cover-Edited-aca | NULL               | NULL                     | dem                           |                           -7 |                    -82 |                            -16 |                 |                |                    0 |                NULL |              -18 |                   -28 | ??                          | 0039-05-00 06:05:63.411997 | 2022-05-26 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ??                 | NULL             | NULL   |    ?bothPorting: what it is and how it works with Edited an | d KA |        -49 | NULL          |                        -82 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ???     /asset-v1:Edited+001+basics+type@asset+block@images_course_i |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
+----------------------------+----------------------------+-----------+-----------------------------+-----------------------------------------------------+--------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+----------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+----------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------+--------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+----------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
1 row in set, 1 warning (0.00 sec)

Here is the same query on the database upgrade from v15.3.7 to v16 by first upgrading tutor with mysql v5.7 then upgrading to mysqlv8 afterwards:

mysql> select * from course_overviews_courseoverview where course_overviews_courseoverview.id LIKE '%course-v1:Edited+001+basics%';
+----------------------------+----------------------------+---------+-----------------------------+-----------------------------------------------------+--------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+----------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+----------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------+--------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+----------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
| created                    | modified                   | version | id                          | _location                                           | display_name | display_number_with_default | display_org_with_default | start                      | end                        | advertised_start | course_image_url                                                     | social_sharing_url | end_of_course_survey_url | certificates_display_behavior | certificates_show_before_end | cert_html_view_enabled | has_any_active_web_certificate | cert_name_short | cert_name_long | lowest_passing_grade | days_early_for_beta | mobile_available | visible_to_staff_only | _pre_requisite_courses_json | enrollment_start           | enrollment_end             | enrollment_domain | invitation_only | max_student_enrollments_allowed | announcement | catalog_visibility | course_video_url | effort | short_description                                           | org    | self_paced | marketing_url | eligible_for_financial_aid | language | certificate_available_date | end_date | start_date | banner_image_url                                                     | has_highlights | allow_proctoring_opt_out | enable_proctored_exams | proctoring_escalation_email | proctoring_provider | entrance_exam_enabled | entrance_exam_id | entrance_exam_minimum_score_pct | external_id |
+----------------------------+----------------------------+---------+-----------------------------+-----------------------------------------------------+--------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+----------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+----------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------+--------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+----------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
| 2022-05-22 15:59:15.095071 | 2023-08-08 23:58:58.998197 |      18 | course-v1:Edited+001+basics | block-v1:Edited+001+basics+type@course+block@course | PORTING!     | 001                         | Edited                   | 2022-05-26 00:00:00.000000 | 2030-05-25 00:00:00.000000 | NULL             | /asset-v1:Edited+001+basics+type@asset+block@Cover-Edited-academy.png | NULL               | NULL                     | end                           |                            0 |                      1 |                              0 |                 |                |                 0.97 |                NULL |                0 |                     0 | []                          | 2022-05-26 00:00:00.000000 | 2030-05-25 00:00:00.000000 | NULL              |               0 |                            NULL | NULL         | both               | NULL             | NULL   | Porting: what it is and how it works with Edited and Edited. | Edited |          1 | NULL          |                          1 | en       | 2030-05-27 00:00:00.000000 | NULL     | NULL       | /asset-v1:Edited+001+basics+type@asset+block@images_course_image.jpg |              0 |                        0 |                      0 | NULL                        | null                |                     0 |                  |                            0.65 | NULL        |
+----------------------------+----------------------------+---------+-----------------------------+-----------------------------------------------------+--------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+----------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+----------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------+--------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+----------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
1 row in set (0.01 sec)

The course_modes_coursemode table seems to also have corrupted data.
Instance upgrade from v15.3.7 to v16.0.5 which also perform the mysql upgrade:

mysql> select * from course_modes_coursemode;
+----+-----------+-------------------------------------+-------------------+-------------+--------------------------------+---------------------+-----------------+------------------+-------------+------+---------------------------------+----------+-------------+---------+
| id | course_id | mode_slug                           | mode_display_name | min_price   | currency                       | expiration_datetime | expiration_date | suggested_prices | description | sku  | expiration_datetime_is_explicit | bulk_sku | android_sku | ios_sku |
+----+-----------+-------------------------------------+-------------------+-------------+--------------------------------+---------------------+-----------------+------------------+-------------+------+---------------------------------+----------+-------------+---------+
|  2 |           | course-v1:Edited+000+bootcamp       | honor             | -1032884364 | camp?                          | NULL                | NULL            | usd              | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  3 |           | course-v1:internal+000+self         | honor             |  -982620311 | neering Bootcamp Cert Mo?      | NULL                | NULL            | usd              | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  4 |           | course-v1:Edited+004+course_v1      | honor             |  -932221329 | r?                             | NULL                | NULL            | usd              | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  5 |           | course-v1:Edited+001+basics         | honor             |  -798002572 | ing_honor?                     | NULL                | NULL            | usd              | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  6 |           | course-v1:Edited+001+core_knowledge | honor             |  -932221329 | r?                             | NULL                | NULL            | usd              | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  7 |           | course-v1:Edited+003+basics         | honor             |  -932221329 | r?                             | NULL                | NULL            | usd              | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
+----+-----------+-------------------------------------+-------------------+-------------+--------------------------------+---------------------+-----------------+------------------+-------------+------+---------------------------------+----------+-------------+---------+
6 rows in set (0.00 sec)

Database upgrade from v15.3.7 to v16 by first upgrading tutor with mysql v5.7 then upgrading to mysqlv8 afterwards:

mysql> select * from course_modes_coursemode;
+----+-------------------------------------+-----------+--------------------------------+-----------+----------+---------------------+-----------------+------------------+-------------+------+---------------------------------+----------+-------------+---------+
| id | course_id                           | mode_slug | mode_display_name              | min_price | currency | expiration_datetime | expiration_date | suggested_prices | description | sku  | expiration_datetime_is_explicit | bulk_sku | android_sku | ios_sku |
+----+-------------------------------------+-----------+--------------------------------+-----------+----------+---------------------+-----------------+------------------+-------------+------+---------------------------------+----------+-------------+---------+
|  2 | course-v1:Edited+000+bootcamp       | honor     | Bootcamp                       |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  3 | course-v1:internal+000+self         | honor     | Engineering Bootcamp Cert Mode |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  4 | course-v1:Edited+004+course_v1      | honor     | Honor                          |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  5 | course-v1:Edited+001+basics         | honor     | Porting_honor                  |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  6 | course-v1:Edited+001+core_knowledge | honor     | Honor                          |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  7 | course-v1:Edited+003+basics         | honor     | Honor                          |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  8 | course-v1:Edited+005+basics         | honor     | honor                          |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
|  9 | course-v1:Edited+007+2023           | honor     | honor                          |         0 | usd      | NULL                | NULL            |                  | NULL        | NULL |                               0 | NULL     | NULL        | NULL    |
+----+-------------------------------------+-----------+--------------------------------+-----------+----------+---------------------+-----------------+------------------+-------------+------+---------------------------------+----------+-------------+---------+
8 rows in set (0.00 sec)

Other tables I have tested don't seem to have any issue, only the course_overviews_courseoverview table crashes the container and course_modes_coursemode has bad data.

regisb added a commit that referenced this issue Aug 15, 2023
This fix is for a rather serious issue that affects users who upgrade
from Olive to Palm. The client mysql charset and collation was
incorrectly set to utf8mb4, while the server stil runs utf8mb3. Only
users who run the mysql container are affected.

To resolve this issue, we explicitely configure the client to use the
utf8mb3 charset/collation.

Important note: users who have somehow managed to upgrade from olive to
Palm before may find themselves in an undefined state. They might have
to fix their mysql data manually. Same thing for users who launched Palm
from scratch.

Close #887.
regisb added a commit that referenced this issue Aug 15, 2023
This fix is for a rather serious issue that affects users who upgrade
from Olive to Palm. The client mysql charset and collation was
incorrectly set to utf8mb4, while the server stil runs utf8mb3. Only
users who run the mysql container are affected.

To resolve this issue, we explicitely configure the client to use the
utf8mb3 charset/collation.

Important note: users who have somehow managed to upgrade from olive to
Palm before may find themselves in an undefined state. They might have
to fix their mysql data manually. Same thing for users who launched Palm
from scratch; although, according to my preliinary tests, they should be
able to downgrade their connection from utf8mb4 to utf8mb3 without
issue.

Close #887.
@regisb
Copy link
Contributor

regisb commented Aug 15, 2023

Thanks for the details @nratineau. I have discovered that the issue stems from an incorrect charset/collation from the client side. Here's a more complete explanation with a proposed fix: #890
The problem is that I'm not sure how this fix will affect users who already run Palm. They might end up with some corrupt data and fix it manually.

I could definitely use some help on this important issue. Would you mind having a look at the PR and comment there?

@nratineau
Copy link
Author

nratineau commented Aug 15, 2023

@regisb I will try to have a deeper look this week but it might have to wait until next week. I did a quick run with the changes from the PR.
Data is still corrupted, however the container is not crashing anymore when running a select on the data. Though still getting 500 after the direct upgrade even with the collation changes.

Data is still corrupted but can query the whole table without crashing the container:

mysql> select * from course_overviews_courseoverview;
+----------------------------+----------------------------+-----------+-------------------------------------+-------------------------------------------------------------+----------------------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+------------------------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+---------------------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------------+----------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+------------------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
| created                    | modified                   | version   | id                                  | _location                                                   | display_name               | display_number_with_default | display_org_with_default | start                      | end                        | advertised_start | course_image_url                                                                   | social_sharing_url | end_of_course_survey_url | certificates_display_behavior | certificates_show_before_end | cert_html_view_enabled | has_any_active_web_certificate | cert_name_short | cert_name_long            | lowest_passing_grade | days_early_for_beta | mobile_available | visible_to_staff_only | _pre_requisite_courses_json | enrollment_start           | enrollment_end             | enrollment_domain | invitation_only | max_student_enrollments_allowed | announcement | catalog_visibility | course_video_url | effort | short_description                                                 | org      | self_paced | marketing_url | eligible_for_financial_aid | language | certificate_available_date | end_date | start_date | banner_image_url                                                             | has_highlights | allow_proctoring_opt_out | enable_proctored_exams | proctoring_escalation_email | proctoring_provider | entrance_exam_enabled | entrance_exam_id | entrance_exam_minimum_score_pct | external_id |
+----------------------------+----------------------------+-----------+-------------------------------------+-------------------------------------------------------------+----------------------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+------------------------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+---------------------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------------+----------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+------------------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
| 0000-00-00 00:00:00.000000 | 2022-05-20 09:50:25.632210 | 430954726 | course-v1:Edited+000+bootcamp       | k	?G?  block-v1:Edited+000+bootcamp+type@course+bloc       | k@courseEdited Academy:     | Boo                         | tcamp0                   | 6286-09-06 28:39:15.612934 | 2022-05-24 00:00:00.000000 | NULL             | ??     /asset-v1:Edited+000+bootcamp+type@asset+block@Cover_Edited_academy         | NULL               | NULL                     | __1                           |                          -33 |                    -82 |                            -16 | ngend???C       | ompletedCertificate of Co |                    0 |                NULL |              -27 |                   -12 | io                          | 1378-05-31 25:57:63.365219 | 2022-05-24 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ??                 | NULL             | NULL   |    ?bothIntroduction to Edited and the UI application ec   | osyste   |        -19 | NULL          |                        -82 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ??     /asset-v1:Edited+000+bootcamp+type@asset+block@images_course_i       |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
| 0000-00-00 00:00:00.000000 | 2022-05-22 15:59:15.095071 | 430993150 | course-v1:Edited+001+basics         | 	M#?  block-v1:Edited+001+basics+type@course+bloc         | k@course                   | POR                         | TING!0                   | 6286-05-06 28:39:15.612934 | 2022-05-26 00:00:00.000000 | NULL             | ???     /asset-v1:Edited+001+basics+type@asset+block@Cover-edited-aca               | NULL               | NULL                     | dem                           |                           -7 |                    -82 |                            -16 |                 |                           |                    0 |                NULL |              -18 |                   -28 | ??                          | 0039-05-00 06:05:63.411997 | 2022-05-26 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ??                 | NULL             | NULL   |    ?bothPorting: what it is and how it works with Edited an       | d Edited   |        -49 | NULL          |                        -82 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ???     /asset-v1:Edited+001+basics+type@asset+block@images_course_i         |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
??  block-v1:Edited+001+core_knowledge+type@course+bloc | k@courseCustomer Types wit | h 2                         | Edited0                   | 6286-01-06 28:39:15.612934 | 2022-05-26 00:00:00.000000 | NULL             | ???     /asset-v1:Edited+001+core_knowledge+type@asset+block@Cover-edited-academy   | NULL               | NULL                     | __1                           |                          -33 |                    -82 |                            -16 |                 |                           |                    0 |                NULL |              -18 |                   -28 | ??                          | 0039-05-00 06:13:63.411997 | 2022-05-26 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ??                 | NULL             | NULL   |                                                                   |    ?bo   |        -12 | NULL          |                        -24 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ???     /asset-v1:Edited+001+core_knowledge+type@asset+block@images_course_i |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
| 0000-00-00 00:00:00.000000 | 2022-05-27 09:24:43.194451 | 430999296 | course-v1:Edited+003+basics         | ??$?  block-v1:Edited+003+basics+type@course+bloc         | k@courseAccounts           |  Ma                         | nager0                   | 6285-10-06 28:39:15.612934 | 2022-05-27 00:00:00.000000 | NULL             | ???     /asset-v1:Edited+003+basics+type@asset+block@Cover-Edited-acad              | NULL               | NULL                     | emy                           |                          -78 |                    -82 |                            -16 |                 |                           |                    0 |                NULL |              -18 |                   -28 | ??                          | 0039-05-00 03:09:63.411997 | 2022-05-27 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ??                 | NULL             | NULL   |    ?bothUsing the Accounts Manager application to run your organi | zation   |        -95 | NULL          |                        -96 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ??     /asset-v1:Edited+003+basics+type@asset+block@images_course_i         |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
| 0000-00-00 00:00:00.000000 | 2023-05-15 10:25:17.242306 | 430976770 | course-v1:Edited+004+course_v1      | ?
?	?  block-v1:Edited+004+course_v1+type@course+bloc      | k@coursePro                | vis                         | ioner0                   | 6285-06-06 28:39:15.612934 | 2023-01-01 00:00:00.000000 | NULL             | ???     /asset-v1:Edited+004+course_v1+type@asset+block@Cover-Edited-academy        | NULL               | NULL                     |                               |                          -33 |                    -33 |                            -78 |                 |                           |                    0 |                NULL |              -18 |                   -25 | ??                          | 0118-02-00 06:13:63.411997 | 2023-01-01 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ??                 | NULL             | NULL   |    ?bothAll things Provi                                          | sioner   |        -95 | NULL          |                        -96 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ???     /asset-v1:Edited+004+course_v1+type@asset+block@images_course_i      |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
| 0000-00-00 00:00:00.000000 | 2023-08-07 14:13:34.376247 | 431018234 | course-v1:Edited+005+basics         | ???  block-v1:Edited+005+basics+type@course+bloc         | k@courseDebug              | gin                         | g App0                   | 6285-02-06 28:39:15.612934 | 2023-08-08 00:00:00.000000 | NULL             | ??     /asset-v1:Edited+005+basics+type@asset+block@images_course_i                | NULL               | NULL                     | mag                           |                          -27 |                    -82 |                            -22 |                 |                           |                    0 |                NULL |              -18 |                   -28 | ??                          | 0039-05-00 03:09:63.411997 | 2023-08-08 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ?                  | NULL             | NULL   |                                                                   |    ?bo   |        -12 | NULL          |                        -24 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ??     /asset-v1:Edited+005+basics+type@asset+block@images_course_i          |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
| 0000-00-00 00:00:00.000000 | 2023-08-02 13:40:17.148363 | 431017682 | course-v1:Edited+007+2023           | 
                                                                                                             n?  block-v1:Edited+007+2023+type@course+bloc           | k@courseCarr               | ier                         | s App0                   | 6284-07-06 28:39:15.612934 | 2023-08-08 00:00:00.000000 | NULL             | ???     /asset-v1:Edited+007+2023+type@asset+block@images_course_i                 | NULL               | NULL                     | mage.jpgearly                 |                          -33 |                    -18 |                            -17 |                 |                           |                    0 |                NULL |              -26 |                   -17 | ??                          | 0039-05-00 03:09:63.411997 | NULL                       | NULL              |              25 |                            NULL | NULL         | ??                 | NULL             |    ?b  | oth01:00The Carriers Application and how to                       | use it   |        -82 | NULL          |                        -96 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ???     /asset-v1:Edited+007+2023+type@asset+block@images_course_i           |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
| 0000-00-00 00:00:00.000000 | 2022-06-22 14:32:56.185583 | 430813029 | course-v1:Edited+MUM123+MUM123      | ???  block-v1:Edited+MUM123+MUM123+type@course+bloc      | k@courseSuper              |  Secre                      | t!MUM1                   | 6128-03-06 28:39:15.612934 | 2010-01-01 00:00:00.000000 | NULL             | ??     /asset-v1:Edited+MUM123+MUM123+type@asset+block@images_course_i            | NULL               | NULL                     | mag                           |                          -27 |                    -82 |                            -22 |                 |                           |                    0 |                NULL |              -18 |                   -28 | ??                          | NULL                       | NULL                       | NULL              |               0 |                            NULL | NULL         | ? 2?               | NULL             | NULL   |                                                                   | ?[]?no   |        -18 | NULL          |                        -27 | 26       | 6286-08-27 24:21:63.297106 | NULL     | NULL       | ??"     /asset-v1:Edited+MUM123+MUM123+type@asset+block@images_course_i      |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
| 0000-00-00 00:00:00.000000 | 2022-07-20 11:20:43.109025 | 431018200 | course-v1:internal+000+self         | ?C??  block-v1:internal+000+self+type@course+bloc         | k@courseEngineering        | Boo                         | tcamp000                 | 1777-09-05 25:42:13.543316 | 2022-05-01 01:00:00.000000 | NULL             | ???     /asset-v1:internal+000+self+type@asset+block@c85e02d1f751c9ad3419324d83eb3 | NULL               | NULL                     | d88                           |                          -82 |                    -22 |                            -16 |                 |                           |                    0 |                NULL |              -18 |                   -28 | ??                          | 0118-02-00 06:05:63.411997 | 2020-07-05 00:00:00.000000 | NULL              |              25 |                            NULL | NULL         | ?                 | NULL             | NULL   |   ?aboutStarting point for internal engineering and sysadmin t    | raining. |        -23 | NULL          |                        -18 | te       | 1068-10-15 09:13:63.297106 | NULL     | NULL       | ??l     /asset-v1:internal+000+self+type@asset+block@images_course_i         |            -19 |                      -31 |                    -25 | NULL                        | e.jp                |                   -25 |                  |        -1.2648951620734705e-306 | NULL        |
+----------------------------+----------------------------+-----------+-------------------------------------+-------------------------------------------------------------+----------------------------+-----------------------------+--------------------------+----------------------------+----------------------------+------------------+------------------------------------------------------------------------------------+--------------------+--------------------------+-------------------------------+------------------------------+------------------------+--------------------------------+-----------------+---------------------------+----------------------+---------------------+------------------+-----------------------+-----------------------------+----------------------------+----------------------------+-------------------+-----------------+---------------------------------+--------------+--------------------+------------------+--------+-------------------------------------------------------------------+----------+------------+---------------+----------------------------+----------+----------------------------+----------+------------+------------------------------------------------------------------------------+----------------+--------------------------+------------------------+-----------------------------+---------------------+-----------------------+------------------+---------------------------------+-------------+
9 rows in set, 9 warnings (0.00 sec)```

Structure looks good though.

mysql> describe course_overviews_courseoverview;
+---------------------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------------+--------------+------+-----+---------+-------+
| created | datetime(6) | NO | | NULL | |
| modified | datetime(6) | NO | | NULL | |
| version | int | NO | | NULL | |
| id | varchar(255) | NO | PRI | NULL | |
| _location | varchar(255) | NO | | NULL | |
| display_name | longtext | YES | | NULL | |
| display_number_with_default | longtext | NO | | NULL | |
| display_org_with_default | longtext | NO | | NULL | |
| start | datetime(6) | YES | | NULL | |
| end | datetime(6) | YES | | NULL | |
| advertised_start | longtext | YES | | NULL | |
| course_image_url | longtext | NO | | NULL | |
| social_sharing_url | longtext | YES | | NULL | |
| end_of_course_survey_url | longtext | YES | | NULL | |
| certificates_display_behavior | longtext | YES | | NULL | |
| certificates_show_before_end | tinyint(1) | NO | | NULL | |
| cert_html_view_enabled | tinyint(1) | NO | | NULL | |
| has_any_active_web_certificate | tinyint(1) | NO | | NULL | |
| cert_name_short | longtext | NO | | NULL | |
| cert_name_long | longtext | NO | | NULL | |
| lowest_passing_grade | decimal(5,2) | YES | | NULL | |
| days_early_for_beta | double | YES | | NULL | |
| mobile_available | tinyint(1) | NO | | NULL | |
| visible_to_staff_only | tinyint(1) | NO | | NULL | |
| _pre_requisite_courses_json | longtext | NO | | NULL | |
| enrollment_start | datetime(6) | YES | | NULL | |
| enrollment_end | datetime(6) | YES | | NULL | |
| enrollment_domain | longtext | YES | | NULL | |
| invitation_only | tinyint(1) | NO | | NULL | |
| max_student_enrollments_allowed | int | YES | | NULL | |
| announcement | datetime(6) | YES | | NULL | |
| catalog_visibility | longtext | YES | | NULL | |
| course_video_url | longtext | YES | | NULL | |
| effort | longtext | YES | | NULL | |
| short_description | longtext | YES | | NULL | |
| org | longtext | NO | | NULL | |
| self_paced | tinyint(1) | NO | | NULL | |
| marketing_url | longtext | YES | | NULL | |
| eligible_for_financial_aid | tinyint(1) | NO | | NULL | |
| language | longtext | YES | | NULL | |
| certificate_available_date | datetime(6) | YES | | NULL | |
| end_date | datetime(6) | YES | | NULL | |
| start_date | datetime(6) | YES | | NULL | |
| banner_image_url | longtext | NO | | NULL | |
| has_highlights | tinyint(1) | YES | | NULL | |
| allow_proctoring_opt_out | tinyint(1) | NO | | NULL | |
| enable_proctored_exams | tinyint(1) | NO | | NULL | |
| proctoring_escalation_email | longtext | YES | | NULL | |
| proctoring_provider | longtext | YES | | NULL | |
| entrance_exam_enabled | tinyint(1) | NO | | NULL | |
| entrance_exam_id | varchar(255) | NO | | NULL | |
| entrance_exam_minimum_score_pct | double | NO | | NULL | |
| external_id | varchar(128) | YES | | NULL | |
+---------------------------------+--------------+------+-----+---------+-------+
53 rows in set (0.00 sec)


```mysql> check table course_overviews_courseoverview;
+-----------------------------------------+-------+----------+---------------------------------------------------+
| Table                                   | Op    | Msg_type | Msg_text                                          |
+-----------------------------------------+-------+----------+---------------------------------------------------+
| openedx.course_overviews_courseoverview | check | Warning  | InnoDB: The B-tree of index PRIMARY is corrupted. |
| openedx.course_overviews_courseoverview | check | error    | Corrupt                                           |
+-----------------------------------------+-------+----------+---------------------------------------------------+
2 rows in set (0.00 sec)```

regisb added a commit that referenced this issue Aug 16, 2023
This fix is for a rather serious issue that affects users who upgrade
from Olive to Palm. The client mysql charset and collation was
incorrectly set to utf8mb4, while the server stil runs utf8mb3. Only
users who run the mysql container are affected.

To resolve this issue, we explicitely configure the client to use the
utf8mb3 charset/collation.

Important note: users who have somehow managed to upgrade from olive to
Palm before may find themselves in an undefined state. They might have
to fix their mysql data manually. Same thing for users who launched Palm
from scratch; although, according to my preliinary tests, they should be
able to downgrade their connection from utf8mb4 to utf8mb3 without
issue.

In addition, we upgrade to mysql 8.1.0. Among many other fixes, this
avoids a server restart after the upgrade:

> An in-place upgrade from MySQL 5.7 to MySQL 8.0, without a server
> restart, could result in unexpected errors when executing queries on
> tables. This fix eliminates the need to restart the server between the
> upgrade and queries. (Bug #35410528)

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html

See also the 8.1.0 release notes:

https://dev.mysql.com/doc/relnotes/mysql/8.1/en/news-8-1-0.html

Close #887.
regisb added a commit that referenced this issue Aug 16, 2023
This fix is for a rather serious issue that affects users who upgrade
from Olive to Palm. The client mysql charset and collation was
incorrectly set to utf8mb4, while the server stil runs utf8mb3. Only
users who run the mysql container are affected.

To resolve this issue, we explicitely configure the client to use the
utf8mb3 charset/collation.

Important note: users who have somehow managed to upgrade from olive to
Palm before may find themselves in an undefined state. They might have
to fix their mysql data manually. Same thing for users who launched Palm
from scratch; although, according to my preliinary tests, they should be
able to downgrade their connection from utf8mb4 to utf8mb3 without
issue.

In addition, we upgrade to mysql 8.1.0. Among many other fixes, this
avoids a server restart after the upgrade:

> An in-place upgrade from MySQL 5.7 to MySQL 8.0, without a server
> restart, could result in unexpected errors when executing queries on
> tables. This fix eliminates the need to restart the server between the
> upgrade and queries. (Bug #35410528)

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html

See also the 8.1.0 release notes:

https://dev.mysql.com/doc/relnotes/mysql/8.1/en/news-8-1-0.html

Close #887.
regisb added a commit that referenced this issue Aug 16, 2023
This fix is for a rather serious issue that affects users who upgrade
from Olive to Palm. The client mysql charset and collation was
incorrectly set to utf8mb4, while the server stil runs utf8mb3. Only
users who run the mysql container are affected.

To resolve this issue, we explicitely configure the client to use the
utf8mb3 charset/collation.

Important note: users who have somehow managed to upgrade from olive to
Palm before may find themselves in an undefined state. They might have
to fix their mysql data manually. Same thing for users who launched Palm
from scratch; although, according to my preliinary tests, they should be
able to downgrade their connection from utf8mb4 to utf8mb3 without
issue.

In addition, we upgrade to mysql 8.1.0. Among many other fixes, this
avoids a server restart after the upgrade:

> An in-place upgrade from MySQL 5.7 to MySQL 8.0, without a server
> restart, could result in unexpected errors when executing queries on
> tables. This fix eliminates the need to restart the server between the
> upgrade and queries. (Bug #35410528)

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html

See also the 8.1.0 release notes:

https://dev.mysql.com/doc/relnotes/mysql/8.1/en/news-8-1-0.html

Close #887.
@github-project-automation github-project-automation bot moved this from In Progress to Done in Tutor project management Aug 16, 2023
moonesque pushed a commit to edSPIRIT/tutor that referenced this issue Nov 20, 2023
This fix is for a rather serious issue that affects users who upgrade
from Olive to Palm. The client mysql charset and collation was
incorrectly set to utf8mb4, while the server stil runs utf8mb3. Only
users who run the mysql container are affected.

To resolve this issue, we explicitely configure the client to use the
utf8mb3 charset/collation.

Important note: users who have somehow managed to upgrade from olive to
Palm before may find themselves in an undefined state. They might have
to fix their mysql data manually. Same thing for users who launched Palm
from scratch; although, according to my preliinary tests, they should be
able to downgrade their connection from utf8mb4 to utf8mb3 without
issue.

In addition, we upgrade to mysql 8.1.0. Among many other fixes, this
avoids a server restart after the upgrade:

> An in-place upgrade from MySQL 5.7 to MySQL 8.0, without a server
> restart, could result in unexpected errors when executing queries on
> tables. This fix eliminates the need to restart the server between the
> upgrade and queries. (Bug #35410528)

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html

See also the 8.1.0 release notes:

https://dev.mysql.com/doc/relnotes/mysql/8.1/en/news-8-1-0.html

Close overhangio#887.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs will be investigated and fixed as quickly as possible.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants