Kefas's picture

Hi,

I use Redmine appliance and I want to use it in special offline mode (super secure private network with no-access to internet). I have problem with tklbam-backup. I tried tklbam-backup --dump=/tmp/myback , but this crashed because of this network error:

root@redmine ~# tklbam-backup --dump=/tmp/myback
Traceback (most recent call last):
  File "/usr/bin/tklbam-backup", line 452, in <module>
      main()
  File "/usr/bin/tklbam-backup", line 280, in main
      registry.update_profile(hb, conf.force_profile)
  File "/usr/lib/tklbam/registry.py", line 193, in update_profile
      new_profile = hub_backups.get_new_profile(profile_id, profile_timestamp)
  File "/usr/lib/tklbam/hub.py", line 200, in get_new_profile
      response = self._api('GET', 'archive/timestamp/', attrs)
  File "/usr/lib/tklbam/hub.py", line 177, in _api
      return self.api.request(method, self.API_URL + uri, attrs, headers)
  File "/usr/lib/tklbam/hub.py", line 126, in request
      raise APIError(e.code, e.name, e.description)
hub.APIError: error(6, "Couldn't resolve host 'hub.turnkeylinux.org'")
 
Is there a way to use tklbam without internet access?
Thanx for answer - Petr alias Kefas
Forum: 
Jeremy Davis's picture

AFAIK, even when using local storage TKLBAM still needs to download the appliance profile. I guess the reasoning for this is primarily so any issues can be addressed at the TKL end and automatically updated.

I'm sure that it would be possible but would involve a bit of hackery... I imagine that you'd need to download the profile and then host it on a dumby server (within your LAN). Otherwise, seeing as TKLBAM is open source, you could 'adjust' the code to act as you desire...

Liraz Siri's picture

Once you have a profile, the new version of TKLBAM will no longer require access to the Hub. Instead of issuing an exception it should be issuing a warning:

# echo 127.0.0.1 hub.turnkeylinux.org > /etc/hosts
# tklbam-backup --dump=/tmp/dump
warning: using cached profile because of a Hub error: error(7, "couldn't connect to host")

If you don't, can't or don't want to get a profile from the Hub you'll have to use TKLBAM in solo mode.

An excerpt from tklbam-init --help:

--force-profile=empty          "empty" is a special profile_id value that creates an empty
                               backup profile. Backup configurations will only be taken
                               from /etc/tklbam.

--force-profile=PATH           Path to a custom backup profile
                               Details: tklbam-internal create-profile --help

--solo                         Solo mode: disables link to Hub.
                               You'll need to --force-profile=empty or use a custom profile

                               tklbam-backup will only work with --address or --dump options
                               tklbam-restore will only work with --address or a backup extract

Good luck!

Jeremy Davis's picture

Thanks for clarifying and correcting my vague ideas...! :)

BTW are the current appliance profiles available somewhere (e.g. GitHub)? Some may find them a useful template to create their own...?!

Liraz Siri's picture

They should be on GitHub, if not that's something that needs to be corrected.

Jeremy Davis's picture

Sorry I probably should have just had a look before i asked... Turns out they are indeed on GitHub... Suprisingly (sarcasm) they are in a repo called 'tklbam-profiles'.

It probably took me longer to type the question than it did to find it...!

Kefas's picture

Maybe I have old version of tklbam: --solo and --force-profile made errors:
 
root@redmine /tmp# tklbam-backup --dump=/tmp/dump --force-profile=empty --solo
error: option --solo not recognized
 
root@redmine /tmp# tklbam-init --solo
error: option --solo not recognized
Syntax: /usr/bin/tklbam-init [ API-KEY ]
Initialization (start here)
Arguments:
API-KEY Cut and paste this from your Hub account's user profile.
Options:
--force Force re-initialization with new API-KEY.

 

and --force-profile=empty also ...

root@redmine /tmp# tklbam-backup --dump=/tmp/dump --force-profile=empty

Traceback (most recent call last):

File "/usr/bin/tklbam-backup", line 452, in <module>
main()
File "/usr/bin/tklbam-backup", line 280, in main
registry.update_profile(hb, conf.force_profile)
File "/usr/lib/tklbam/registry.py", line 193, in update_profile
new_profile = hub_backups.get_new_profile(profile_id, profile_timestamp)
File "/usr/lib/tklbam/hub.py", line 200, in get_new_profile
response = self._api('GET', 'archive/timestamp/', attrs)
File "/usr/lib/tklbam/hub.py", line 177, in _api
return self.api.request(method, self.API_URL + uri, attrs, headers)
File "/usr/lib/tklbam/hub.py", line 126, in request
raise APIError(e.code, e.name, e.description)
hub.APIError: error(35, 'gnutls_handshake() failed: A TLS warning alert has been received.')
 

root@redmine /tmp# tklbam-init --force-profile=empty

 

error: option --force-profile not recognized
Syntax: /usr/bin/tklbam-init [ API-KEY ]
Initialization (start here)
Arguments:
API-KEY Cut and paste this from your Hub account's user profile.
Options:
--force Force re-initialization with new API-KEY.
 
I tried ISO and VMDK of Redmine from your pages. Should I update any package?
How to do it in offline mode?
Thanks
Petr (Kefas)
 

 

Liraz Siri's picture

Looks like you're using an old version of TKLBAM. What version of TurnKey are you using? If you're totally offline then maybe that prevented you from getting a newer version.

Find out which version of TKLBAM you have:

root@core ~# dpkg -l tklbam
Kefas's picture

root@redmine /tmp# dpkg -l tklbam ...
tklbam 1.3+4+gd928e2f amd64 TurnKey Linux Backup and Migration agent
 
Here it is ... I have old version.
OK, I try some attemps to get updates into my installation.
Hard way :-)
 
Thank you for help and for all appliences.
Petr aka Kefas
Liraz Siri's picture

You need to upgrade to TKLBAM 1.4 my friend. If you can't get the machine online you can download the tklbam package and its dependencies by hand from the archive.turnkeylinux.org website, transfer them offline and install them by hand:

# dpkg -i tklbam*.deb turnkey-pylib*.deb pycurl-wrapper*.deb

You'll need to download the following custom packages:

tklbam-squid (>= 2.7.STABLE9-2.1turnkey+25)
tklbam-duplicity (>= 0.6.18)
tklbam-python-boto (>= 2.3.0)
turnkey-pylib (>= 0.5)
pycurl-wrapper (>= 1.2)
Kefas's picture

I made update, started backup and get error because of FIXCLOCK. So I disabled "x" on fixclock script (chmod -x /etc/tklbam/hooks.d/fixclock) and everything is OK.

Now I am happy :-)

Thank you very much!

Add new comment