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

Pre-4.0.0 Config Files Cannot Be Used and Need Migrated #6

Closed
thw26 opened this issue Dec 28, 2023 · 7 comments · Fixed by #29
Closed

Pre-4.0.0 Config Files Cannot Be Used and Need Migrated #6

thw26 opened this issue Dec 28, 2023 · 7 comments · Fixed by #29
Labels
bug Something isn't working cli Related to the CLI, optargs, or TUI migration This issue is related to upgrades across versions regression Related to something that was working but is not
Milestone

Comments

@thw26
Copy link
Collaborator

thw26 commented Dec 28, 2023

Attempting to run the binary with -h|--help reports the following error when the program hasn't been run at least once:

./dist/LogosLinuxInstaller -h

ERROR:root:Error decoding config file /home/thwright/.config/Logos_on_Linux/Logos_on_Linux.conf: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "LogosLinuxInstaller.py", line 241, in <module>
  File "LogosLinuxInstaller.py", line 146, in main
    switch_logging()
  File "config.py", line 104, in set_config_env
    logos_error(f"Error: Unable to get config at {config_file_path}")
NameError: name 'logos_error' is not defined
[11339] Failed to execute script 'LogosLinuxInstaller' due to unhandled exception!

This also applies to running the main script:

./LogosLinuxInstaller.py -h

ERROR:root:Error decoding config file /home/thwright/.config/Logos_on_Linux/Logos_on_Linux.conf: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/thwright/Dev/LogosLinuxInstaller/./LogosLinuxInstaller.py", line 223, in <module>
    main()
  File "/home/thwright/Dev/LogosLinuxInstaller/./LogosLinuxInstaller.py", line 128, in main
    config.set_config_env(config.CONFIG_FILE)
  File "/home/thwright/Dev/LogosLinuxInstaller/config.py", line 104, in set_config_env
    logos_error(f"Error: Unable to get config at {config_file_path}")
    ^^^^^^^^^^^
NameError: name 'logos_error' is not defined
@thw26 thw26 added bug Something isn't working alpha regression Related to something that was working but is not cli Related to the CLI, optargs, or TUI labels Dec 28, 2023
@thw26 thw26 added this to the Beta milestone Dec 28, 2023
@thw26
Copy link
Collaborator Author

thw26 commented Dec 28, 2023

This issue appears to be related to having an old config file in the config dir. The workaround is to move it or delete it.

We may want to add some migration code. Or even a "test if json" check.

@thw26 thw26 added the migration This issue is related to upgrades across versions label Dec 28, 2023
@thw26 thw26 changed the title The -h|--help optarg does not work until the config has been generated Pre-4.0.0 Config Files Cannot Be Used and Need Migrated Dec 29, 2023
@n8marti
Copy link
Collaborator

n8marti commented Dec 30, 2023

I think you're right. The ultimate error you're seeing is because logos_error wasn't getting imported into config.py. When I fix that, I get this output:

$ ./LogosLinuxInstaller.py -h
ERROR:root:Error decoding config file /home/nate/.config/Logos_on_Linux/Logos_on_Linux.conf: Expecting value: line 2 column 1 (char 1)
CRITICAL:root:Error: Unable to get config at /home/nate/.config/Logos_on_Linux/Logos_on_Linux.conf
If you need help, please consult:
https://github.com/ferion11/LogosLinuxInstaller/wiki
https://t.me/linux_logos
https://matrix.to/#/#logosbible:matrix.org
Processus arrêté

So then the question becomes what to do about it? I like the config migration idea. Can you send me a valid config file from the bash script? I can see what it might take to convert it.

@thw26
Copy link
Collaborator Author

thw26 commented Dec 30, 2023

Here is a config I backed up before running the Python app.

# INSTALL OPTIONS
FLPRODUCT="Logos"
FLPRODUCTi="logos4"
TARGETVERSION="10"
INSTALLDIR="/home/thwright/LogosBible10"
APPDIR="/home/thwright/LogosBible10/data"
APPDIR_BINDIR="/home/thwright/LogosBible10/data/bin"
WINETRICKSBIN="/home/thwright/LogosBible10/data/bin/winetricks"
WINEPREFIX="/home/thwright/LogosBible10/data/wine64_bottle"
WINEBIN_CODE="Proton"
WINE_EXE="/home/thwright/bin/wine64"
WINESERVER_EXE="/home/thwright/bin/wineserver"
WINE64_APPIMAGE_FULL_URL="https://github.com/ferion11/LogosLinuxInstaller/releases/download/v10.0-1/wine-staging_7.18-x86_64.AppImage"
APPIMAGE_LINK_SELECTION_NAME="selected_wine.AppImage"
WINE64_APPIMAGE_FULL_FILENAME="wine-staging_7.18-x86_64.AppImage"
LOGOS_EXECUTABLE="Logos_v10.1.0.0056-x64.msi"
LOGOS_EXE="/home/thwright/LogosBible10/data/wine64_bottle/drive_c/users/steamuser/AppData/Local/Logos/Logos.exe"
LOGOS_DIR="$(dirname "${LOGOS_EXE}")"

# RUN OPTIONS
LOGS="DISABLED"

# RESTORE OPTIONS
BACKUPDIR=""

One of these appears to be broken: LOGOS_DIR.

I would think the main thing we could migrate would be the WINE_EXE, WINESERVER_EXE, the APPIMAGE bin, and the APPDIR.

An issue we will bump into though is if a user tries to install an AppImage install and but the previous install is using a system binary. In general, our check for a previous install should solve that, but if we ever want to be able to update an install in place, I would think we would need to do something more. The issues I'm thinking of that could be of some conflict are:

ferion11/LogosLinuxInstaller#130
ferion11/LogosLinuxInstaller#211

That being said, we don't need to solve those in this issue, as they will require a fair amount of work.

Once we release, I would see ferion11/LogosLinuxInstaller/issues/130 as being our next big target for improvement.

@thw26
Copy link
Collaborator Author

thw26 commented Dec 31, 2023

One last thought: another config var available only post-login that is useful for backups is the random Logos user ID. This should be visible in the backup/restore code in Bash. We might want to add this to the config. This is how Logos would recognize different logins on the same device.

This was obtained in the launcher.

@n8marti
Copy link
Collaborator

n8marti commented Dec 31, 2023

One of these appears to be broken: LOGOS_DIR.

If LOGOS_EXE is already known/defined, then LOGOS_DIR can always just be found/set at runtime. For that matter, the same goes for APPDIR and INSTALLDIR, and I think FLPRODUCT and TARGETVERSION, right, since they are used to create INSTALLDIR?

@n8marti
Copy link
Collaborator

n8marti commented Jan 1, 2024

Another possibility to consider is to call the v4+ config file Logos_on_Linux.json. This would allow Logos_on_Linux.conf to be converted to JSON without being overwritten, and it would be clearer what format the contents are in.

@thw26
Copy link
Collaborator Author

thw26 commented Jan 1, 2024

Another possibility to consider is to call the v4+ config file Logos_on_Linux.json. This would allow Logos_on_Linux.conf to be converted to JSON without being overwritten, and it would be clearer what format the contents are in.

This would certainly be the easiest solution and follows naming scheme better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the CLI, optargs, or TUI migration This issue is related to upgrades across versions regression Related to something that was working but is not
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants