Cannot run pio --help in the CLI

Hi everyone,

I updated all my cluster to the latest software version (24.4.11), and tried to run some commands in the command line interface (CLI) of workers, such as pio --help, however, I got the following error log:

Traceback (most recent call last): File "/usr/local/bin/pio", line 8, in <module> sys.exit(pio()) ^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1077, in main with self.make_context(prog_name, args, **extra) as ctx: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 943, in make_context self.parse_args(ctx, args) File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1644, in parse_args rest = super().parse_args(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1408, in parse_args value, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 2400, in handle_parse_result value = self.process_value(ctx, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 2362, in process_value value = self.callback(ctx, self, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1300, in show_help echo(ctx.get_help(), color=ctx.color) ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 704, in get_help return self.command.get_help(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1325, in get_help self.format_help(ctx, formatter) File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1358, in format_help self.format_options(ctx, formatter) File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1564, in format_options self.format_commands(ctx, formatter) File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1617, in format_commands cmd = self.get_command(ctx, subcommand) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pioreactor/cli/lazy_group.py", line 25, in get_command return self._lazy_load(cmd_name) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pioreactor/cli/lazy_group.py", line 35, in _lazy_load cmd_object = getattr(mod, cmd_object_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'pioreactor.cli.workers' has no attribute 'workers'

Did anyone get a similar issue or have an idea of the cause?

huh! That’s a bug! We can reproduce it here. We’ll fix in the next release (soon).

Interestingly, full commands like pio run stirring work fine - it’s just when pio needs to list commands available.

1 Like

That is correct, I also tested pio blink and it works perfectly fine!

This should be fixed in 24.5.1 - thanks for the report!

1 Like

Just updated to the latest version (in this case 24.5.1) and I get the following error when I try pio --help

WARNING [read config] Not found in configuration: 'pioreactor.version'. Are you missing the following in your config?

[pioreactor]

version=some value

I have a stand-alone leader Raspberry Pi, which I assume is the reason for the issue as the leader does not have its own config, could this be the reason?

EDIT: Yes, I just added the leader as worker and now I can run pio --help

Ah good point, I’ve made an issue to resolve that error in leader-only setups.

1 Like

For the time being, you can get around this by creating another (harmless) config on the leader-only:

nano ~/.pioreactor/unit_config.ini

And adding:

[pioreactor]
version=1.0

That should solve the problem.

Ahh, this is a good idea which I did not think about. Will try it first thing in the morning, thanks Cameron!