Failed to install Koa in AWS Ubuntu 20.04 (mysql-client error)

TASK [mysql : install mysql-5.7-client] ****************************************
fatal: [localhost]: FAILED! => {“cache_update_time”: 1611644091, “cache_updated”: true, “changed”: false, “msg”: “’/usr/bin/apt-get -y -o “Dpkg::Options::=–force-confdef” -o “Dpkg::Options::=–force-confold” install ‘mysql-client=5.7.32-1ubuntu18.04’’ failed: E: Version ‘5.7.32-1ubuntu18.04’ for ‘mysql-client’ was not found\n”, “rc”: 100, “stderr”: “E: Version ‘5.7.32-1ubuntu18.04’ for ‘mysql-client’ was not found\n”, “stderr_lines”: [“E: Version ‘5.7.32-1ubuntu18.04’ for ‘mysql-client’ was not found”], “stdout”: “Reading package lists…\nBuilding dependency tree…\nReading state information…\n”, “stdout_lines”: [“Reading package lists…”, “Building dependency tree…”, “Reading state information…”]}

According to the instructions Ubuntu 20.04 is needed.
However, when I follow the instructions I saw errors during mysql-client. It looks like mysql 5.7 is no longer available in 20.04.

1 Like

I’m facing same issue while installing Koa native.

"stderr": "E: Version '5.7.32-1ubuntu18.04' for 'mysql-client' was not found\n"

Is it good idea to use bionic source list for MySQL 5.7, or it might be conflict with dependencies?

+1
Has anyone resolved this?

The MySQL version 5.7.32-1ubuntu18.04 was replaced by 5.7.33-1ubuntu18.04 in the Ubuntu repository but the Ansible script for open-release/koa.1 was not updated. It was updated in open-release/koa.master though.

If you install from the open-release/koa.master branch it should work.

As far as I know, the bionic repository only contains MySQL 8. The installation script replaces the APT sources list and will force the installation of the 5.7 version. To install MySQL 8 you would have to edit the Ansible scripts but I suspect it would cause other problems.

The easiest solution is to install from the open-release/koa.master branch.

Thank you for the information :slight_smile:

The change was made in master only, I requested to cherry pick in koa.master.

Still the same error, i just try an installation right now, and it failed:

TASK [mysql : Remove experimental version of mysql] ****************************
[DEPRECATION WARNING]: Invoking “apt” only once while using a loop via
squash_actions is deprecated. Instead of using a loop to supply multiple items
and specifying name: "{{ item }}", please use name: ['mysql-server-5.6', 'mysql-server'] and remove the loop. This feature will be removed in version
2.11. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
skipping: [localhost] => (item=)

TASK [mysql : Install mysql dependencies] **************************************
ok: [localhost]

TASK [mysql : Install mysql] ***************************************************
skipping: [localhost]

TASK [mysql : Set default character sets and collations] ***********************
skipping: [localhost]

TASK [mysql : add the mysql signing key] ***************************************
changed: [localhost]

TASK [mysql : add the mysql-5.7 repo to the sources list] **********************
changed: [localhost]

TASK [mysql : install mysql-5.7-client] ****************************************
fatal: [localhost]: FAILED! => {“cache_update_time”: 1612114379, “cache_updated”: false, “changed”: false, “msg”: “‘/usr/bin/apt-get -y -o "Dpkg::Options::=–force-confdef" -o "Dpkg::Options::=–force-confold" install ‘mysql-client=5.7.32-1ubuntu18.04’’ failed: E: Version ‘5.7.32-1ubuntu18.04’ for ‘mysql-client’ was not found\n”, “rc”: 100, “stderr”: “E: Version ‘5.7.32-1ubuntu18.04’ for ‘mysql-client’ was not found\n”, “stderr_lines”: [“E: Version ‘5.7.32-1ubuntu18.04’ for ‘mysql-client’ was not found”], “stdout”: “Reading package lists…\nBuilding dependency tree…\nReading state information…\n”, “stdout_lines”: [“Reading package lists…”, “Building dependency tree…”, “Reading state information…”]}

PLAY RECAP *********************************************************************
localhost : ok=57 changed=24 unreachable=0 failed=1 skipped=189 rescued=0 ignored=1

============================================================
Ansible failed!

Decoded error:
No message to decode.

============================================================
Installation failed!

