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

Patch 23 / docs broken for manual install of rocketmap.sql. #1168

Open
JabLuszko opened this issue Jun 28, 2021 · 0 comments
Open

Patch 23 / docs broken for manual install of rocketmap.sql. #1168

JabLuszko opened this issue Jun 28, 2021 · 0 comments
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.

Comments

@JabLuszko
Copy link
Contributor

Seems like patch_23 is broken if you (kinda) follow the official docs and install database schema manually from scripts/SQL/rocketmap.sql and then try to start MAD it will try to go via all patches and error exit.

Probably remove that rocketmap.sql part from docs and let MAD handle all the tables creation.
Also if we let people use the rocketmap.sql it should probably contain the current version (so like 44 for now), so first one won't trigger 44 patches and spam a lot of errors.

[zz:~/testmad/MAD]$ mysql -D MAD < scripts/SQL/rocketmap.sql
[zz:~/testmad/MAD]$ venv/bin/python3 start.py
[06-28 03:29:21.39] [          Unknown] [I] Setting log level to 20 (INFO).
[06-28 03:29:21.39] [           system] [I] Starting MAD in config mode
[06-28 03:29:22.06] [           system] [I] Connecting to DB
[06-28 03:29:22.16] [           system] [I] Partial schema detected.  Additional steps required
[06-28 03:29:22.16] [           system] [I] New installation detected with a partial schema detected.  Updates will be attempted
[06-28 03:29:22.18] [           system] [S] Moved internal MAD version to database as version 0
[06-28 03:29:22.47] [           system] [W] Performing updates from version 0 to 44 now
[06-28 03:29:22.47] [           system] [I] Patches to apply: [1, 2, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44]
[06-28 03:29:22.47] [           system] [I] Applying patch: Patch 1
[06-28 03:29:22.52] [           system] [S] Successfully applied patch
[06-28 03:29:22.53] [           system] [I] Applying patch: Patch 2
[06-28 03:29:22.72] [           system] [S] Successfully applied patch
[06-28 03:29:22.72] [           system] [I] Applying patch: Patch 7
[06-28 03:29:22.85] [           system] [E] Failed executing query: ALTER TABLE trs_status CHANGE currentPos currentPos VARCHAR(50) NULL DEFAULT NULL, CHANGE lastPos lastPos VARCHAR(50) NULL DEFAULT NULL, CHANGE routePos routePos INT(11) NULL DEFAULT NULL, CHANGE routeMax routeMax INT(11) NULL DEFAULT NULL, CHANGE rebootingOption rebootingOption TEXT NULL, CHANGE rebootCounter rebootCounter INT(11) NULL DEFAULT NULL, CHANGE routemanager routemanager VARCHAR(255) NULL DEFAULT NULL, CHANGE lastProtoDateTime lastProtoDateTime VARCHAR(50), CHANGE lastPogoRestart lastPogoRestart VARCHAR(50), CHANGE init init TEXT NULL, CHANGE restartCounter restartCounter TEXT NULL (None), error: 1054 (42S22): Unknown column 'routemanager' in 'trs_status'
[06-28 03:29:22.85] [           system] [E] Failed executing query: ALTER TABLE trs_status CHANGE currentPos currentPos VARCHAR(50) NULL DEFAULT NULL, CHANGE lastPos lastPos VARCHAR(50) NULL DEFAULT NULL, CHANGE routePos routePos INT(11) NULL DEFAULT NULL, CHANGE routeMax routeMax INT(11) NULL DEFAULT NULL, CHANGE rebootingOption rebootingOption TEXT NULL, CHANGE rebootCounter rebootCounter INT(11) NULL DEFAULT NULL, CHANGE routemanager routemanager VARCHAR(255) NULL DEFAULT NULL, CHANGE lastProtoDateTime lastProtoDateTime VARCHAR(50), CHANGE lastPogoRestart lastPogoRestart VARCHAR(50), CHANGE init init TEXT NULL, CHANGE restartCounter restartCounter TEXT NULL (None), error: 1054 (42S22): Unknown column 'routemanager' in 'trs_status'
[06-28 03:29:22.86] [           system] [S] Successfully applied patch
[06-28 03:29:22.86] [           system] [I] Applying patch: Patch 8
[06-28 03:29:22.89] [           system] [S] Successfully applied patch
[06-28 03:29:22.89] [           system] [I] Applying patch: Patch 9
[06-28 03:29:22.93] [           system] [S] Successfully applied patch
[06-28 03:29:22.93] [           system] [I] Applying patch: Patch 10
[06-28 03:29:22.95] [           system] [S] Successfully applied patch
[06-28 03:29:22.95] [           system] [I] Applying patch: Patch 11
[06-28 03:29:22.98] [           system] [S] Successfully applied patch
[06-28 03:29:22.98] [           system] [I] Applying patch: Patch 12
[06-28 03:29:23.04] [           system] [S] Successfully applied patch
[06-28 03:29:23.04] [           system] [I] Applying patch: Patch 13
[06-28 03:29:23.06] [           system] [S] Successfully applied patch
[06-28 03:29:23.07] [           system] [I] Applying patch: Patch 14
[06-28 03:29:23.08] [           system] [S] Successfully applied patch
[06-28 03:29:23.09] [           system] [I] Applying patch: Patch 15
[06-28 03:29:23.09] [           system] [S] Successfully applied patch
[06-28 03:29:23.10] [           system] [I] Applying patch: Patch 16
[06-28 03:29:23.12] [           system] [S] Successfully applied patch
[06-28 03:29:23.12] [           system] [I] Applying patch: Database Migration
[06-28 03:29:23.13] [           system] [S] Successfully applied patch
[06-28 03:29:23.14] [           system] [I] Applying patch: Patch 18
[06-28 03:29:23.14] [           system] [E] Failed executing query: ALTER TABLE `trs_status` CHANGE `instance` `instance` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; (None), error: 1054 (42S22): Unknown column 'instance' in 'trs_status'
[06-28 03:29:23.14] [           system] [E] Failed executing query: ALTER TABLE `trs_status` CHANGE `instance` `instance` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; (None), error: 1054 (42S22): Unknown column 'instance' in 'trs_status'
[06-28 03:29:23.18] [           system] [S] Successfully applied patch
[06-28 03:29:23.18] [           system] [I] Applying patch: MADmin APK Wizard
[06-28 03:29:23.22] [           system] [S] Successfully applied patch
[06-28 03:29:23.22] [           system] [I] Applying patch: Update trs_status
[06-28 03:29:23.26] [           system] [E] Patch was unsuccessful.  Exiting
Traceback (most recent call last):

  File "start.py", line 203, in <module>
    MADPatcher(args, data_manager)
    │          │     └ <mapadroid.data_manager.DataManager object at 0x7ff8ad101f40>
    │          └ Namespace(DEBUG=False, adb_server_ip='127.0.0.1', adb_server_port=5037, apk_storage_interface='fs', autoconfig_no_auth=False,...
    └ <class 'mapadroid.patcher.MADPatcher'>

  File "/MAD/mapadroid/patcher/__init__.py", line 78, in __init__
    self.__update_mad()
    └ <mapadroid.patcher.MADPatcher object at 0x7ff8ad101f10>

  File "/MAD/mapadroid/patcher/__init__.py", line 247, in __update_mad
    self.__apply_update(patch_ver)
    │                   └ 23
    └ <mapadroid.patcher.MADPatcher object at 0x7ff8ad101f10>

> File "/MAD/mapadroid/patcher/__init__.py", line 93, in __apply_update
    patch = patch_base.Patch(logger, self.dbwrapper, self.data_manager, self._application_args)
            │          │     │       │    │          │    │             │    └ Namespace(DEBUG=False, adb_server_ip='127.0.0.1', adb_server_port=5037, apk_storage_interface='fs', autoconfig_no_auth=False,...
            │          │     │       │    │          │    │             └ <mapadroid.patcher.MADPatcher object at 0x7ff8ad101f10>
            │          │     │       │    │          │    └ <mapadroid.data_manager.DataManager object at 0x7ff8ad101f40>
            │          │     │       │    │          └ <mapadroid.patcher.MADPatcher object at 0x7ff8ad101f10>
            │          │     │       │    └ <mapadroid.db.DbWrapper.DbWrapper object at 0x7ff8ad171940>
            │          │     │       └ <mapadroid.patcher.MADPatcher object at 0x7ff8ad101f10>
            │          │     └ <loguru.logger handlers=[(id=1, level=20, sink=<stdout>), (id=2, level=40, sink=<stderr>), (id=3, level=20, sink='logs/202106...
            │          └ <class 'mapadroid.patcher.patch_23.Patch'>
            └ <module 'mapadroid.patcher.patch_23' from '/MAD/mapadroid/patcher/patch_23.py'>

  File "/MAD/mapadroid/patcher/_patch_base.py", line 35, in __init__
    self._execute()
    │    └ <function Patch._execute at 0x7ff8ad11f670>
    └ <mapadroid.patcher.patch_23.Patch object at 0x7ff8aeaabdf0>

  File "/MAD/mapadroid/patcher/patch_23.py", line 19, in _execute
    if not existing_data:

UnboundLocalError: local variable 'existing_data' referenced before assignment
[06-28 03:29:23.26] [           system] [E] Patch was unsuccessful.  Exiting
Traceback (most recent call last):
  File "start.py", line 203, in <module>
    MADPatcher(args, data_manager)
  File "/MAD/mapadroid/patcher/__init__.py", line 78, in __init__
    self.__update_mad()
  File "/MAD/mapadroid/patcher/__init__.py", line 247, in __update_mad
    self.__apply_update(patch_ver)
> File "/MAD/mapadroid/patcher/__init__.py", line 93, in __apply_update
    patch = patch_base.Patch(logger, self.dbwrapper, self.data_manager, self._application_args)
  File "/MAD/mapadroid/patcher/_patch_base.py", line 35, in __init__
    self._execute()
  File "/MAD/mapadroid/patcher/patch_23.py", line 19, in _execute
    if not existing_data:
UnboundLocalError: local variable 'existing_data' referenced before assignment
@Expl0dingBanana Expl0dingBanana added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

No branches or pull requests

2 participants