Update through openhabian-config fails

Hi guys,
I’ve tried to update using the openhabian-config tool. However it stops with a failure, so that my installation is no longer usable right now:

Here is the output when I try to run the update again:

openhabian@openhab:~$ sudo openhabian-config
[sudo] password for openhabian:
2018-10-25_14:55:43_CEST [openHABian] Checking for root privileges… OK
2018-10-25_14:55:43_CEST [openHABian] Loading configuration file ‘/etc/openhabian.conf’… OK
2018-10-25_14:55:43_CEST [openHABian] openHABian configuration tool version: [master]v1.4.1-416(de039da)
2018-10-25_14:55:44_CEST [openHABian] Checking for changes in origin… OK
2018-10-25_14:55:51_CEST [openHABian] Updating repositories and upgrading installed packages…
$ apt update
Hit:1 p://archive.raspberrypi.org/debian stretch InRelease
Get:2 ://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Ign:3 ://repos.azulsystems.com/debian stable InRelease
Hit:4 ://repos.azulsystems.com/debian stable Release
Ign:5 ://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:6 ://dl.bintray.com/openhab/apt-repo2 stable Release
Hit:7 ://deb.nodesource.com/node_8.x stretch InRelease
Get:8 ://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Fetched 11.7 MB in 11s (1,045 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.

$ apt --yes upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python2.7 (2.7.13-2+deb9u3) …
Sorry: TypeError: compile() expected string without null bytes
Sorry: TypeError: compile() expected string without null bytes
dpkg: error processing package python2.7 (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of samba:
samba depends on python2.7:any; however:
Package python2.7 is not configured yet.

dpkg: error processing package samba (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba-common-bin:
samba-common-bin depends on python2.7:any; however:
Package python2.7 is not configured yet.

dpkg: error processing package samba-common-bin (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python2.7-dev:
python2.7-dev depends on python2.7 (= 2.7.13-2+deb9u3); however:
Package python2.7 is not configured yet.

dpkg: error processing package python2.7-dev (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-dev:
python-dev depends on python2.7-dev (>= 2.7.13-1~); however:
Package python2.7-dev is not configured yet.

dpkg: error processing package python-dev (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python2.7
samba
samba-common-bin
python2.7-dev
python-dev
Updating FireMotD available updates count … 2018-10-25 14:57:09,820: FireMotD: Error: Template folder doesn’t exist. Upgrading from an older version? Please run make again or run the install function “FireMotD -I -v”.

E: Sub-process /usr/bin/dpkg returned an error code (1)
FAILED
[18:57:09] openhabian@openhab:~$ sudo openhabian-config

During the first run, it did ask about the smb.conf (keep or use new) and I had selected to use a new one. Other than that, no interaction was required up until when the error came…

Hope you can help to save my system… Had lot’s of KNX configs done through PaperUI which I wouldn’t know how to restore…

thanks!

Try:

sudo apt install python2.7 python-pip

And then try the install again

Also you could select the option in openhab config to install from scratch. Maybe that will work.

But @vzorglub is correct if it’s complaining about python only and python not installed then think we found the issue.

Hi,
I tried that, but it generates pretty much the same output and error message - see output below.

It seems the python configuration is getting stuck because of something…

Any other suggestions?

thanks!

openhabian@openhab : ~ $ sudo apt install python2.7 python-pip

[sudo] password for openhabian:

Reading package lists… Done

Building dependency tree

Reading state information… Done

python2.7 is already the newest version (2.7.13-2+deb9u3).

python2.7 set to manually installed.

python-pip is already the newest version (9.0.1-2+rpt2).

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

5 not fully installed or removed.

After this operation, 0 B of additional disk space will be used.

Do you want to continue? [Y/n] y

Setting up python2.7 (2.7.13-2+deb9u3) …

Sorry: TypeError: compile() expected string without null bytes

Sorry: TypeError: compile() expected string without null bytes

dpkg: error processing package python2.7 (–configure):

subprocess installed post-installation script returned error exit status 1

dpkg: dependency problems prevent configuration of samba:

samba depends on python2.7:any; however:

Package python2.7 is not configured yet.

dpkg: error processing package samba (–configure):

dependency problems - leaving unconfigured

dpkg: dependency problems prevent configuration of samba-common-bin:

samba-common-bin depends on python2.7:any; however:

Package python2.7 is not configured yet.

dpkg: error processing package samba-common-bin (–configure):

dependency problems - leaving unconfigured

dpkg: dependency problems prevent configuration of python2.7-dev:

python2.7-dev depends on python2.7 (= 2.7.13-2+deb9u3); however:

Package python2.7 is not configured yet.

dpkg: error processing package python2.7-dev (–configure):

dependency problems - leaving unconfigured

dpkg: dependency problems prevent configuration of python-dev:

python-dev depends on python2.7-dev (>= 2.7.13-1~); however:

Package python2.7-dev is not configured yet.

dpkg: error processing package python-dev (–configure):

dependency problems - leaving unconfigured

Errors were encountered while processing:

python2.7

samba

samba-common-bin

python2.7-dev

python-dev

Updating FireMotD available updates count … 2018-10-26 10:08:29,675: FireMotD: Error: Template folder doesn’t exist. Upgrading from an older version? Please run make again or run the install function “FireMotD -I -v”.

E: Sub-process /usr/bin/dpkg returned an error code (1)

would that put me at risk of loosing my configuration done through paperui?

I think your OS is in need of a complete reset.

From your SD card save:
/etc/openhab2 (This contains your paperUI config and other config)
/usr/share/openhab (This contains your items, rules…)

Your can re-flash openHABian on the card and after installation is completed you can then restore these two folders

1 Like

Hi,
but that seems like a crude solution to the problem.

I am pretty sure the problem is with python2.7
I’ve tried this:

openhabian@openhab:~$ sudo dpkg --configure python2.7
Setting up python2.7 (2.7.13-2+deb9u3) …
Sorry: TypeError: compile() expected string without null bytes
Sorry: TypeError: compile() expected string without null bytes
dpkg: error processing package python2.7 (–configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python2.7

So maybe it’s a more general problem in the python2.7 package?

I my own experience, by trying to fix little bit here and there you are going to break more bits somewhere else.

@oh-fan run the openhabian config. There is a way to do a reinstall of various packages vs update. This may solve your problem.

Not sure if you tried this or not. Although sometimes a reflash could be faster.

Also, just to point out if on an sd card and if the sd card has any age to it, you could have a worn out card possibly. Not saying this for certain, but mine went out the other day. It caused some strange things before I realized the problem.