ELEVEN
ELEVEN

Reputation: 11

AWS Beanstalk deployement issue

I am a beginner on AWS. I have been trying to deploy a web application on beanstalk but have been unsuccessful. I used Codepiple to connect to my Github but the deploy execution failed. I checked the log file of the beanstalk and it says:

Collecting flask_mysqldb==1.0.1
  Using cached Flask-MySQLdb-1.0.1.tar.gz (4.3 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting Flask_SQLAlchemy==2.5.1
  Using cached Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl (17 kB)
Collecting Pillow==9.3.0
  Using cached Pillow-9.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
Collecting mysql==0.0.3
  Using cached mysql-0.0.3-py3-none-any.whl (1.2 kB)
Collecting mysqlclient==2.1.1
  Using cached mysqlclient-2.1.1.tar.gz (88 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

2022/12/15 22:45:50.073862 [INFO]   error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /bin/sh: mysql_config: command not found
      /bin/sh: mariadb_config: command not found
      /bin/sh: mysql_config: command not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup.py", line 15, in <module>
          metadata, options = get_config()
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup_posix.py", line 70, in get_config
          libs = mysql_config("libs")
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup_posix.py", line 31, in mysql_config
          raise OSError("{} not found".format(_mysql_config_path))
      OSError: mysql_config not found
      mysql_config --version
      mariadb_config --version
      mysql_config --libs
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

2022/12/15 22:45:50.073898 [ERROR] An error occurred during execution of command [app-deploy] - [InstallDependency]. Stop running the command. Error: fail to install dependencies with requirements.txt file with error Command /bin/sh -c /var/app/venv/staging-LQM1lest/bin/pip install -r requirements.txt failed with error exit status 1. Stderr:  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /bin/sh: mysql_config: command not found
      /bin/sh: mariadb_config: command not found
      /bin/sh: mysql_config: command not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup.py", line 15, in <module>
          metadata, options = get_config()
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup_posix.py", line 70, in get_config
          libs = mysql_config("libs")
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup_posix.py", line 31, in mysql_config
          raise OSError("{} not found".format(_mysql_config_path))
      OSError: mysql_config not found
      mysql_config --version
      mariadb_config --version
      mysql_config --libs
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.

I have this on my requirements.txt

aiohttp==3.8.3
Django==4.1.4
Flask==2.0.2
Flask_Login==0.6.0
flask_mysqldb==1.0.1
Flask_SQLAlchemy==2.5.1
Pillow==9.3.0
mysql==0.0.3
mysqlclient==2.1.1
Werkzeug==2.0.0
jinja2~=3.0.3

I'm not sure on how to solve this problem.

Upvotes: 0

Views: 135

Answers (1)

MrBiTs
MrBiTs

Reputation: 11

The errors are:

  OSError: mysql_config not found
  mysql_config --version
  mariadb_config --version
  mysql_config --libs

Seems that you didn't install any mysql client package in your environment. If you are using a container, check if your Dockerfile is installing this tool.

Upvotes: 1

Related Questions