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

DO deployment fails to find token in environment variable #945

Open
ixxie opened this issue May 5, 2018 · 3 comments
Open

DO deployment fails to find token in environment variable #945

ixxie opened this issue May 5, 2018 · 3 comments

Comments

@ixxie
Copy link

ixxie commented May 5, 2018

Following the manual, I saved my Digital Ocean authentication token to the DIGITAL_OCEAN_AUTH_TOKEN environment variable; nonetheless deployment fails with:

machine> creating droplet ...error: No token provided. Please use a valid token

Potentially this is related to #627 and #628 and possible resolved by #927?

Output of the --debug call:

machine> creating droplet ...Traceback (most recent call last):
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/bin/..nixops-wrapped-wrapped", line 985, in <module>
    args.op()
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/bin/..nixops-wrapped-wrapped", line 407, in op_deploy
    max_concurrent_activate=args.max_concurrent_activate)
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/lib/python2.7/site-packages/nixops/deployment.py", line 1051, in deploy
    self.run_with_notify('deploy', lambda: self._deploy(**kwargs))
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/lib/python2.7/site-packages/nixops/deployment.py", line 1040, in run_with_notify
    f()
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/lib/python2.7/site-packages/nixops/deployment.py", line 1051, in <lambda>
    self.run_with_notify('deploy', lambda: self._deploy(**kwargs))
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/lib/python2.7/site-packages/nixops/deployment.py", line 984, in _deploy
    nixops.parallel.run_tasks(nr_workers=-1, tasks=self.active_resources.itervalues(), worker_fun=worker)
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/lib/python2.7/site-packages/nixops/parallel.py", line 44, in thread_fun
    result_queue.put((worker_fun(t), None, t.name))
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/lib/python2.7/site-packages/nixops/deployment.py", line 957, in worker
    r.create(self.definitions[r.name], check=check, allow_reboot=allow_reboot, allow_recreate=allow_recreate)
  File "/nix/store/6l5rb0i15sqd87s5r143w586p4s4gd0p-nixops-1.6/lib/python2.7/site-packages/nixops/backends/digital_ocean.py", line 151, in create
    droplet.create()
  File "/nix/store/0sqxdr86ljyx9my67g4adna8zgdj4zp8-python2.7-python-digitalocean-1.13.2/lib/python2.7/site-packages/digitalocean/Droplet.py", line 545, in create
    self.name)
  File "/nix/store/0sqxdr86ljyx9my67g4adna8zgdj4zp8-python2.7-python-digitalocean-1.13.2/lib/python2.7/site-packages/digitalocean/Droplet.py", line 511, in __get_ssh_keys_id_or_fingerprint
    results = key.load_by_pub_key(ssh_key)
  File "/nix/store/0sqxdr86ljyx9my67g4adna8zgdj4zp8-python2.7-python-digitalocean-1.13.2/lib/python2.7/site-packages/digitalocean/SSHKey.py", line 51, in load_by_pub_key
    data = self.get_data("account/keys/")
  File "/nix/store/0sqxdr86ljyx9my67g4adna8zgdj4zp8-python2.7-python-digitalocean-1.13.2/lib/python2.7/site-packages/digitalocean/baseapi.py", line 164, in get_data
    req = self.__perform_request(url, type, params)
  File "/nix/store/0sqxdr86ljyx9my67g4adna8zgdj4zp8-python2.7-python-digitalocean-1.13.2/lib/python2.7/site-packages/digitalocean/baseapi.py", line 66, in __perform_request
    raise TokenError("No token provided. Please use a valid token")
digitalocean.baseapi.TokenError: No token provided. Please use a valid token
@ixxie
Copy link
Author

ixxie commented May 5, 2018

ping @nh2

@nh2
Copy link
Contributor

nh2 commented May 5, 2018

Yes it looks like this is exactly the issue that my PR #927 fixes.

@ixxie can you try my PR and confirm?

@ixxie
Copy link
Author

ixxie commented May 5, 2018

@nh2 it doesn't seem to work for me.... although maybe I did something wrong (I had to substitute system.nixosVersion with system.nixos.version in nix/eval-machine-info.nix as outlined in #873).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants