rickd's picture

I'm running a turnkey lamp v12, and had a working tklbam set up before.  I had cancelled my current account linked to my key, and created a new one. 

I know you use tklbam-init --force to do this, but it didn't work, even after completely removing /var/lib/tklbam, and reinstalling from apt-get.   I'm getting a usertoken error, and can't figure out why.

My api key is good, as it worked on another appliance doing the exact same thing to update the key.

Also: I'm paying for a backup monthly standard plan. It says there is email support. I can't figure out how exactly one would access this support? There is no mention of it anywhere on the dashboard.

Thank you!

Traceback (most recent call last):
  File "/usr/bin/tklbam-init", line 209, in <module>
    main()
  File "/usr/bin/tklbam-init", line 191, in main
    credentials = hb.get_credentials()
  File "/usr/lib/tklbam/hub.py", line 188, in get_credentials
    return Credentials(response)
  File "/usr/lib/tklbam/hub.py", line 159, in __init__
    self.usertoken = response['usertoken']
KeyError: 'usertoken'

 

Forum: 
Tags: 
Jeremy Davis's picture

Also FWIW I have just emailed you direct. After reading this I had a dig in my inbox and found your email (sorry I missed it).

For other users please use the Hub's Feedback feature. Obviously posting here is a good way to go too! :)

Jeremy Davis's picture

The issue in this case was caused by an update to the Hub API and occurred because of a combo of an old version of TurnKey (v12.x - later versions should not be affected) and an outdated version of TKLBAM.

The solution was to update to the latest version of TKLBAM like this:

apt-get update && apt-get install tklbam
Jeremy Davis's picture

If it was working with the old key but you're trying to add a new one then perhaps you have a different issue?

What version of TurnKey are you using? If you have no idea, you should be able to run

turnkey-version

It also might be useful to know what version of TKLBAM you have:

apt-cache policy tklbam

You can try removing /usr/lib/tklbam but I'm not clear whether that might help or not. It does seem to be consistent with the error that others were getting. And that is caused by a change in the Hub API (that requires a TKLBAM update).

Jeremy Davis's picture

I will need to talk with Liraz (the TKLBAM guru) about this...
Jeremy Davis's picture

You have the latest version of TKLBAM so it should be working...

So let me clarify. You have reinstated the old API key (taht worked) but from within the server you can see the backup that you made on another server (using the new API key)!?

Is that right? If so that all sounds a little messy...

TBH I would personally consider updating to the v13.0 server anyway (using your TKLBAM backup to migrate the data)... If not, at least make sure that you have the Squeeze LTS repo enabled (and added in your security sources.list) otherwise you won't have had any Debian security updates for a long time...

Jeremy Davis's picture

Firstly, sorry for slow reply.

It sounds like something weird is going on... Is the new server a v13.0 one or another old v12.x one?

I could be wrong but I suspect that you are experiencing some weird v12.x TKLBAM bug caused by some edge case that exists in your scenario...

While I'd really love to help you troubleshoot it my inclination is not to spend too much time on this. IMO the best solution is to update to a newer version of TKL first.

As of the release of v14.0RC1 we are no longer actively supporting v12.x. We're not going to completely avoid v12.x, but we only have limited resources so focusing our resources on what most people want (i.e. the new v14.0 version) seems like the most efficient way to go...

Jeremy Davis's picture

But we could make one... Here! :)

From what I understand you can back up the current machine using an old account? I understand that it's not the AWS/Hub account you want to use longer term but you can currently do that correct? Or do you no longer have access to that old account at all?

Just top clarify: WHere is the machine currently running? Where do you want your new machine running? Locally (on some virtualisation platform?) Or running on Amazon?

Also v14.0 is not yet available. It will probably be a couple of weeks away yet... Still I think upgrading to v13.0 for the moment is not a bad idea (even if you upgrade again to v14.0 in a few weeks).

Jeremy Davis's picture

I just wanted to let everyone know that we have dug a bit deeper into this issue and turns out the mistake was ours. We have just released an update to TKLBAM for v12.x servers. Updating should mean that TKLBAM on v12.x servers should now work reliably with new Hub accounts. Apologies on the delay getting this fixed and released.

So it should be a simple case of:

apt-get update && apt-get install tklbam

Then it should all work.

David McNeill's picture

The above fix also resolved this issue...

root@turnkey:/etc/cron.daily# tklbam-backup
Traceback (most recent call last):
  File "/usr/bin/tklbam-backup", line 513, in <module>
    main()
  File "/usr/bin/tklbam-backup", line 343, in main
    registry.credentials = hb.get_credentials()
  File "/usr/lib/tklbam/hub.py", line 188, in get_credentials
    return Credentials(response)
  File "/usr/lib/tklbam/hub.py", line 159, in __init__
    self.usertoken = response['usertoken']
KeyError: 'usertoken'
Jeremy Davis's picture

It looks like this server is v11.x. That was back when TurnKey was Ubuntu based.

It would not have had any security updates for the last 2+ years so I recommend that you migrate your data to the current v14.2 release if possible.

Rather than hijacking this thread with irrelevant info, please start a new thread.

Please share as much info as you can about the server, where it's running and what you are using it for. I'll do my best to give you as much advice and/or guidance as I can.

Add new comment