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

Building a new machine with Hetzner fails if it has to create an admin user first #563

Closed
grahamc opened this issue Dec 9, 2016 · 3 comments

Comments

@grahamc
Copy link
Member

grahamc commented Dec 9, 2016

nix-dev...............> creating an exclusive robot admin account for ‘nix-dev’... Traceback (most recent call last):
  File "/nix/store/b8dgrq5wv624xwbd3404sn026i9jxy00-nixops-1.4/bin/..nixops-wrapped-wrapped", line 939, in <module>
    args.op()
  File "/nix/store/b8dgrq5wv624xwbd3404sn026i9jxy00-nixops-1.4/bin/..nixops-wrapped-wrapped", line 374, in op_deploy
    repair=args.repair, dry_activate=args.dry_activate)
  File "/nix/store/b8dgrq5wv624xwbd3404sn026i9jxy00-nixops-1.4/lib/python2.7/site-packages/nixops/deployment.py", line 971, in deploy
    self._deploy(**kwargs)
  File "/nix/store/b8dgrq5wv624xwbd3404sn026i9jxy00-nixops-1.4/lib/python2.7/site-packages/nixops/deployment.py", line 928, in _deploy
    nixops.parallel.run_tasks(nr_workers=-1, tasks=self.active_resources.itervalues(), worker_fun=worker)
  File "/nix/store/b8dgrq5wv624xwbd3404sn026i9jxy00-nixops-1.4/lib/python2.7/site-packages/nixops/parallel.py", line 41, in thread_fun
    result_queue.put((worker_fun(t), None))
  File "/nix/store/b8dgrq5wv624xwbd3404sn026i9jxy00-nixops-1.4/lib/python2.7/site-packages/nixops/deployment.py", line 901, in worker
    r.create(self.definitions[r.name], check=check, allow_reboot=allow_reboot, allow_recreate=allow_recreate)
  File "/nix/store/b8dgrq5wv624xwbd3404sn026i9jxy00-nixops-1.4/lib/python2.7/site-packages/nixops/backends/hetzner.py", line 589, in create
    self.robot_admin_pass) = server.admin.create()
  File "/nix/store/lwqybpcw6vyd8s9gm4jbh1q069pnkbp2-python2.7-hetzner-0.7.4/lib/python2.7/site-packages/hetzner/server.py", line 222, in create
    assert "msgbox_success" in response.read()
AssertionError

once I created a user with an arbitrary password, it seemed to do okay (though I have not yet successfully deployed to it.)

@domenkozar
Copy link
Member

cc @aszlig

@FPtje
Copy link
Contributor

FPtje commented Dec 18, 2016

Also hitting this issue. Printing response.read() gives the following:

<form id="admin_update" onsubmit="new Ajax.Updater('admin_422502', '/server/adminUpdate', {asynchronous:true, evalScripts:true, onLoading:function(request, json){addAjaxLoader('admin_422502')}, parameters:Form.serialize(this)}); return false;" action="/server/adminUpdate" method="post"><table class="form">
  <tr>
    <td class="label_req">Login</td>
    <td class="element"></td>
  </tr>
    <tr class="submit_row">
    <td class="label">
      <input class='button calltoaction' type='submit' value='Save'  />      <input type="hidden" name="id" value="422502" />
    </td>
  </tr>
</table>
</form>
<input class='button' type='button' value='Delete account' onclick="javascript:  new Ajax.Updater('admin_422502', '/server/adminDelete/id/422502', {asynchronous:true, evalScripts:true}); addAjaxLoader('admin_422502'); return false; ">

@aszlig
Copy link
Member

aszlig commented Dec 18, 2016

Sent a mail to Hetzner, asking whether they could add OAauth for specific servers to the API.

As for this issue, I guess this belongs to the hetzner Python API, I've opened an issue there: aszlig/hetzner#18

@aszlig aszlig closed this as completed Dec 18, 2016
aszlig added a commit to NixOS/nixpkgs that referenced this issue Dec 20, 2016
This essentially unbreaks deploying new Hetzner machines with NixOps,
because the Hetzner robot has changed its way of handling admin
accounts.

It also now provides a more helpful error message (instead of an
AssertionError) if admin account creation has failed.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Reported-by: Graham Christensen <graham@grahamc.com>
Issue: NixOS/nixops#563
aszlig added a commit to NixOS/nixpkgs that referenced this issue Dec 20, 2016
This essentially unbreaks deploying new Hetzner machines with NixOps,
because the Hetzner robot has changed its way of handling admin
accounts.

It also now provides a more helpful error message (instead of an
AssertionError) if admin account creation has failed.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Reported-by: Graham Christensen <graham@grahamc.com>
Issue: NixOS/nixops#563
(cherry picked from commit ccbce6b)
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

4 participants