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

Trying to deploy latest NixOps: 'Deployment' object has no attribute '_eval_flags' #29

Closed
onny opened this issue Sep 30, 2021 · 4 comments

Comments

@onny
Copy link
Contributor

onny commented Sep 30, 2021

Hey,
when trying to deploy with:

$ nixops deploy -d pi-nix-testing
database> Connecting to qemu:///system...
database> preparing disk image...
Traceback (most recent call last):
  File "/nix/store/m3g2f9fj7l0n8v3p42yyfpplyf0jibp1-python3.9-nixops-2.0.0/bin/.nixops-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/__main__.py", line 56, in main
    args.op(args)
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/script_defs.py", line 688, in op_deploy
    depl.deploy(
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/deployment.py", line 1352, in deploy
    self.run_with_notify("deploy", lambda: self._deploy(**kwargs))
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/deployment.py", line 1341, in run_with_notify
    f()
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/deployment.py", line 1352, in <lambda>
    self.run_with_notify("deploy", lambda: self._deploy(**kwargs))
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/deployment.py", line 1255, in _deploy
    nixops.parallel.run_tasks(
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/parallel.py", line 106, in run_tasks
    raise list(exceptions.values())[0]
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/parallel.py", line 70, in thread_fun
    work_result = (worker_fun(t), None, t.name)
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops/deployment.py", line 1207, in worker
    r.create(
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops_virtd/backends/libvirtd.py", line 211, in create
    self._prepare_storage_volume()
  File "/nix/store/3il5njybb5whz9lh9wk9k3c70kb5xcn9-python3-3.9.6-env/lib/python3.9/site-packages/nixops_virtd/backends/libvirtd.py", line 239, in _prepare_storage_volume
    + self.depl._eval_flags(self.depl.nix_exprs)
AttributeError: 'Deployment' object has no attribute '_eval_flags'

tt fails with AttributeError: 'Deployment' object has no attribute '_eval_flags'.

This seems to be related to nix-community/nixops-vbox#28 :

_eval_flags and nix_exprs are undefined in nixops 35ac0208, which causes an error when deploying with targetEnv="virtualbox" - one can use nixops.evaluation.eval instead to make it work.

Not sure how to patch this, looks a bit too complicated for me ...

Regards
Jonas

@nrdsp
Copy link

nrdsp commented Apr 27, 2022

Either with deployment.targetEnv = "libvirtd"; or deployment.targetEnv = "virtualbox"; I'm getting a similar error on disk creation with nixopsUnstable. Here's the relevant log for the libvirtd target environment:

nixops deploy -d test-server
test-server> Connecting to qemu:///system...
test-server> preparing disk image...
Traceback (most recent call last):
  File "/nix/store/qqr13imyf3ccg2xfa2f8fwahqxb8k0y0-python3.9-nixops-2.0.0-pre-7220cbd/bin/.nixops-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/__main__.py", line 56, in main
    args.op(args)
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/script_defs.py", line 715, in op_deploy
    depl.deploy(
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/deployment.py", line 1352, in deploy
    self.run_with_notify("deploy", lambda: self._deploy(**kwargs))
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/deployment.py", line 1341, in run_with_notify
    f()
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/deployment.py", line 1352, in <lambda>
    self.run_with_notify("deploy", lambda: self._deploy(**kwargs))
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/deployment.py", line 1255, in _deploy
    nixops.parallel.run_tasks(
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/parallel.py", line 106, in run_tasks
    raise list(exceptions.values())[0]
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/parallel.py", line 70, in thread_fun
    work_result = (worker_fun(t), None, t.name)
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops/deployment.py", line 1207, in worker
    r.create(
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops_virtd/backends/libvirtd.py", line 211, in create
    self._prepare_storage_volume()
  File "/nix/store/3gv1yir9j92y8k92pi7h1r5hlhyd0drn-python3-3.9.11-env/lib/python3.9/site-packages/nixops_virtd/backends/libvirtd.py", line 239, in _prepare_storage_volume
    + self.depl._eval_flags(self.depl.nix_exprs)
AttributeError: 'Deployment' object has no attribute '_eval_flags'

@deepfire
Copy link
Contributor

deepfire commented Aug 8, 2023

As of latest nixops_unstable in Nixpkgs, the problem is still there.

@deepfire
Copy link
Contributor

deepfire commented Aug 8, 2023

So, preliminary findings:

  1. _eval_flags were removed from Nixops circa 2020
  2. extra_nix_eval_flags seem to have taken their place.

@deepfire
Copy link
Contributor

deepfire commented Aug 9, 2023

Fixed in #33

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

No branches or pull requests

3 participants