Comments (8)
Hi Maksim, this is not expected. jhack nuke
without further arguments will attempt to nuke the current model. However it seems that jhack can't determine which model is current, because of the output of juju status
, no model has a trailing "*"
.
Can you confirm that you are running that from a controller that HAS a current model?
If so, and you are running it from a snap and a VM, this is probably a duplicate of #30
from jhack.
Yes, it had a model
If I remember it right, once I put a model name it worked fine.
However, I don't think we need to print the entire traceback when no model is provided
from jhack.
That's not the issue. The issue is that juju status
SHOULD show the current model. The fact that it doesn't, suggests that the process doesn't have access to local/share/juju
as it should
from jhack.
I cannot reproduce it any more on my environment
from jhack.
ok, let me know if it comes up again
from jhack.
@PietroPasotti
I was able to reproduce it.
First, I had 5 models, then I nuked my current model, all is good. However, you see, there is no active model now
ubuntu@charm-dev:~$ juju models
Controller: tutorial-controller
Model Cloud/Region Type Status Units Access Last connection
charm-model microk8s/localhost kubernetes available 2 admin 3 minutes ago
controller microk8s/localhost kubernetes available 1 admin just now
test microk8s/localhost kubernetes available - admin 2023-01-17
then I try to nuke test
model, it fails.
ubuntu@charm-dev:~$ jhack nuke test
Traceback (most recent call last):
File "/snap/jhack/166/bin/jhack", line 8, in <module>
sys.exit(main())
File "/snap/jhack/166/lib/python3.8/site-packages/jhack/main.py", line 152, in main
app()
File "/snap/jhack/166/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/snap/jhack/166/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/snap/jhack/166/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/snap/jhack/166/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/snap/jhack/166/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/jhack/166/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/snap/jhack/166/lib/python3.8/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/snap/jhack/166/lib/python3.8/site-packages/jhack/utils/nuke.py", line 488, in nuke
_nuke(obj, **kwargs)
File "/snap/jhack/166/lib/python3.8/site-packages/jhack/utils/nuke.py", line 263, in _nuke
nukeables = _gather_nukeables(
File "/snap/jhack/166/lib/python3.8/site-packages/jhack/utils/nuke.py", line 209, in _gather_nukeables
model or current_model(),
File "/snap/jhack/166/lib/python3.8/site-packages/jhack/helpers.py", line 187, in current_model
return next(filter(key, all_models)).strip("*")
StopIteration
next, you switch to any model and rerun nuke, it works.
I could recommend either fixing the error message or automatically switch to another model
from jhack.
Yeah, unless you're running nuke
without arguments, it shouldn't bork because it can't find any current model.
That's a bug. Will work on it.
from jhack.
Should be fixed on edge
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.