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

idoit-install incorrectly detects MariaDB version #40

Closed
muttersda opened this issue May 6, 2024 · 3 comments · Fixed by #42
Closed

idoit-install incorrectly detects MariaDB version #40

muttersda opened this issue May 6, 2024 · 3 comments · Fixed by #42
Assignees

Comments

@muttersda
Copy link

Expected behavior

Script detects correct MariaDB version and proceeds with the installation.

Actual behavior

The script detects the version as "10.6." (note the trailing period), causing the "case" statement to default to "*", and resulting in this error message:

"MariaDB 10.6. is not supported. Please follow the system requirements. We recommend version 10.6."

At this point, the script ends without completing the installation.

The offending line is 1409:

mariadb_version=$(mysql --version | head -n1 -c29 | tail -c 5)

Steps to reproduce the behavior

Attempt to run idoit-install on a server running a version of MariaDB that includes a period after the major version number, such as "10.6.16-MariaDB". This is the version available by default in Ubuntu Server 22.04.4.

Environment

Question Answer
i-doit version cloned from main on 5-6-24, merge pull request 93108b7
i-doit edition open
Operating system (OS) Ubuntu Server
OS version 22.04.4 LTS

Server logs

Do you want to configure MariaDB? [Y]es [n]o:
Configure MariaDB DBMS
Please enter the MariaDB hostname [leave empty for 'localhost']:
Please enter a new password for MariaDB's super user 'root' [leave empty for 'idoit']:
Set root password and plugin 'mysql_native_password'
MariaDB 10.6. is not supported. Please follow the system requirements. We recommend version 10.6.
Operation failed. Please check what is wrong and try again.

mysql --version | head -n1

mysql Ver 15.1 Distrib 10.6.16-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

@muttersda muttersda changed the title idoit-install Incorrectly detects MariaDB Version idoit-install incorrectly detects MariaDB version May 6, 2024
@muttersda
Copy link
Author

Correction: this affects both lines 1409 and 1516 of "idoit-install".

I tried changing them to this (using sed to remove the trailing period) and it's now working for me:
mariadb_version=$(mysql --version | head -n1 -c29 | tail -c 5 | sed -e 's/.$//')

@muttersda
Copy link
Author

muttersda commented May 8, 2024

This catches more edge cases (including different length of version string):

mariadb_version=$(mysql --version | head -n1 | sed -e 's/.* Distrib \([0-9]*\.[0-9]*\)\.[0-9]*.*/\1/')

@MichaelOv MichaelOv self-assigned this Jun 4, 2024
@MichaelOv
Copy link
Member

Hey @muttersda
thanks for your help.

I have tested it on Ubuntu and RHEL 8 and it works 👍🏼

MichaelOv added a commit that referenced this issue Jun 4, 2024
@MichaelOv MichaelOv linked a pull request Jun 4, 2024 that will close this issue
MichaelOv added a commit that referenced this issue Sep 18, 2024
…ts-mariadb-version

#40-idoit-install-incorrectly-detects-mariadb-version
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 a pull request may close this issue.

2 participants