Homegear / Homegear-Docker

Dockerfile to create Homegear images
10 stars 17 forks source link

Problem with latest docker images on docker hub #9

Closed benjamin-salchow closed 5 years ago

benjamin-salchow commented 5 years ago

Hello Homegear development team, since some days I got problems with your docker image for x86 systems: https://hub.docker.com/r/homegear/homegear

After starting this image i got issues like:

#id: 'homegear': no such user
id: 'homegear': no such user
cp: cannot stat '/var/lib/homegear.data/modules/*': No such file or directory
cp: cannot stat '/var/lib/homegear.data/node-blue/nodes/*': No such file or directory
chown: invalid user: 'homegear:homegear'
homegear: unrecognized service
homegear-management: unrecognized service
homegear-webssh: unrecognized service
homegear-influxdb: unrecognized service
08/02/19 18:24:54.079 Info: Disposing family module mod_miscellaneous.so
08/02/19 18:24:54.079 Info: Disposing family module mod_mbus.so
08/02/19 18:24:54.079 Info: Disposing family module mod_knx.so
08/02/19 18:24:54.079 Info: Disposing family module mod_homematicbidcos.so
08/02/19 18:24:54.079 Info: Disposing family module mod_ccu.so
08/02/19 18:24:54.080 (Shutdown) => Disposing licensing modules
08/02/19 18:24:54.080 Info: Disposing licensing module mod_easy_licensing.so
08/02/19 18:24:54.099 (Shutdown) => Shutdown complete.
08/02/19 18:24:54.103 Info: Process with id 5656 ended.
08/02/19 18:24:54.103 Info: Homegear exited with exit code 0. Stopping monitor process.

After attaching a bash to the container I saw that homegear was not installed on the container (stable and latest) like done in your Docker file.

This is the stable image I used:

docker pull homegear/homegear:stable

Trying to pull repository docker.io/homegear/homegear ... 
sha256:53b4568febe7234092d5b7ca03214044f94cb8e49eb78bcd09f916635dfe1aea: Pulling from docker.io/homegear/homegear
0a4690c5d889: Pull complete 
6ba02092696e: Pull complete 
16c3af744e01: Pull complete 
b658aeb6c0dd: Pull complete 
cc6f66e096e7: Pull complete 
Digest: sha256:53b4568febe7234092d5b7ca03214044f94cb8e49eb78bcd09f916635dfe1aea

But still after installing the homegear again like in your docker file: install libhomegear-node homegear homegear-management homegear-webssh homegear-adminui homegear-nodes-core homegear-nodes-extra homegear-homematicbidcos homegear-homematicwired homegear-insteon homegear-max homegear-philipshue homegear-sonos homegear-kodi homegear-ipcam homegear-beckhoff homegear-knx homegear-enocean homegear-intertechno homegear-rsl homegear-rs2w homegear-mbus homegear-zwave homegear-ccu homegear-easyled homegear-easyled2 homegear-easycam homegear-influxdb;

Does fix the user issues, but still is not functional working as expected. This is the output after installing and restarting the container:

cp: cannot stat '/var/lib/homegear.data/modules/*': No such file or directory
cp: cannot stat '/var/lib/homegear.data/node-blue/nodes/*': No such file or directory
[....] Starting Homegear: homegear/etc/init.d/homegear: line 94: ulimit: real-time priority: cannot modify limit: Operation not permitted
08/06/19 13:33:48.297 Loading RPC server settings from /etc/homegear/rpcservers.conf
08/06/19 13:33:48.298 Loading RPC client settings from /etc/homegear/rpcclients.conf
08/06/19 13:33:48.300 Info: Setting allowed core file size to "18446744073709551615" for user with id 0 and group with id 0.
08/06/19 13:33:48.300 Info: Core file size now is "18446744073709551615".
08/06/19 13:33:48.300 Info: Setting maximum thread priority to "0" for user with id 0 and group with id 0.
08/06/19 13:33:48.300 Info: Maximum thread priority now is "0".
08/06/19 13:33:48.300 Info: Setting allowed core file size to "18446744073709551615" for user with id 0 and group with id 0.
08/06/19 13:33:48.301 Info: Core file size now is "18446744073709551615".
08/06/19 13:33:48.301 Info: Setting maximum thread priority to "0" for user with id 0 and group with id 0.
08/06/19 13:33:48.301 Info: Maximum thread priority now is "0".
cat: /boot/cmdline.txt: No such file or directory
. ok 
[....] Starting homegear-management: homegear-management/etc/init.d/homegear-management: line 62: ulimit: real-time priority: cannot modify limit: Operation not permitted
. ok 
[....] Starting homegear-webssh: homegear-webssh/etc/init.d/homegear-webssh: line 62: ulimit: real-time priority: cannot modify limit: Operation not permitted
. ok 
[....] Starting Homegear-InfluxDB: homegear-influxdb/etc/init.d/homegear-influxdb: line 67: ulimit: real-time priority: cannot modify limit: Operation not permitted
. ok 
08/06/19 13:33:48.301 Git branch of libhomegear-base:     -
08/06/19 13:33:48.301 Git commit SHA of Homegear:         -
08/06/19 13:33:48.301 Git branch of Homegear:             -
08/06/19 13:33:48.301 Starting Homegear...
08/06/19 13:33:48.301 Homegear version 0.7.40-2942
08/06/19 13:33:48.301 Git commit SHA of libhomegear-base: -
08/06/19 13:33:48.301 Git branch of libhomegear-base:     -
08/06/19 13:33:48.301 Git commit SHA of Homegear:         -
08/06/19 13:33:48.301 Git branch of Homegear:             -
08/06/19 13:33:48.301 Determining maximum thread count...

The homegear socket is also not ready:

docker exec -it homegear homegear -r
08/06/19 13:40:08.608 Could not connect to socket. Error: No such file or directory
08/06/19 13:40:08.608 Could not connect to socket. Error: No such file or directory
08/06/19 13:40:08.608 Could not connect to socket. Error: No such file or directory
08/06/19 13:40:08.608 Could not connect to socket. Error: No such file or directory

Is there a known issue with the existing docker image?

The sad thing is, that I can't go back to the old docker image, because there is no version tag on it - like for example in influxdb: https://hub.docker.com/_/influxdb?tab=tags

I'll try to build your dockerfile local on my machine later this day, to verify if it's a problem with the existing Dockerfile or just a broken image on docker hub. I'm not sure if the pi version have the same issues (never used Docker on it).

I'll post an update later after building the image locally.

benjamin-salchow commented 5 years ago

With local docker build, homegear was installed. The existing images from docker hub does not contain homgear. I guess there is something wrong with the building and upload process to docker hub. But still, my x86 container doesn't work. I'll try to search for a reason. Does somebody else have the same issue with x86 container image?

hfedcba commented 5 years ago

I'm looking at the problem right now. It probably was an error in the stable build that caused Homegear not to be installed. The fixed version already was online when you built the Docker image. Let me check.

hfedcba commented 5 years ago

It was a problem caused by forking the main process for monitoring and a new implementation of the signal handlers. The problem only occurs, when Homegear is started with -d, which is the case in the Docker image. I'll check if it works as soon as Homegear is compiled and then close this issue.

Thank you!

benjamin-salchow commented 5 years ago

Hello, thank you very much for the information. My current workaround is to build a dedicated container with the version before. This is my Docker file:

FROM debian:stretch
MAINTAINER Sathya Laufer <sathya@homegear.email>
ENV HG_VERISON=0.7.39-2773
ENV HGN_VERSION=0.1.7-38
ENV HGA_VERSION=0.1.0-143
RUN apt-get update && apt-get -y install apt-transport-https wget ca-certificates apt-utils gnupg libzip4 libavahi-client3 libavahi-client-dev insserv
RUN echo "Installing Homegear version: ${HG_VERISON}"
RUN \
    touch /tmp/HOMEGEAR_STATIC_INSTALLATION; \
    wget https://apt.homegear.eu/Release.key && apt-key add Release.key && rm Release.key; \
    echo 'deb https://apt.homegear.eu/Debian/ stretch/' >> /etc/apt/sources.list.d/homegear.list; \
    apt-get update && apt-get -y install libhomegear-base=${HG_VERISON} libhomegear-node=${HGN_VERSION} homegear=${HG_VERISON} homegear-management=${HG_VERISON} homegear-webssh=${HG_VERISON} homegear-adminui=${HGA_VERSION} homegear-nodes-core=${HG_VERISON} homegear-nodes-extra=${HG_VERISON} homegear-homematicbidcos=${HG_VERISON} homegear-homematicwired=${HG_VERISON} homegear-insteon=${HG_VERISON} homegear-max=${HG_VERISON} homegear-philipshue=${HG_VERISON} homegear-sonos=${HG_VERISON} homegear-kodi=${HG_VERISON} homegear-ipcam=${HG_VERISON} homegear-beckhoff=${HG_VERISON} homegear-knx=${HG_VERISON} homegear-enocean=${HG_VERISON} homegear-intertechno=${HG_VERISON} homegear-rsl=${HG_VERISON} homegear-rs2w=${HG_VERISON} homegear-mbus=${HG_VERISON} homegear-zwave=${HG_VERISON} homegear-ccu=${HG_VERISON} homegear-easyled=${HG_VERISON} homegear-easyled2=${HG_VERISON} homegear-easycam=${HG_VERISON} homegear-influxdb=${HG_VERISON} homegear-easy-licensing=${HG_VERISON} ; \
    rm -f /etc/homegear/dh1024.pem; \
    rm -f /etc/homegear/homegear.crt; \
    rm -f /etc/homegear/homegear.key; \
    cp -R /etc/homegear /etc/homegear.config; \
    cp -R /var/lib/homegear /var/lib/homegear.data; \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

VOLUME ["/etc/homegear", "/var/lib/homegear", "/var/log/homegear"]

COPY start.sh /start.sh
RUN chmod +x /start.sh
ENTRYPOINT ["/bin/bash", "-c", "/start.sh"]

EXPOSE 2001 2002 2003

I used the three environment variables to get the older version up and running. If you want I can push it as an merge request.

hfedcba commented 5 years ago

Hi, the image works again.

If you want I can push it as an merge request.

At the moment the version environment variable would not work with our automatic build process. I think the better way would be tags for older versions. The problem there is to get the version out of the image. But let me see, what can be done about that.

hfedcba commented 5 years ago

Ok, now we have version tags ;-).

benjamin-salchow commented 5 years ago

Hello,

thanks for adding the version tags to your docker images :-).

I've pulled the latest container image (about 25 minutes old):

docker pull homegear/homegear:stable
Trying to pull repository docker.io/homegear/homegear ... 
sha256:396ad3f843bdc9981c1744d2f920380bf23a87c848e42b6a5b59fac63b63d1c3: Pulling from docker.io/homegear/homegear

But still the daemon is not working when starting with the start.sh script. hang on: Determining maximum thread count...

full log:

cp: cannot stat '/var/lib/homegear.data/node-blue/nodes/*': No such file or directory
Starting Homegear: homegear/etc/init.d/homegear: line 94: ulimit: real-time priority: cannot modify limit: Operation not permitted
08/07/19 12:07:04.209 Loading RPC server settings from /etc/homegear/rpcservers.conf
08/07/19 12:07:04.209 Loading RPC client settings from /etc/homegear/rpcclients.conf
08/07/19 12:07:04.211 Info: Setting allowed core file size to "18446744073709551615" for user with id 0 and group with id 0.
08/07/19 12:07:04.211 Info: Core file size now is "18446744073709551615".
08/07/19 12:07:04.211 Info: Setting maximum thread priority to "0" for user with id 0 and group with id 0.
08/07/19 12:07:04.212 Info: Maximum thread priority now is "0".
08/07/19 12:07:04.212 Info: Setting allowed core file size to "18446744073709551615" for user with id 0 and group with id 0.
08/07/19 12:07:04.212 Info: Core file size now is "18446744073709551615".
08/07/19 12:07:04.212 Info: Setting maximum thread priority to "0" for user with id 0 and group with id 0.
08/07/19 12:07:04.212 Info: Maximum thread priority now is "0".
cat: /boot/cmdline.txt: No such file or directory
.
Starting homegear-management: homegear-management/etc/init.d/homegear-management: line 62: ulimit: real-time priority: cannot modify limit: Operation not permitted
.
homegear-webssh: unrecognized service
homegear-influxdb: unrecognized service
08/07/19 12:07:04.213 Git branch of libhomegear-base:     -
08/07/19 12:07:04.213 Git commit SHA of Homegear:         -
08/07/19 12:07:04.213 Git branch of Homegear:             -
08/07/19 12:07:04.213 Starting Homegear...
08/07/19 12:07:04.213 Homegear version 0.7.40-2942
08/07/19 12:07:04.213 Git commit SHA of libhomegear-base: -
08/07/19 12:07:04.213 Git branch of libhomegear-base:     -
08/07/19 12:07:04.213 Git commit SHA of Homegear:         -
08/07/19 12:07:04.213 Git branch of Homegear:             -
08/07/19 12:07:04.213 Determining maximum thread count...

Starting homegear within a bash inside of the container works

benjamin-salchow commented 5 years ago

The latest stable docker image does not have the newest homegear package:

#apt dist-upgrade

The following packages will be upgraded:
  debian-archive-keyring homegear homegear-ccu homegear-homematicbidcos homegear-management libhomegear-base

I'll try the 0.7.40 tag right now.

After updating the packages the container starts correct with the start.sh script.

benjamin-salchow commented 5 years ago

With the newest image on docker hub (about 25 minutes old) everything works with stable and the working homegear packages are available.

Thank you very much :-)

hfedcba commented 5 years ago

:+1:

Thank you, too!