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

Cannot connect to the database: can't set attribute #2252

Closed
fridex opened this issue Mar 16, 2021 · 7 comments
Closed

Cannot connect to the database: can't set attribute #2252

fridex opened this issue Mar 16, 2021 · 7 comments
Labels
human_intervention_required kind/bug Categorizes issue or PR as related to a bug.

Comments

@fridex
Copy link
Contributor

fridex commented Mar 16, 2021

Describe the bug

2021-03-16 16:01:07,376 215742 CRITICAL root:105: Traceback (most recent call last):
  File "./thoth-adviser", line 856, in <module>
    __name__ == "__main__" and cli()
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "./thoth-adviser", line 525, in advise
    resolver = Resolver.get_adviser_instance(
  File "/home/fpokorny/git/thoth-station/adviser/thoth/adviser/resolver.py", line 1393, in get_adviser_instance
    graph.connect()
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/thoth/storages/graph/postgres.py", line 299, in connect
    if not database_exists(self._engine.url):
  File "/home/fpokorny/.local/share/virtualenvs/adviser-1eaKppR3/lib/python3.8/site-packages/thoth/storages/graph/postgres_utils.py", line 82, in database_exists
    database, url.database = url.database, os.getenv('KNOWLEDGE_GRAPH_DATABASE')
AttributeError: can't set attribute

To Reproduce
Steps to reproduce the behavior:

  1. Try to connect to the database with more recent version sqlalchemy
  2. See error

Expected behavior

Connection should be correctly established.

Additional context

See change in sqlalchemy sqlalchemy/sqlalchemy@3668b3a

@fridex fridex added the kind/bug Categorizes issue or PR as related to a bug. label Mar 16, 2021
@harshad16
Copy link
Member

Similar issue:thoth-station/metrics-exporter#641

@fridex
Copy link
Contributor Author

fridex commented Mar 16, 2021

We will need to pin sqlalchemy<1.4.0.

@pacospace
Copy link
Contributor

We will need to pin sqlalchemy<1.4.0.

We need to wait for squalchemy-utils project, because it is not compatible with the new sqlalchemy api: kvesteri/sqlalchemy-utils#505

@fridex
Copy link
Contributor Author

fridex commented Mar 16, 2021

We will need to pin sqlalchemy<1.4.0.

We need to wait for squalchemy-utils project, because it is not compatible with the new sqlalchemy api: kvesteri/sqlalchemy-utils#505

I think we will need to constraint sqlalchemy<1.4.0 in the meantime until the issue in alchemy-utils is fixed. Otherwise, all the components that talk to PG will break if running newer version of sqlalchemy.

@harshad16
Copy link
Member

Let's proceed with pinning the version, so our apps don't fail.

@pacospace
Copy link
Contributor

pacospace commented Mar 16, 2021

We will need to pin sqlalchemy<1.4.0.

We need to wait for squalchemy-utils project, because it is not compatible with the new sqlalchemy api: kvesteri/sqlalchemy-utils#505

I think we will need to constraint sqlalchemy<1.4.0 in the meantime until the issue in alchemy-utils is fixed. Otherwise, all the components that talk to PG will break if running newer version of sqlalchemy.

Yes totally agree, sorry, my comment was just to link the issue from upstream :)

@harshad16
Copy link
Member

This is fixed with the pinning of the sqlalchmey .
closing the issue.
Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
human_intervention_required kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants