Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple buildbot_1 fails with ImportError: No module named psycopg2 #9

Open
akuanti opened this issue Apr 18, 2018 · 6 comments
Open

Comments

@akuanti
Copy link

akuanti commented Apr 18, 2018

When running docker-compose up with the simple example, I get the following over and over:

buildbot_1  | checking for running master
buildbot_1  | checking master.cfg
buildbot_1  | upgrading basedir
buildbot_1  | upgrading database (postgresql+psycopg2://buildbot:xxxx@db/buildbot)
buildbot_1  | Can't upgrade master yet. Waiting for database ready?
buildbot_1  | checking basedir
buildbot_1  | /usr/lib/python2.7/site-packages/buildbot/config.py:102: ConfigWarning: [0.9.0 and later] `buildbotNetUsageData` is not configured and defaults to
basic.
buildbot_1  | This parameter helps the buildbot development team to understand the installation base.
buildbot_1  | No personal information is collected.
buildbot_1  | Only installation software version info and plugin usage is sent.
buildbot_1  | You can `opt-out` by setting this variable to None.
buildbot_1  | Or `opt-in` for more information by setting it to "full".
buildbot_1  |
buildbot_1  |   category=ConfigWarning,
buildbot_1  | /usr/lib/python2.7/site-packages/buildbot/config.py:102: ConfigWarning: [0.9.0 and later] NOTE: `status` targets are deprecated and ignored They are replaced by reporters
buildbot_1  |   category=ConfigWarning,
buildbot_1  | problem while upgrading!:
buildbot_1  | Traceback (most recent call last):
buildbot_1  |   File "/usr/lib/python2.7/site-packages/buildbot/scripts/upgrade_master.py", line 121, in _upgradeMaster
buildbot_1  |     yield upgradeDatabase(config, master_cfg)
buildbot_1  | ImportError: No module named psycopg2

I tried installing psycopg2 manually, but it fails because it can't find the pg_config executable.

/var/lib/buildbot # pip install psycopg2
Collecting psycopg2
  Downloading https://files.pythonhosted.org/packages/74/83/51580322ed0e82cba7ad8e0af590b8fb2cf11bd5aaa1ed872661bd36f462/psycopg2-2.7.4.tar.gz (425kB)
    100% |████████████████████████████████| 430kB 4.4MB/s
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

    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>).


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Q8qcHR/psycopg2/

When I try to install psycopg2-binary, it still tries to build from source (I'm guessing because none of the wheels are compatible?).

/var/lib/buildbot # pip install psycopg2-binary
Collecting psycopg2-binary
  Downloading https://files.pythonhosted.org/packages/77/09/4991fcd9a8f4bea1ee3948e1729fa17c184d25bd10809bacc143626361b9/psycopg2-binary-2.7.4.tar.gz (426kB)
    100% |████████████████████████████████| 430kB 6.4MB/s
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2_binary.egg-info
    writing pip-egg-info/psycopg2_binary.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2_binary.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2_binary.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2_binary.egg-info/SOURCES.txt'

    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>).


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-2kFAwj/psycopg2-binary/

I believe that libpq-dev needs to be installed: http://initd.org/psycopg/docs/install.html#build-prerequisites for this installation to work properly.

@cristobal23
Copy link

Hi @akuanti, I tried to reproduce this issue but it worked as expected for me.

$ cd simple/
$ docker-compose up -d
$ docker-compose ps
      Name                     Command               State           Ports         
-----------------------------------------------------------------------------------
simple_buildbot_1   dumb-init /usr/src/buildbo ...   Up      0.0.0.0:8010->8010/tcp
simple_db_1         docker-entrypoint.sh postgres    Up      5432/tcp              
simple_worker_1     /usr/local/bin/dumb-init t ...   Up
$ open http://localhost:8010

How did you run docker-compose to get your container names not begin with simple_?

@akuanti
Copy link
Author

akuanti commented May 4, 2018

@cristobal23 the containers are up, but the process running in the simple_buildbot_1 container actually seems to be failing over and over. You should see this if you run docker-compose up with no -d. It doesn't actually work to visit http://localhost:8010.

@akuanti
Copy link
Author

akuanti commented May 4, 2018

I realize now that you said you were able to open the page, so it seems you aren't getting the same results. I am on macOS, if that makes a difference.

@cristobal23
Copy link

Interesting, I am macOS too. Perhaps try,

cd simple/
docker-compose stop
docker-compose rm
rm -r downloads/

then pull changes from master and try again?

I just did the above and it still worked for me.

@akuanti
Copy link
Author

akuanti commented May 4, 2018

Is there supposed to be a downloads directory? I don't have one.

@cristobal23
Copy link

I don't think so, I just saw that in my git status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants