Page MenuHomePhabricator

Kubernetes containers do not include /usr/bin/mysql
Open, LowPublic


I have a CGI (Bash) script in a tool account's public_html on Toolforge which is supposed to run a fixed MySQL query on the database replica and output its result. I am convinced it used to work before, but now it's broken because /usr/bin/mysql is not available to the webservice at all.

Event Timeline

Blahma created this task.Dec 3 2019, 2:20 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 3 2019, 2:20 PM
bd808 added a subscriber: bd808.Wed, Jan 1, 6:43 PM

@Blahma Which backend are you using to run your webservice? I think the issue here is that you have legacy code which is expecting to run on the job grid which has a very broad set of software installed. When running on the Kubernetes backend your webservice is hosted inside a Docker container which has a very narrow set of installed software. The php5.6, php7.2, and php7.3 runtimes for the Kubernetes backend do include mariadb libraries and their PHP bindings, but they do not include cli tools like /usr/bin/mysql.

The fix is either to update your tool to use PHP to query the database, or to run your tool on the grid engine rather than on Kubernetes. The first option is a bit more work, but recommended as the grid engine backend is not as robust for keeping webservices running as Kubernetes is.

bd808 renamed this task from Missing /usr/bin binaries in webservices, including /usr/bin/mysql to Kubernetes containers do not include /usr/bin/mysql.Wed, Jan 1, 6:44 PM
bd808 triaged this task as Low priority.
bd808 edited projects, added Toolforge; removed cloud-services-team.

@bd808: Hello, thank you for investigating this. I didn't mean to create anything fancy – just an HTTP gateway to executed a fixed SQL query on the database replica and obtain its results.

That's why I chose Bash and CGI (as mentioned in the original post) because that means just a few lines of code in a .sh file. If that is not supported, that should probably be documented somewhere and I should think of replacing it with a PHP script, although I consider that an overkill for such a simple task as dumping the results of a database query.

for the record, just mentioning here