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

Dbt does not works due to bug in psycopg2-2.7.1 #773

Closed
sphinks opened this issue May 15, 2018 · 8 comments
Closed

Dbt does not works due to bug in psycopg2-2.7.1 #773

sphinks opened this issue May 15, 2018 · 8 comments
Labels
dependencies Changes to the version of dbt dependencies

Comments

@sphinks
Copy link

sphinks commented May 15, 2018

There is an issue in psycopg2, which I faced with after clean install of dbt on Fedora 26:
psycopg/psycopg2-wheels#2
After installation I try to run 'dbt init <project_name>' and get an error:

  File "/bin/dbt", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/ivan/Projects/dbt/scripts/dbt", line 3, in <module>
    import dbt.main
  File "/home/ivan/Projects/dbt/dbt/main.py", line 10, in <module>
    import dbt.project as project
  File "/home/ivan/Projects/dbt/dbt/project.py", line 13, in <module>
    import dbt.context.common
  File "/home/ivan/Projects/dbt/dbt/context/common.py", line 6, in <module>
    from dbt.adapters.factory import get_adapter
  File "/home/ivan/Projects/dbt/dbt/adapters/factory.py", line 3, in <module>
    from dbt.adapters.postgres import PostgresAdapter
  File "/home/ivan/Projects/dbt/dbt/adapters/postgres/__init__.py", line 1, in <module>
    from dbt.adapters.postgres.impl import PostgresAdapter
  File "/home/ivan/Projects/dbt/dbt/adapters/postgres/impl.py", line 1, in <module>
    import psycopg2
  File "/usr/lib64/python2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
    from psycopg2._psycopg import (                     # noqa
ImportError: /usr/lib64/python2.7/site-packages/psycopg2/.libs/libresolv-2-c4c53def.5.so: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

I get sources and switch in setup.py version of psycopg2 to 2.7.4 (where bug already fixed), install dbt from sources and dbt seems to be working great now.

Not sure if helps only me or it fix the root cause of problem, so I create an issue, instead of pull request with new version of psycopg2.

@drewbanin
Copy link
Contributor

Thanks for the report @sphinks! I haven't seen this happen to anyone else, and our psycopg2 version hasn't changed for a long time, so I don't have a great handle on why this would happen.

It would be good to update to the latest release of pyscopg2. We do have an issue to use the pyscopg2 wheel explicitly (#704), and we can bump the version at the same time.

@michael-erasmus
Copy link

I'm getting this error too, I did try running

pip install --no-binary :all: psycopg2

As suggested here but I'm still seeing the error.

I'm running on Arch Linux.

@michael-erasmus
Copy link

Small update, I think this was indeed related to the version of psycopg2. I managed to work around this issue by bumping the version up to the latest. More details over here: #704

@drewbanin
Copy link
Contributor

Thanks for the update @michael-erasmus. I'm pretty surprised that both you and @sphinks were having issues, but maybe that's due to your Fedora and Arch OS's?

I'm very open to updating the psycopg2 dep -- let's discuss in the issue you linked (#704). Let's leave this one open until we get the changes merged

@sphinks
Copy link
Author

sphinks commented Jun 23, 2018

Hm, does arch linux and fedora have so much similar, to get the same issue to due OS only?

@drewbanin
Copy link
Contributor

@sphinks not sure! I don't have either of those OS's handy, so it's difficult for me to say for certain. I suspect it has more to do with the versions of libc that you two are using, or possibly some OS-specific code in psycopg2. I don't think that this problem occurs on macOS or Windows.

Regardless, I just made a PR to bump the dep to 2.7.5 which should hopefully fix this issue. If you have the time, I'd love to hear if installing from the bump/psycopg2-2.7.5 branch works for you! See: #807

@drewbanin drewbanin added the dependencies Changes to the version of dbt dependencies label Jun 28, 2018
@butla
Copy link

butla commented Jul 16, 2018

@drewbanin I have the same issue on Ubuntu 17.10, so it seems that this is a pretty wide problem. It's fixed when I install psycopg2==2.7.5.

@drewbanin
Copy link
Contributor

Thanks @butla - this was fixed in #807 and is going out in the next release of dbt, 0.10.2!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Changes to the version of dbt dependencies
Projects
None yet
Development

No branches or pull requests

4 participants