Comments (4)
Yeah, we still have errors.
Here is the output I get with edge (0.3.14):
paul-goins@dell2018:~$ jhack show-relation ubuntu:juju-info nrpe:general-info
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /snap/jhack/198/lib/python3.8/site-packages/jhack/utils/show_relation.py:594 in │
│ sync_show_relation │
│ │
│ 591 │ │
│ 592 │ $ jhack utils show-relation my_app:relation_name other_app:other_name │
│ 593 │ """ │
│ ❱ 594 │ return _sync_show_relation( │
│ 595 │ │ endpoint1=endpoint1, │
│ 596 │ │ endpoint2=endpoint2, │
│ 597 │ │ n=n, │
│ │
│ ╭───────────────── locals ──────────────────╮ │
│ │ color = 'auto' │ │
│ │ endpoint1 = 'ubuntu:juju-info' │ │
│ │ endpoint2 = 'nrpe:general-info' │ │
│ │ hide_empty_databags = False │ │
│ │ model = None │ │
│ │ n = None │ │
│ │ show_juju_keys = False │ │
│ │ watch = False │ │
│ ╰───────────────────────────────────────────╯ │
│ │
│ /snap/jhack/198/lib/python3.8/site-packages/jhack/utils/show_relation.py:631 in │
│ _sync_show_relation │
│ │
│ 628 │ while True: │
│ 629 │ │ start = time.time() │
│ 630 │ │ │
│ ❱ 631 │ │ table = asyncio.run( │
│ 632 │ │ │ render_relation( │
│ 633 │ │ │ │ endpoint1, │
│ 634 │ │ │ │ endpoint2, │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ color = 'auto' │ │
│ │ Console = <class 'rich.console.Console'> │ │
│ │ console = <console width=195 ColorSystem.TRUECOLOR> │ │
│ │ endpoint1 = 'ubuntu:juju-info' │ │
│ │ endpoint2 = 'nrpe:general-info' │ │
│ │ hide_empty_databags = False │ │
│ │ model = None │ │
│ │ n = None │ │
│ │ rich = <module 'rich' from │ │
│ │ '/snap/jhack/198/lib/python3.8/site-packages/rich/__init__.py'> │ │
│ │ show_juju_keys = False │ │
│ │ start = 1678382891.3614984 │ │
│ │ watch = False │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib/python3.8/asyncio/runners.py:44 in run │
│ │
│ 41 │ │ events.set_event_loop(loop) │
│ 42 │ │ if debug is not None: │
│ 43 │ │ │ loop.set_debug(debug) │
│ ❱ 44 │ │ return loop.run_until_complete(main) │
│ 45 │ finally: │
│ 46 │ │ try: │
│ 47 │ │ │ _cancel_all_tasks(loop) │
│ │
│ ╭──────────────────────────────── locals ────────────────────────────────╮ │
│ │ debug = None │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=True debug=False> │ │
│ │ main = <coroutine object render_relation at 0x7f98288b90c0> │ │
│ ╰────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/lib/python3.8/asyncio/base_events.py:616 in run_until_complete │
│ │
│ 613 │ │ if not future.done(): │
│ 614 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │
│ 615 │ │ │
│ ❱ 616 │ │ return future.result() │
│ 617 │ │
│ 618 │ def stop(self): │
│ 619 │ │ """Stop running the event loop. │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ future = <Task finished name='Task-1' coro=<render_relation() done, defined at │ │
│ │ /snap/jhack/198/lib/python3.8/site-packages/jhack/utils/show_relation.py:422> │ │
│ │ exception=KeyError('units')> │ │
│ │ new_task = True │ │
│ │ self = <_UnixSelectorEventLoop running=False closed=True debug=False> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /snap/jhack/198/lib/python3.8/site-packages/jhack/utils/show_relation.py:481 in render_relation │
│ │
│ 478 │ │ if not (endpoint1 and endpoint2): │
│ 479 │ │ │ raise RuntimeError("invalid usage: provide two endpoints.") │
│ 480 │ │ │
│ ❱ 481 │ │ data = get_relation_data( │
│ 482 │ │ │ provider_endpoint=endpoint1, │
│ 483 │ │ │ requirer_endpoint=endpoint2, │
│ 484 │ │ │ include_default_juju_keys=include_default_juju_keys, │
│ │
│ ╭──────────────────── locals ─────────────────────╮ │
│ │ endpoint1 = 'ubuntu:juju-info' │ │
│ │ endpoint2 = 'nrpe:general-info' │ │
│ │ hide_empty_databags = False │ │
│ │ include_default_juju_keys = False │ │
│ │ is_peer = False │ │
│ │ model = None │ │
│ │ n = None │ │
│ ╰─────────────────────────────────────────────────╯ │
│ │
│ /snap/jhack/198/lib/python3.8/site-packages/jhack/utils/show_relation.py:347 in │
│ get_relation_data │
│ │
│ 344 │ │
│ 345 │ >>> get_relation_data('prometheus/0:ingress', 'traefik/1:ingress-per-unit') │
│ 346 │ """ │
│ ❱ 347 │ provider_data = get_content( │
│ 348 │ │ provider_endpoint, requirer_endpoint, include_default_juju_keys, model=model │
│ 349 │ ) │
│ 350 │ requirer_data = get_content( │
│ │
│ ╭──────────────────── locals ─────────────────────╮ │
│ │ include_default_juju_keys = False │ │
│ │ model = None │ │
│ │ provider_endpoint = 'ubuntu:juju-info' │ │
│ │ requirer_endpoint = 'nrpe:general-info' │ │
│ ╰─────────────────────────────────────────────────╯ │
│ │
│ /snap/jhack/198/lib/python3.8/site-packages/jhack/utils/show_relation.py:245 in get_content │
│ │
│ 242 │ # so even though we need 'any' remote unit name, we still need to query the status │
│ 243 │ # to find out what units there are. │
│ 244 │ status = _juju_status(other_app_name, model=model, json=True) │
│ ❱ 245 │ other_unit_name = next(iter(status["applications"][other_app_name]["units"])) │
│ 246 │ # we might have a different number of units and other units, and it doesn't │
│ 247 │ # matter which 'other' we pass to get the databags for 'this one'. │
│ 248 │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ _ = None │ │
│ │ app_name = 'ubuntu' │ │
│ │ endpoint = 'juju-info' │ │
│ │ include_default_juju_keys = False │ │
│ │ meta = Metadata( │ │
│ │ │ scale=1, │ │
│ │ │ units=(0,), │ │
│ │ │ leader_id=0, │ │
│ │ │ interface='juju-info' │ │
│ │ ) │ │
│ │ model = None │ │
│ │ obj = 'ubuntu:juju-info' │ │
│ │ other_app_name = 'nrpe' │ │
│ │ other_endpoint = 'general-info' │ │
│ │ other_obj = 'nrpe:general-info' │ │
│ │ other_url = 'nrpe' │ │
│ │ peer = False │ │
│ │ status = { │ │
│ │ │ 'model': { │ │
│ │ │ │ 'name': 'test', │ │
│ │ │ │ 'type': 'iaas', │ │
│ │ │ │ 'controller': 'lxd', │ │
│ │ │ │ 'cloud': 'localhost', │ │
│ │ │ │ 'region': 'localhost', │ │
│ │ │ │ 'version': '2.9.38', │ │
│ │ │ │ 'model-status': { │ │
│ │ │ │ │ 'current': 'available', │ │
│ │ │ │ │ 'since': '08 Mar 2023 10:20:25-08:00' │ │
│ │ │ │ }, │ │
│ │ │ │ 'sla': 'unsupported' │ │
│ │ │ }, │ │
│ │ │ 'machines': { │ │
│ │ │ │ '0': { │ │
│ │ │ │ │ 'juju-status': { │ │
│ │ │ │ │ │ 'current': 'started', │ │
│ │ │ │ │ │ 'since': '08 Mar 2023 10:24:47-08:00', │ │
│ │ │ │ │ │ 'version': '2.9.38' │ │
│ │ │ │ │ }, │ │
│ │ │ │ │ 'hostname': 'juju-b229b0-0', │ │
│ │ │ │ │ 'dns-name': '10.29.120.99', │ │
│ │ │ │ │ 'ip-addresses': ['10.29.120.99'], │ │
│ │ │ │ │ 'instance-id': 'juju-b229b0-0', │ │
│ │ │ │ │ 'machine-status': { │ │
│ │ │ │ │ │ 'current': 'running', │ │
│ │ │ │ │ │ 'message': 'Running', │ │
│ │ │ │ │ │ 'since': '08 Mar 2023 10:23:01-08:00' │ │
│ │ │ │ │ }, │ │
│ │ │ │ │ 'modification-status': { │ │
│ │ │ │ │ │ 'current': 'applied', │ │
│ │ │ │ │ │ 'since': '09 Mar 2023 07:59:27-08:00' │ │
│ │ │ │ │ }, │ │
│ │ │ │ │ 'base': {'name': 'ubuntu', 'channel': '20.04'}, │ │
│ │ │ │ │ 'network-interfaces': { │ │
│ │ │ │ │ │ 'eth0': { │ │
│ │ │ │ │ │ │ 'ip-addresses': ['10.29.120.99'], │ │
│ │ │ │ │ │ │ 'mac-address': '00:16:3e:62:8a:7b', │ │
│ │ │ │ │ │ │ 'gateway': '10.29.120.1', │ │
│ │ │ │ │ │ │ 'space': 'alpha', │ │
│ │ │ │ │ │ │ 'is-up': True │ │
│ │ │ │ │ │ } │ │
│ │ │ │ │ }, │ │
│ │ │ │ │ 'constraints': 'arch=amd64', │ │
│ │ │ │ │ ... +1 │ │
│ │ │ │ } │ │
│ │ │ }, │ │
│ │ │ 'applications': { │ │
│ │ │ │ 'nrpe': { │ │
│ │ │ │ │ 'charm': 'nrpe', │ │
│ │ │ │ │ 'base': {'name': 'ubuntu', 'channel': '22.04'}, │ │
│ │ │ │ │ 'charm-origin': 'charmhub', │ │
│ │ │ │ │ 'charm-name': 'nrpe', │ │
│ │ │ │ │ 'charm-rev': 97, │ │
│ │ │ │ │ 'charm-channel': 'stable', │ │
│ │ │ │ │ 'exposed': False, │ │
│ │ │ │ │ 'application-status': { │ │
│ │ │ │ │ │ 'current': 'active', │ │
│ │ │ │ │ │ 'message': 'Ready', │ │
│ │ │ │ │ │ 'since': '09 Mar 2023 08:44:58-08:00' │ │
│ │ │ │ │ }, │ │
│ │ │ │ │ 'relations': {'general-info': ['ubuntu']}, │ │
│ │ │ │ │ 'subordinate-to': ['ubuntu'], │ │
│ │ │ │ │ ... +1 │ │
│ │ │ │ }, │ │
│ │ │ │ 'ubuntu': { │ │
│ │ │ │ │ 'charm': 'ubuntu', │ │
│ │ │ │ │ 'base': {'name': 'ubuntu', 'channel': '20.04'}, │ │
│ │ │ │ │ 'charm-origin': 'charmhub', │ │
│ │ │ │ │ 'charm-name': 'ubuntu', │ │
│ │ │ │ │ 'charm-rev': 21, │ │
│ │ │ │ │ 'charm-channel': 'stable', │ │
│ │ │ │ │ 'exposed': False, │ │
│ │ │ │ │ 'application-status': { │ │
│ │ │ │ │ │ 'current': 'active', │ │
│ │ │ │ │ │ 'since': '08 Mar 2023 10:24:50-08:00' │ │
│ │ │ │ │ }, │ │
│ │ │ │ │ 'relations': {'juju-info': ['nrpe']}, │ │
│ │ │ │ │ 'units': { │ │
│ │ │ │ │ │ 'ubuntu/0': { │ │
│ │ │ │ │ │ │ 'workload-status': { │ │
│ │ │ │ │ │ │ │ 'current': 'active', │ │
│ │ │ │ │ │ │ │ 'since': '08 Mar 2023 10:24:50-08:00' │ │
│ │ │ │ │ │ │ }, │ │
│ │ │ │ │ │ │ 'juju-status': { │ │
│ │ │ │ │ │ │ │ 'current': 'idle', │ │
│ │ │ │ │ │ │ │ 'since': '09 Mar 2023 07:59:30-08:00', │ │
│ │ │ │ │ │ │ │ 'version': '2.9.38' │ │
│ │ │ │ │ │ │ }, │ │
│ │ │ │ │ │ │ 'leader': True, │ │
│ │ │ │ │ │ │ 'machine': '0', │ │
│ │ │ │ │ │ │ 'public-address': '10.29.120.99', │ │
│ │ │ │ │ │ │ 'subordinates': { │ │
│ │ │ │ │ │ │ │ 'nrpe/0': { │ │
│ │ │ │ │ │ │ │ │ 'workload-status': { │ │
│ │ │ │ │ │ │ │ │ │ 'current': 'active', │ │
│ │ │ │ │ │ │ │ │ │ 'message': 'Ready', │ │
│ │ │ │ │ │ │ │ │ │ 'since': '09 Mar 2023 │ │
│ │ 08:44:58-08:00' │ │
│ │ │ │ │ │ │ │ │ }, │ │
│ │ │ │ │ │ │ │ │ 'juju-status': { │ │
│ │ │ │ │ │ │ │ │ │ 'current': 'idle', │ │
│ │ │ │ │ │ │ │ │ │ 'since': '09 Mar 2023 │ │
│ │ 08:42:22-08:00', │ │
│ │ │ │ │ │ │ │ │ │ 'version': '2.9.38' │ │
│ │ │ │ │ │ │ │ │ }, │ │
│ │ │ │ │ │ │ │ │ 'leader': True, │ │
│ │ │ │ │ │ │ │ │ 'open-ports': ['icmp', '5666/tcp'], │ │
│ │ │ │ │ │ │ │ │ 'public-address': '10.29.120.99' │ │
│ │ │ │ │ │ │ │ } │ │
│ │ │ │ │ │ │ } │ │
│ │ │ │ │ │ } │ │
│ │ │ │ │ }, │ │
│ │ │ │ │ ... +1 │ │
│ │ │ │ } │ │
│ │ │ }, │ │
│ │ │ 'storage': {}, │ │
│ │ │ 'controller': {'timestamp': '09:28:11-08:00'} │ │
│ │ } │ │
│ │ units = (0,) │ │
│ │ url = 'ubuntu' │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'units'
from jhack.
Ummm, I was convinced I'd fixed this one. Will repro tomorrow. Thanks!
from jhack.
Actually, I missed an important detail; maybe this is resolved in later version?
Was running latest/stable, i.e. version 0.3.2.
from jhack.
yeah if you have time to check from edge that'd be great
from jhack.
Related Issues (20)
- disable wrapping in tail --output HOT 1
- Add a retry path flag to jhack lobotomy
- Feature request: jhack etail HOT 3
- jhack crashes on huge bundle deplyment: jhack/helpers.py:519 in _get_units HOT 1
- [feature request] imatrix export/import HOT 1
- jhack fire failed on MAAS in non-destructive mode (the same error for `version`) HOT 2
- 'jhack tail' is slow to stop after tailing for some time (20 charms, 100+ events, 20 mins) HOT 6
- Typo in no-YOLO mode configuration `|>` HOT 4
- jhack should allow you to nuke controllers HOT 1
- Clean up syntax warnings HOT 1
- `sync` fails on Juju 3.5.3 HOT 3
- `jhack tail --output=some-file.txt` should ignore the terminal width HOT 2
- App target for sync fails for subordinates HOT 4
- `show-relation` fails on cross model relations with alias HOT 2
- `show-relation` fails on surbordinate applications HOT 7
- Add jhack action to force juju leader switch
- `jhack tail app/0` doesn't work with `--file`
- jhack 4.3.3 is broken with Import Error HOT 4
- The `jhack vinfo my-app` should be updated to `jhack charm-info my-app` in documentation. HOT 3
- [docs] Add description for difference in color and icons HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jhack.