Skip to content

made some changes to database naming - #43

Closed
thatgirlginger wants to merge 5 commits into
otwcode:masterfrom
thatgirlginger:master
Closed

thatgirlginger wants to merge 5 commits into
otwcode:masterfrom
thatgirlginger:master

Conversation

@thatgirlginger

@thatgirlginger thatgirlginger commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

changed the way databases are named in MySQL from using their full filepaths to just the end. I added a new function to opendoors/utils.py to create a second variable from the full filepath, since it seemed in most cases that file paths and database names were being used in two distinct stages anyways, and swapped the variable out for the creation of the database

i also reconciled the file naming between the original and simplified steps. the original sequence was adding the prefix onto the edited file name created in the class initialization, but this was essentially creating an uber-nested backup for the first eFiction step

also made minor copyedits in the README; instructions indicated python3, but the examples for command line used python, so changed to python3

@thatgirlginger

Copy link
Copy Markdown
Contributor Author

for additional bug info and steps to reproduce:

the issue was happening while running Debian 13 (Trixie) and MacOS Sequoia 15.7.7. all logs are from the MacOS runs, as my CPU temperatures on Debian currently handle the eFiction processor rather poorly

running the eFiction converter as instructed in the README produced this error in Step 01:

2026-09-06 12:30:37,966 ERROR Traceback (most recent call last):
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/opendoors/progress.py", line 27, in continue_from_last
    run_next = step.run()
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/steps/step_01.py", line 19, in run
    original.load_original_file(self.step_path)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/efiction/original.py", line 145, in load_original_file
    self.__load_into_database(step_path, statements)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/efiction/original.py", line 132, in __load_into_database
    self.sql.drop_database(self.edited_db_name)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/opendoors/mysql.py", line 122, in drop_database
    cursor.execute(f"DROP DATABASE IF EXISTS {database};")
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 558, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 822, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 1200, in read
    first_packet = self.connection._read_packet()
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 772, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/Users/***************/Documents/programming/otw-od/training/working_efiction_or' at line 1")

after wrapping the offending line (122 in opendoors/mysql.py) in a try/except block, the program would crash while attempting to load the step's information into the database as such:

2026-09-06 12:32:36,985 ERROR Traceback (most recent call last):
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/opendoors/progress.py", line 27, in continue_from_last
    run_next = step.run()
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/steps/step_01.py", line 19, in run
    original.load_original_file(self.step_path)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/efiction/original.py", line 148, in load_original_file
    self.__load_into_database(step_path, statements)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/efiction/original.py", line 138, in __load_into_database
    self.sql.load_sql_file_into_db(edited_file)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/open-doors-eFiction/opendoors/mysql.py", line 62, in load_sql_file_into_db
    cursor.execute(statement)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 558, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 822, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 1200, in read
    first_packet = self.connection._read_packet()
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/connections.py", line 772, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/***************/Documents/programming/otw-od/otwenv/lib/python3.14/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1059, "Identifier name '/users/***************/documents/programming/otw-od/training/working_efiction_original' is too long")

according to the MySQL 8.4 reference docs, most identifier types are limited at 64 characters (https://dev.mysql.com/doc/refman/8.4/en/identifier-length.html)

attached is an abbreviated and PII-redacted version of the log file.
working.log

@thatgirlginger
thatgirlginger marked this pull request as draft September 6, 2026 23:05
@thatgirlginger
thatgirlginger marked this pull request as ready for review September 7, 2026 00:40

@hlieberman hlieberman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked this over with the contributor; the underlying issue is improper validation of the codename attribute in start.py.

@thatgirlginger thatgirlginger closed this by deleting the head repository Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants