HomeMatic Add-on: Unable to create and restore backups

Hi,
I’m facing an issue with the HomeMatic Add-on. I’m using HM-MOD-RPI-PCB for rf and HmIP-RFUSB for HmIP on a RPi 4 (4GB) with Hassio 0.113.0 which in general seem to work as I’m able to add a device (e.g. window sensor HM-Sec-SCo). But my orignal intention was to migrate my CCU2 to the RPi to get rid of an addtional device. I’m using the default config (just with RF and HmIP enabled) on default ports:

rf_enable: true
wired_enable: false
hmip_enable: true
rf:
  - type: CCU2
    device: /dev/ttyAMA0
wired:
  - serial: xy
    key: abc
    ip: 192.168.0.0
hmip:
  - type: HMIP_CCU2
    device: /dev/ttyUSB0
regahss_reset: false

The issue I’m facing is that I’m neither able to create or restore a backup. When I try to create a backup it seems that the OCCU starts the process (normal “will take some time message”), but then fails with the error: " An internal error was detected in the service software. The diagnostics are being emailed to the service system administrator (root).". An email address is set in the user account but no message is sent. Error log looks like this:

2020/07/24 12:35:14.260 <Debug> HSSXmlRpcEventDispatcher::Handle send completed
2020/07/24 12:35:14.260 <Debug> HSSXmlRpcEventDispatcher::Handle send 1 events
2020/07/24 12:35:14.269 <Debug> HSSXmlRpcEventDispatcher::Handle send completed
can't read "_cgi(mail_relay)": no such element in array
    while executing
"socket $_cgi(mail_relay) 25"
    (procedure "cgi_mail_end" line 22)
    invoked from within
"cgi_mail_end"
    ("uplevel" body line 36)
    invoked from within
"uplevel 1 [lindex $args end]"
    (procedure "cgi_body" line 7)
    invoked from within
"cgi_body {
		    if {[info exists _cgi(client_error)]} {
			cgi_h3 "Client Error"
			cgi_p "$errMsg  Report this to your system administrator or brows..."
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $html"
    (procedure "cgi_html" line 9)
    invoked from within
"cgi_html {
		cgi_body {
		    if {[info exists _cgi(client_error)]} {
			cgi_h3 "Client Error"
			cgi_p "$errMsg  Report this to your system administr..."
    ("uplevel" body line 18)
    invoked from within
"uplevel 1 {
	global env _cgi errorInfo
	if {1==[catch $_cgi(body) errMsg]} {
	    # error occurred, handle it
	    set _cgi(errorInfo) $errorInfo
	 ..."
    (procedure "cgi_eval" line 7)
    invoked from within
"cgi_eval {
  #cgi_debug -on
  cgi_input
  catch {
    import debug
    cgi_debug -on
  }
  set action "put_page"
  catch { import action }
  if {[s..."
    (file "/opt/hm/www/config/cp_security.cgi" line 1573)
172.30.32.2 - - [24/Jul/2020:12:35:15 +0200] "GET /config/cp_security.cgi?sid=@SESSION_ID_REMOVED@&action=create_backup HTTP/1.1" 200 272 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
2020-07-24 12:36:11,347 [INFO] DeviceBackgroundUpdateSubsystem - SYSTEM: 0 Accesspoints in Queue
2020-07-24 12:36:11,347 [INFO] DeviceBackgroundUpdateSubsystem - SYSTEM: Permanent-/Burstlistener Handler utilization: 0/50 used
2020-07-24 12:36:11,347 [INFO] DeviceBackgroundUpdateSubsystem - SYSTEM: Eventlistener Handler utilization: 0/50 used

Backup restoring just won’t continue when selecting the .sbk-file and pressing the restore button. Log at that time:

172.30.32.2 - - [24/Jul/2020:12:41:25 +0200] "POST /config/cp_security.cgi?sid=@SESSION_ID_REMOVED@ HTTP/1.1" 200 3116 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
172.30.32.2 - - [24/Jul/2020:12:41:25 +0200] "POST /api/homematic.cgi HTTP/1.1" 200 55 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
172.30.32.2 - - [24/Jul/2020:12:41:25 +0200] "POST /api/homematic.cgi HTTP/1.1" 200 479 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
172.30.32.2 - - [24/Jul/2020:12:41:25 +0200] "POST /api/homematic.cgi HTTP/1.1" 200 55 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
172.30.32.2 - - [24/Jul/2020:12:41:26 +0200] "POST /esp/system.htm?sid=@SESSION_ID_REMOVED@&action=UpdateUI HTTP/1.1" 200 549 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
172.30.32.2 - - [24/Jul/2020:12:41:29 +0200] "POST /api/homematic.cgi HTTP/1.1" 200 61 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
172.30.32.2 - - [24/Jul/2020:12:41:29 +0200] "POST /esp/system.htm?sid=@SESSION_ID_REMOVED@&action=UpdateUI HTTP/1.1" 200 549 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
2020/07/24 12:41:29 [warn] 289#289: *6741 a client request body is buffered to a temporary file /var/lib/nginx/body/0000000028, client: 172.30.32.2, server: _, request: "POST /config/cp_security.cgi?sid=@SESSION_ID_REMOVED@ HTTP/1.1", host: "192.168.0.40:8123"
172.30.32.2 - - [24/Jul/2020:12:41:29 +0200] "POST /config/cp_security.cgi?sid=@SESSION_ID_REMOVED@ HTTP/1.1" 200 280 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"

Does somebody know how to fix this?

Hi @Maxul
did you ever resolve this? I’m moving from a custom install of hassio on Ubuntu to a HassOS VM and ran into the same issue trying to take a backup.

Hi @ToSa27,

not via the Homematic Webinterface, but directly via the Hassio Snapshots (Backup). When you create a partial backup it is easy to find the Homematic data in the archive :wink: So you cannot migrate from Homematic CCU and vice versa (you need to disconnect and connect all hardware once), but once in Hassio you’re able to backup and restore.