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

fake_mode error pops up rather than safe mode error #1037

Closed
ianballou opened this issue Aug 12, 2024 · 2 comments
Closed

fake_mode error pops up rather than safe mode error #1037

ianballou opened this issue Aug 12, 2024 · 2 comments
Labels
bug Something isn't working (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg

Comments

@ianballou
Copy link

Summary

Running orphan cleanup on pulp-cli 0.27.1 causes:

Operation orphans_cleanup_cleanup was attempted in fake mode

Steps to reproduce

pulp orphan cleanup --protection-time 0

Expected behavior

The usual safe mode error

Stacktrace/Error log

vagrant@centos9-katello-devel-stable ~ $ sudo pulp orphan cleanup --protection-time 0
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pulp_glue/common/context.py", line 375, in call
    result = self.api.call(
             ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulp_glue/common/openapi.py", line 721, in call
    raise UnsafeCallError(_("Call aborted due to safe mode"))
pulp_glue.common.openapi.UnsafeCallError: Call aborted due to safe mode

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bin/pulp", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulpcore/cli/common/generic.py", line 312, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulpcore/cli/common/generic.py", line 312, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulpcore/cli/common/generic.py", line 312, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulpcore/cli/core/orphan.py", line 58, in cleanup
    pulp_ctx.output_result(orphan_ctx.cleanup(kwargs))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulp_glue/core/context.py", line 297, in cleanup
    result = self.call("cleanup", body=body)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulp_glue/common/context.py", line 609, in call
    return self.pulp_ctx.call(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pulp_glue/common/context.py", line 382, in call
    raise NotImplementedFake(f"Operation {operation_id} was attempted in fake mode.")
pulp_glue.common.context.NotImplementedFake: Operation orphans_cleanup_cleanup was attempted in fake mode.

Pulp and pulp-cli version info

vagrant@centos9-katello-devel-stable ~ $ pulp --version
Pulp3 Command Line Interface, Version 0.27.1
Plugin Versions:
  common: 0.27.1
vagrant@centos9-katello-devel-stable ~ $ pulp status
{
  "versions": [
    {
      "component": "core",
      "version": "3.49.16",
      "package": "pulpcore",
      "module": "pulpcore.app",
      "domain_compatible": true
    },
    {
      "component": "certguard",
      "version": "3.49.16",
      "package": "pulpcore",
      "module": "pulp_certguard.app",
      "domain_compatible": true
    },
    {
      "component": "file",
      "version": "3.49.16",
      "package": "pulpcore",
      "module": "pulp_file.app",
      "domain_compatible": true
    },
    {
      "component": "rpm",
      "version": "3.26.1",
      "package": "pulp-rpm",
      "module": "pulp_rpm.app",
      "domain_compatible": true
    },
    {
      "component": "python",
      "version": "3.11.2",
      "package": "pulp-python",
      "module": "pulp_python.app",
      "domain_compatible": false
    },
    {
      "component": "deb",
      "version": "3.2.1",
      "package": "pulp_deb",
      "module": "pulp_deb.app",
      "domain_compatible": false
    },
    {
      "component": "container",
      "version": "2.20.2",
      "package": "pulp-container",
      "module": "pulp_container.app",
      "domain_compatible": false
    },
    {
      "component": "ostree",
      "version": "2.3.2",
      "package": "pulp-ostree",
      "module": "pulp_ostree.app",
      "domain_compatible": true
    },
    {
      "component": "ansible",
      "version": "0.21.7",
      "package": "pulp-ansible",
      "module": "pulp_ansible.app",
      "domain_compatible": false
    }
  ],
  "online_workers": [
    {
      "pulp_href": "/pulp/api/v3/workers/019146c4-3c46-7ed3-8ac7-45e517bf9550/",
      "pulp_created": "2024-08-12T13:25:51.314109Z",
      "pulp_last_updated": "2024-08-12T13:25:51.314130Z",
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:00.147733Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      },
      "current_task": null
    },
    {
      "pulp_href": "/pulp/api/v3/workers/019146c4-3c4d-79d1-9bc2-350d3a726f3b/",
      "pulp_created": "2024-08-12T13:25:51.315142Z",
      "pulp_last_updated": "2024-08-12T13:25:51.315161Z",
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:01.261608Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      },
      "current_task": null
    },
    {
      "pulp_href": "/pulp/api/v3/workers/019146c4-3c4e-7e9c-b01c-bf1998780881/",
      "pulp_created": "2024-08-12T13:25:51.314445Z",
      "pulp_last_updated": "2024-08-12T13:25:51.314463Z",
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:00.154607Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      },
      "current_task": null
    },
    {
      "pulp_href": "/pulp/api/v3/workers/019146c4-3c50-768a-8db8-334b4ccbece8/",
      "pulp_created": "2024-08-12T13:25:51.315533Z",
      "pulp_last_updated": "2024-08-12T13:25:51.315564Z",
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:00.640679Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      },
      "current_task": null
    }
  ],
  "online_api_apps": [
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:02.871593Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:02.871556Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:02.861666Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:02.879017Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:02.868580Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    }
  ],
  "online_content_apps": [
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:41:59.336415Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:41:59.335870Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:41:59.977972Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:01.216699Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:01.216696Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:41:59.975392Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:41:59.979229Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:00.845942Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    },
    {
      "name": "[email protected]",
      "last_heartbeat": "2024-08-12T18:42:01.214815Z",
      "versions": {
        "deb": "3.2.1",
        "rpm": "3.26.1",
        "core": "3.49.16",
        "file": "3.49.16",
        "ostree": "2.3.2",
        "python": "3.11.2",
        "ansible": "0.21.7",
        "certguard": "3.49.16",
        "container": "2.20.2"
      }
    }
  ],
  "database_connection": {
    "connected": true
  },
  "redis_connection": {
    "connected": true
  },
  "storage": {
    "total": 37509660672,
    "used": 15868231680,
    "free": 21641428992
  },
  "content_settings": {
    "content_origin": "https://centos9-katello-devel-stable.example.com",
    "content_path_prefix": "/pulp/content/"
  },
  "domain_enabled": false
}

@ianballou ianballou added bug Something isn't working (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg labels Aug 12, 2024
@mdellweg
Copy link
Member

Can you confirm that this cli is part of a katello installation or more specific is configured to use dry-run by default?

@ianballou
Copy link
Author

This is a Katello installation, tested on two different systems. I don't think we set anything in the config besides the URL and certificates.

mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Aug 13, 2024
When fake mode was not explicitely selected complaining about unsafe
calls in fake_mode is not nice. Instead, we fall back to the original
error message in that case.

fixes pulp#1037
patchback bot pushed a commit that referenced this issue Aug 14, 2024
When fake mode was not explicitely selected complaining about unsafe
calls in fake_mode is not nice. Instead, we fall back to the original
error message in that case.

fixes #1037

(cherry picked from commit 00ede19)
mdellweg added a commit that referenced this issue Aug 14, 2024
When fake mode was not explicitely selected complaining about unsafe
calls in fake_mode is not nice. Instead, we fall back to the original
error message in that case.

fixes #1037

(cherry picked from commit 00ede19)
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) Triage-Needed Needs to be reviewed at next pulp-cli mtg
Projects
None yet
Development

No branches or pull requests

2 participants