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

jhack tail doesn't like subordinates #15

Closed
sabaini opened this issue Sep 16, 2022 · 6 comments · Fixed by #17
Closed

jhack tail doesn't like subordinates #15

sabaini opened this issue Sep 16, 2022 · 6 comments · Fixed by #17

Comments

@sabaini
Copy link

sabaini commented Sep 16, 2022

Afaict jhack tail parsing of juju status chokes on subordinates.

When running jhack tail against a model full of machine charms (OpenStack) I'm getting this traceback

Traceback (most recent call last):
  File "/home/peter/src/juju/jhack/jhack/main.py", line 108, in <module>
    main()
  File "/home/peter/src/juju/jhack/jhack/main.py", line 104, in main
    app()
  File "/home/peter/venv/devtools/lib/python3.10/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/peter/venv/devtools/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/peter/venv/devtools/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/peter/venv/devtools/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/peter/venv/devtools/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/peter/venv/devtools/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/peter/venv/devtools/lib/python3.10/site-packages/typer/main.py", line 500, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/peter/src/juju/jhack/jhack/utils/tail_charms.py", line 964, in tail_events
    return _tail_events(
  File "/home/peter/src/juju/jhack/jhack/utils/tail_charms.py", line 1013, in _tail_events
    targets = parse_targets(targets)
  File "/home/peter/src/juju/jhack/jhack/utils/tail_charms.py", line 87, in parse_targets
    return get_all_units()
  File "/home/peter/src/juju/jhack/jhack/utils/tail_charms.py", line 80, in get_all_units
    target = Target.from_name(first_part)
  File "/home/peter/src/juju/jhack/jhack/utils/tail_charms.py", line 48, in from_name
    app, unit_ = name.split("/")
ValueError: not enough values to unpack (expected 2, got 1)
@PietroPasotti
Copy link
Collaborator

Thanks for reporting @sabaini!
To help me repro (and to add to the itests), could you dump the juju debug-log --replay to a file and attach it here?

@sabaini
Copy link
Author

sabaini commented Sep 16, 2022

Sure -- here you go:
juju-log-replay.txt.gz

@PietroPasotti
Copy link
Collaborator

Humm, there are several odd things about that log trace.
Firstly, I can only see 'update-status', secondly the log formatting is not one I'm familiar with.
I see the uniter event log line goes: "(via explicit, bespoke hook script)", which I've never seen before. That is not a format that jhack tail supports ATM, so even if it didn't crash there, I doubt it would pick any logs up.

Did you set model-config logging-config="<root>=WARNING;unit=DEBUG"? (you should)

I managed to reproduce the issue deploying ceilometer + prometheus-node-exporter as a subordinate, there is indeed an issue there. Troubleshooting...

@PietroPasotti
Copy link
Collaborator

Fixed it! It was indeed an issue with parsing the status when it included subordinate charms.

@PietroPasotti
Copy link
Collaborator

@sabaini could you verify that #17 solves the issue?

@sabaini
Copy link
Author

sabaini commented Sep 16, 2022

Indeed it does, thank you!

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

Successfully merging a pull request may close this issue.

2 participants