Git Product home page Git Product logo

Comments (8)

PietroPasotti avatar PietroPasotti commented on September 23, 2024

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.

beliaev-maksim avatar beliaev-maksim commented on September 23, 2024

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.

PietroPasotti avatar PietroPasotti commented on September 23, 2024

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.

beliaev-maksim avatar beliaev-maksim commented on September 23, 2024

I cannot reproduce it any more on my environment

from jhack.

PietroPasotti avatar PietroPasotti commented on September 23, 2024

ok, let me know if it comes up again

from jhack.

beliaev-maksim avatar beliaev-maksim commented on September 23, 2024

@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.

PietroPasotti avatar PietroPasotti commented on September 23, 2024

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.

PietroPasotti avatar PietroPasotti commented on September 23, 2024

Should be fixed on edge

from jhack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.