geerlingguy / ansible-for-devops

Ansible for DevOps examples.
https://www.ansiblefordevops.com
MIT License
8.52k stars 3.47k forks source link

Flask example is failing in CI tests currently #548

Open geerlingguy opened 1 year ago

geerlingguy commented 1 year ago

Starting recently, I'm seeing fails like:

Exception: Can not find valid pkg-config name.', '  Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually

Example: https://github.com/geerlingguy/ansible-for-devops/actions/runs/5414349720/jobs/9853496042

melroy89 commented 1 year ago

I think your Docker image is missing pkg-config: RUN apt-get update && apt-get install -y pkg-config

It's actually saying:

Processing triggers for libc-bin (2.31-0ubuntu9.9) ...', 'Removing intermediate container f888e18c8de7', ' ---> 4831587376f2', 'Step 5/11 : RUN pip3 install flask flask-sqlalchemy mysqlclient', '', ' ---> Running in 1a76c1360c0e', 'Collecting flask', '  Downloading Flask-2.3.2-py3-none-any.whl (96 kB)', 'Collecting flask-sqlalchemy', '  Downloading flask_sqlalchemy-3.0.5-py3-none-any.whl (24 kB)', 'Collecting mysqlclient', '  Downloading mysqlclient-2.2.0.tar.gz (89 kB)', '  Installing build dependencies: started', \"  Installing build dependencies: finished with status 'done'\", '  Getting requirements to build wheel: started', \"  Getting requirements to build wheel: finished with status 'error'\", '\\x1b[91m  ERROR: Command errored out with exit status 1:', '   command: /usr/bin/python3 /tmp/tmpii9tb_rv get_requires_for_build_wheel /tmp/tmpzxzyq3qq', '       cwd: /tmp/pip-install-d_w8211m/mysqlclient', '  Complete output (24 lines):', '  /bin/sh: 1: pkg-config: not found', '  /bin/sh: 1: pkg-config: not found', '  Trying pkg-config --exists mysqlclient', \"  Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127.\", '  Trying pkg-config --exists mariadb', \"  Command 'pkg-config --exists mariadb' returned non-zero exit status 127.\", '  Traceback (most recent call last):', '    File \"/tmp/tmpii9tb_rv\", line 280, in <module>', '      main()', '    File \"/tmp/tmpii9tb_rv\", line 263, in main', \"      json_out['return_val'] = hook(**hook_input['kwargs'])\", '    File \"/tmp/tmpii9tb_rv\", line 114, in get_requires_for_build_wheel', '      return hook(config_settings)', '    File \"/tmp/pip-build-env-i1f59vry/overlay/lib/python3.8/site-packages/setuptools/build_meta.py\", line 341, in get_requires_for_build_wheel', \"      return self._get_build_requires(config_settings, requirements=['wheel'])\", '    File \"/tmp/pip-build-env-i1f59vry/overlay/lib/python3.8/site-packages/setuptools/build_meta.py\", line 323, in _get_build_requires', '      self.run_setup()', '    File \"/tmp/pip-build-env-i1f59vry/overlay/lib/python3.8/site-packages/setuptools/build_meta.py\", line 338, in run_setup', '      exec(code, locals())', '    File \"<string>\", line 154, in <module>', '    File \"<string>\", line 48, in get_config_posix', '    File \"<string>\", line 27, in find_package_name', '  Exception: Can not find valid pkg-config name.', '  Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually', '  ----------------------------------------', '\\x1b[0m', '\\x1b[91mERROR: Command errored out with exit status 1: /usr/bin/python3 /tmp/tmpii9tb_rv get_requires_for_build_wheel /tmp/tmpzxzyq3qq Check the logs for full command output.', '\\x1b[0m', 'Removing intermediate container 1a76c1360c0e']"}

https://github.com/geerlingguy/ansible-for-devops/actions/runs/5703795432/job/15456777719#logs