If you need help, see Connect - Open edX .
When asking for help, please provide as much information as you can.
These might be helpful:
Your log file is at /root/logs/install-20210131-182439.log
Your environment:
OPENEDX_RELEASE=open-release/koa.master

Hello @Herve_siyou

You need to change the config files in /var/tmp/configuration, did you do that ?

Regards

Eriam

Hello @eriam

No i didn’t.

Please can you tell me exactly what to change?

@Herve_siyou look at the commits on github: https://github.com/edx/configuration/pull/6248/commits

They show what you need to change to get the installation working.

1 Like

@eriam IT WORKS!!!

Edit the file:

nano /var/tmp/configuration/playbooks/roles/mysql/defaults/main.yml

changed:

mysql_server_5_7_pkg: “mysql-server=5.7.32-1ubuntu18.04”
mysql_client_5_7_pkg: “mysql-client=5.7.32-1ubuntu18.04”
mysql_community_server_5_7_pkg: “mysql-server=5.7.32-1ubuntu18.04”

to:

mysql_server_5_7_pkg: “mysql-server=5.7.33-1ubuntu18.04”
mysql_client_5_7_pkg: “mysql-client=5.7.33-1ubuntu18.04”
mysql_community_server_5_7_pkg: “mysql-server=5.7.33-1ubuntu18.04”

And edit the file:

nano /var/tmp/configuration/playbooks/edx_continuous_integration.yml

changed:

mongo_3_6

to:

mongo_4_0

Thank you!

2 Likes

Hi thread followers,

We’ll be looking into this as part of the build-test-release working group’s work on releasing Koa.2 next Tuesday. (Thanks for the PR, @amit!)

C/C @nedbat

3 Likes

Thanks for following through on this issue, i just encountered it as well last night.

Kind regards
James

Turns out we missed the fix for koa.2 yesterday, but we made up for it today with koa.2a.

Thank you all for reporting the bug, and the fix!

Hi, I am new to openedx technology and have Ansible failed! message.
Followed what Herve_siyou has suggested but to no avail.

I just ran into the same issue with latest Ubuntu Server 20.04.2. Apparently, the mysql-client version has been bumped to 5.7.34 now.

I fixed this issue by changing the file, as discussed above:
/var/tmp/configuration/playbooks/edx_continuous_integration.yml

2 Likes

The solution above was working until recently the mysql 5.7.33 started giving error again. So based on technique above, we need to change 2 files.
Mongo 3_6 → 4_0 and mysql, but instead of mysql version 33 change the number to 34.
File:

nano /var/tmp/configuration/playbooks/roles/mysql/defaults/main.yml

mysql_server_5_7_pkg: "mysql-server=5.7.34-1ubuntu18.04"
mysql_client_5_7_pkg: "mysql-client=5.7.34-1ubuntu18.04"
mysql_community_server_5_7_pkg: "mysql-server=5.7.34-1ubuntu18.04"

and mongo as stated previously:

nano /var/tmp/configuration/playbooks/edx_continuous_integration.yml
mongo_3_6 → mongo_4_0

1 Like

Hello,

I tried to install Koa in Ubuntu 20.04 from open-release/koa.master but I got this error:

E: Version '5.7.34-1ubuntu18.04' for 'mysql-client' was not found

any solution for this?

Thank you in advance.

I solved this the same way as done in the previous answers.
Just use the next possible version (replace 34 with 35) in the file:

nano /var/tmp/configuration/playbooks/roles/mysql/defaults/main.yml

Once replaced you should have those lines instead:

mysql_server_5_7_pkg: "mysql-server=5.7.35-1ubuntu18.04"
mysql_client_5_7_pkg: "mysql-client=5.7.35-1ubuntu18.04"
mysql_community_server_5_7_pkg: "mysql-server=5.7.35-1ubuntu18.04"

I don’t think it’s a good practice to commit a new mysql version number each time.
Shouldn’t we add instead an ansible task to retrieve the first available mysql version that satisfies a given constraint ? (e.g. Look for whatever mysql 5.7.x-1ubuntu18.04)

I just tried this and it is insufficient on a vanilla GCE Ubuntu 20.04 VM. There is no available repo to provide MySQL 5.7.anything since it uses 8.x only.

I would go a step further and look for whatever MySQL version is available on the Ubuntu release and not restrict it to 5.7. I realize that may mean updating some code but hopefully, 5.7 and 8 are not incompatible? If so, maybe the maple release should just bite the bullet and upgrade to 8.whatever?