opencve / opencve-docker

Docker Image packaging for OpenCVE
https://www.opencve.io
Other
41 stars 38 forks source link

Error: pg_config executable not found. when Downloading psycopg2-binary-2.8.4.tar.gz on docker compose #43

Open jugpoi1 opened 1 year ago

jugpoi1 commented 1 year ago

Expected Behavior

Go to the next step docker-compose up -d postgres redis webserver celery_worker

Actual Behavior

docker compose was unsuccessful due to Error: pg_config executable not found.

Despite psycopg2 was installed and version 2.9.6.

Steps to Reproduce the Problem

following Docker installation, reach and type below command $docker-compose build

Build will cease when it reaches Downloading psycopg2-binary-2.8.4.tar.gz. There will be an error as shown below

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'

error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [35 lines of output] running egg_info writing psycopg2_binary.egg-info/PKG-INFO writing dependency_links to psycopg2_binary.egg-info/dependency_links.txt writing top-level names to psycopg2_binary.egg-info/top_level.txt /tmp/pip-build-env-5dzbzw8b/overlay/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg !!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.

          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)

  Error: pg_config executable not found.

  pg_config is required to build psycopg2 from source.  Please add the directory
  containing pg_config to the $PATH or specify the full executable path with the
  option:

      python setup.py build_ext --pg-config /path/to/pg_config build ...

  or with the pg_config option in 'setup.cfg'.

  If you prefer to avoid building psycopg2 from source, please install the PyPI
  'psycopg2-binary' package instead.

  For further information please check the 'doc/src/install.rst' file (also at
  <http://initd.org/psycopg/docs/install.html>).

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR:

Specifications

Screenshots (optional)

matiferrigno commented 1 year ago

I'm not sure but it seems like platform issue (arm64).

But, watching this https://github.com/opencve/opencve-docker/pull/38 ... did you try building with --no-cache and pulling the latest base image?

ragaskar commented 1 year ago

FWIW, I had this problem and can confirm that I experience the error on my M1 mac.

When I

DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose build

As suggested by this comment on 37, everything works fine.

Might be nice to drop this in the docker docs to prevent additional issues being opened? (Us apple silicon users are pretty used to docker arch fails and I begin to expect them as the cause whenever I have a problem, but always nice to have it called out)