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

sregistry images throws error #264

Open
iferres opened this issue Jun 15, 2023 · 5 comments
Open

sregistry images throws error #264

iferres opened this issue Jun 15, 2023 · 5 comments

Comments

@iferres
Copy link
Contributor

iferres commented Jun 15, 2023

Describe the bug

I installed sregistry client with pip install sregistry[all], apparently successful installation. But I got this error when calling images:

sregistry images
Traceback (most recent call last):
  File "/home/iferres/.local/bin/sregistry", line 8, in <module>
    sys.exit(main())
  File "/home/iferres/.local/lib/python3.8/site-packages/sregistry/client/__init__.py", line 391, in main
    main(args=args, parser=parser, extra=extra)
  File "/home/iferres/.local/lib/python3.8/site-packages/sregistry/client/images.py", line 21, in main
    cli = get_client(quiet=args.quiet)
  File "/home/iferres/.local/lib/python3.8/site-packages/sregistry/main/__init__.py", line 131, in get_client
    cli = Client()
  File "/home/iferres/.local/lib/python3.8/site-packages/sregistry/main/hub/__init__.py", line 21, in __init__
    super(Client, self).__init__(**kwargs)
  File "/home/iferres/.local/lib/python3.8/site-packages/sregistry/main/base/__init__.py", line 60, in __init__
    self._init_db(SREGISTRY_DATABASE)
  File "/home/iferres/.local/lib/python3.8/site-packages/sregistry/database/models.py", line 159, in init_db
    self.engine = create_engine(self.database, convert_unicode=True)
  File "<string>", line 2, in create_engine
  File "/home/iferres/.local/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned
    return fn(*args, **kwargs)  # type: ignore[no-any-return]
  File "/home/iferres/.local/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 680, in create_engine
    raise TypeError(
TypeError: Invalid argument(s) 'convert_unicode' sent to create_engine(), using configuration SQLiteDialect_pysqlite/QueuePool/Engine.  Please check that the keyword arguments are appropriate for this combination of components.

To Reproduce

pip install sregistry[all]
sregistry images

Expected behavior
Expecting to return empty database since I haven't pulled any image yet.

Version of Singularity and Singularity Registry Client

sregistry --version
0.2.38

Ubuntu 20.04.1

@vsoch
Copy link
Member

vsoch commented Jun 15, 2023

This looks like a version issue - you can try downgrading the version of sqlalchemy to an older version, or do a test to remove the convert_unicode argument instead (just remove it). If that works, it would be great to do a PR that adjusts this create_engine statement.

@iferres
Copy link
Contributor Author

iferres commented Jun 16, 2023

Downgrading SQLAlchemy to 1.4.48 works.

@vsoch
Copy link
Member

vsoch commented Jun 16, 2023

okay - that solution can work! Would you care to open a PR to do a <= for this version? We'd want to do that, bump the version, and add a note in the changelog (and probably will be a TODO to come back and update the call to a newer version at some point).

@iferres
Copy link
Contributor Author

iferres commented Jun 16, 2023

The file is ./sregistry/version.py ? Sorry, I'm not very familiar with python packaging. Would accept a max_version parameter instead of min_version?

@vsoch
Copy link
Member

vsoch commented Jun 16, 2023

Yes! The version is here

__version__ = "0.2.38"
and that file will also be where you want to pin the version. And the CHANGELOG.md is in the root. And then here

sregistry-cli/setup.py

Lines 35 to 39 in 994fd02

elif "min_version" in module_meta:
if module_meta['min_version'] == None:
dependency = module_name
else:
dependency = "%s>=%s" %(module_name,module_meta['min_version'])
we'd want to add the logic to set that up, something like:

elif "max_version" in module_meta:
    dependency = "%s<=%s" %(module_name, module_meta['max_version'])

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