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

Specifying an empty HREF when deleting any resource ends with RecursionError #545

Closed
lubosmj opened this issue Aug 31, 2022 · 0 comments · Fixed by #549
Closed

Specifying an empty HREF when deleting any resource ends with RecursionError #545

lubosmj opened this issue Aug 31, 2022 · 0 comments · Fixed by #549
Assignees
Labels
bug Something isn't working (template-set) prio-list driving Pulp's Kanban searches
Milestone

Comments

@lubosmj
Copy link
Member

lubosmj commented Aug 31, 2022

Summary

When specifying an empty HREF while running a destroy command of any kind, a python error is raised.

Steps to reproduce

Execute the following command:

pulp file repository destroy --href ""
pulp file repository destroy

Expected behaviour

A reasonable error message should be displayed instead.

Stacktrace/Error log

Traceback (most recent call last):
  File "/usr/local/lib/pulp/bin/pulp", line 33, in <module>
    sys.exit(load_entry_point('pulp-cli', 'console_scripts', 'pulp')())
  File "/home/vagrant/devel/pulp-cli/pulp_cli/__init__.py", line 32, in main
    return _main()
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/generic.py", line 84, in invoke
    return super().invoke(ctx)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/generic.py", line 84, in invoke
    return super().invoke(ctx)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/generic.py", line 84, in invoke
    return super().invoke(ctx)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/generic.py", line 84, in invoke
    return super().invoke(ctx)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/pulp/lib64/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/generic.py", line 906, in callback
    entity_ctx.delete(entity_ctx.pulp_href)
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 404, in pulp_href
    return str(self.entity["pulp_href"])
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 381, in entity
    self._entity = self.show(self._entity_lookup["pulp_href"])
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 499, in show
    return self.call("read", parameters={self.HREF: href or self.pulp_href})
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 404, in pulp_href
    return str(self.entity["pulp_href"])
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 381, in entity
    self._entity = self.show(self._entity_lookup["pulp_href"])
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 499, in show
    return self.call("read", parameters={self.HREF: href or self.pulp_href})
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 404, in pulp_href
    return str(self.entity["pulp_href"])
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 381, in entity
    self._entity = self.show(self._entity_lookup["pulp_href"])
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 499, in show
    return self.call("read", parameters={self.HREF: href or self.pulp_href})
  File "/home/vagrant/devel/pulp-cli/pulpcore/cli/common/context.py", line 404, in pulp_href
    return str(self.entity["pulp_href"])
RecursionError: maximum recursion depth exceeded

Pulp and pulp-cli version info

Latest main branches.

    {
      "component": "core",
      "version": "3.21.0.dev",
      "package": "pulpcore"
    },
    {
      "component": "file",
      "version": "1.12.0.dev",
      "package": "pulp-file"
    },
@lubosmj lubosmj added bug Something isn't working (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg labels Aug 31, 2022
@lubosmj lubosmj self-assigned this Aug 31, 2022
@mdellweg mdellweg added the prio-list driving Pulp's Kanban searches label Sep 1, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 2, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 5, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 5, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 5, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 5, 2022
@mdellweg mdellweg removed the Triage-Needed Needs to be reviewed at next pulp-cli mtg label Sep 14, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 22, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 22, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 22, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 22, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 22, 2022
lubosmj added a commit to lubosmj/pulp-cli that referenced this issue Sep 22, 2022
@mdellweg mdellweg added this to the 0.16.0 milestone Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working (template-set) prio-list driving Pulp's Kanban searches
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants