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

Error searching for plugins if there is an empty package folder in the repo #1618

Open
mmdanggg2 opened this issue Jan 17, 2024 · 0 comments · May be fixed by #1723
Open

Error searching for plugins if there is an empty package folder in the repo #1618

mmdanggg2 opened this issue Jan 17, 2024 · 0 comments · May be fixed by #1723
Labels
api API related issues bug rez-plugins

Comments

@mmdanggg2
Copy link

Calling rez.package_search.get_plugins with a package that has has_plugins set to True will error out if there is a folder in a package repo without a valid package in it. Simplest way to replicate this is just make an empty folder in ~/packages and try to run get_plugins:

>>> package_search.get_plugins("nuke")
Searching [#############                   ] 46/106Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/rez/rez_package_cache/rez/2.112.0/c2ee/a/rez/package_search.py", line 154, in get_plugins
    if not plugin_pkg.plugin_for:
AttributeError: 'NoneType' object has no attribute 'plugin_for'

I actually came across this while in the middle of building a new package that took some time, so it had created the package folder with a version and .building file but there was not a valid package in there yet and started to get reports of our launcher breaking.

Fix may be as simple as adding a check for None here:

plugin_pkg = get_latest_package(package_name_, paths=paths)
if not plugin_pkg.plugin_for:
continue

    if not plugin_pkg or not plugin_pkg.plugin_for:
@BryceGattis BryceGattis linked a pull request Apr 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API related issues bug rez-plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants