Closed elronzo closed 5 months ago
@elrozone
Which Image variant/version ist affected?
ghcr.io/fhem/fhem/fhem-docker:bullseye
Probably related: https://github.com/fhem/fhem-docker/issues/40
Does this also occure with the v4 Beta 8 Image?
I tried v4-beta8, but it does not properly boot here. I'm coming from v3.3.
Error message in the log:
Can't locate Device/SerialPort.pm in @INC (you may need to install the Device::SerialPort module) (@INC contains: ./lib ./FHEM . /usr/local/lib/perl5/site_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/site_perl/5.36.3 /usr/local/lib/perl5/vendor_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/vendor_perl/5.36.3 /usr/local/lib/perl5/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/5.36.3 ./FHEM/lib) at FHEM/DevIo.pm line 612, <$fh> line 405.
This breaks all USB devices.
Error message in the log:
E: Unable to locate package libauthen-sasl-cyrus-perl
This is coming from my pre-init.sh
where I run apt-get remove libauthen-sasl-cyrus-perl
. So I guess the package is not installed which could mean that the Jabber issue does not apply to v4-beta8. I can't confirm that for sure because I had to revert to v3 because of the USB problem.
What happened to the minimal image? It's twice as big as before:
$ docker images | grep fhem
ghcr.io/fhem/fhem-minimal-docker 4.0.0-beta8-bullseye 8947fca5f21e 5 days ago 1.34GB
ghcr.io/fhem/fhem-minimal-docker 3.3.1-bullseye c9b1f0c873e7 4 months ago 635MB
The usb problem seems to be specific to arm Images.
Can you please test the recent development image. The image should support serial devices also on arm plattform.
docker pull ghcr.io/fhem/fhem-docker:dev-bullseye
The behavior is unchanged for ghcr.io/fhem/fhem-minimal-docker:dev-bullseye
.
$ docker images | grep fhem
ghcr.io/fhem/fhem-minimal-docker dev-bullseye cf28244b08a3 12 hours ago 905MB
ghcr.io/fhem/fhem-minimal-docker 4.0.0-beta8-bullseye 8947fca5f21e 7 days ago 1.34GB
ghcr.io/fhem/fhem-minimal-docker 3.3.1-bullseye c9b1f0c873e7 4 months ago 635MB
$ docker inspect ghcr.io/fhem/fhem-minimal-docker:dev-bullseye | grep 2024
"Created": "2024-04-11T15:04:23.351924779Z",
"org.opencontainers.image.created": "2024-04-11T15:04:19.486Z",
I tried to install the packages manually in pre-init.sh
:
apt-get update && apt-get install -y libdevice-serialport-perl libxml-bare-perl
According to the log, they are installed, but still missing for FHEM.
Looks like perl libraries installed by apt
are not available.
From a shell within ghcr.io/fhem/fhem-minimal-docker:dev-bullseye
(using XML::Bare
as an example, may be replaced by any other lib):
$ perl -e 'use XML::Bare;'
Can't locate XML/Bare.pm in @INC (you may need to install the XML::Bare module) (@INC contains: /usr/local/lib/perl5/site_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/site_perl/5.36.3 /usr/local/lib/perl5/vendor_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/vendor_perl/5.36.3 /usr/local/lib/perl5/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/5.36.3) at -e line 1.
$ apt update && apt install -qqy libxml-bare-perl
[...]
Preparing to unpack .../libxml-bare-perl_0.53-1+b8_armhf.deb ...
Unpacking libxml-bare-perl (0.53-1+b8) ...
Setting up libxml-bare-perl (0.53-1+b8) ...
$ perl -e 'use XML::Bare;'
Can't locate XML/Bare.pm in @INC (you may need to install the XML::Bare module) (@INC contains: /usr/local/lib/perl5/site_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/site_perl/5.36.3 /usr/local/lib/perl5/vendor_perl/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/vendor_perl/5.36.3 /usr/local/lib/perl5/5.36.3/arm-linux-gnueabihf-64int /usr/local/lib/perl5/5.36.3) at -e line 1.
$ dpkg -S Bare.pm
libxml-bare-perl: /usr/lib/arm-linux-gnueabihf/perl5/5.32/XML/Bare.pm
$ PERL5LIB=/usr/lib/arm-linux-gnueabihf/perl5/5.32 perl -e 'use XML::Bare;'
Can't load '/usr/lib/arm-linux-gnueabihf/perl5/5.32/auto/XML/Bare/Bare.so' for module XML::Bare: /usr/lib/arm-linux-gnueabihf/perl5/5.32/auto/XML/Bare/Bare.so: undefined symbol: PL_thr_key at /usr/local/lib/perl5/5.36.3/arm-linux-gnueabihf-64int/DynaLoader.pm line 206.
at -e line 1.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
$ cpanm XML::Bare
[...]
$ perl -e 'use XML::Bare;'
$ echo $?
0
In v3.3 image, the library path is (different from v4 above):
@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/arm-linux-gnueabihf/perl5/5.32 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl-base /usr/lib/arm-linux-gnueabihf/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl
Can you please try the full Image?
I think, the Net::XML package isn't required by any of the modules available in the svn repo.
I checked, that it ist available in the full Image.
Installing perl packages via apt / pre-init.sh isn't the way to go in v4.
Thanks for caring about this issue. I'm ready to give feedback in case you don't have arm hardware available.
I tried the full image. Device::SerialPort
is still missing.
I used the module XML::Base
above just as an example to show that the installation of a perl library via apt has no effect. The module has no relevance for this issue.
Installing perl packages via apt / pre-init.sh isn't the way to go in v4.
Dockerfile
. Is that OK for v4?I read your suggestion to add an inline Dockerfile
for customizations. I understand that an additional layer is better from the performance perspective because the installation occurs once at build time and not on every container start. But this means I'm no longer just a user but maintainer of a layer. The layer is able to outdate, so I have to think about building the image (my layer) from time to time. I prefer using the pre-init.sh
. Since it is running automatically on container start, I don't have to think about anything. I don't care about longer boot time of the container. Another point is that using an inline Dockerfile ties the image to docker compose. May not be a problem, but I don't like the idea.
Thanks for having a look at the image size. It is now down from 1.3 GB to 900 MB. Previously, the minimal image was ~600 MB. I don't use the features of the full image. Is there any chance to further reduce the image size? I'd appreciate that.
Device::SerialPort
is still missing.
I'm curious why this is the case. It looks like parse-METAJson.pl
is collecting all required perl dependencies by parsing the FHEM source files. Some of them contain a META.json
section that declares dependencies:
But none of the modules that require Device::SerialPort
has such a META.json
section:
Looks like the META.json
approach does not cover all modules. I don't understand why didn't show up earlier because Device::Serial
is required for USB devices, one of FHEM's core features ever since.
I guess the best case would be to ask module maintainers to add a META.json
section. Are there any options beyond to improve the situation?
I think the missing Device::Serial is a caching issue, the cpanfile hasn't changed, because it was always there, but removed just before the build is executed. As soon as i found the correct cache layer i can delete it and it should be included.
Something is failing during the build for device-serialport.
I created separate issues for Device::SerialPort
and the image size because they do not relate to Jabber integration.
The v4 images do not contain Authen::SASL::Cyrus
. I can confirm that Jabber is working in 4.0.0-beta8-bullseye
and latest dev
images (both minimal and extended).
Describe the bug libauthen-sasl-cyrus-perl prevents the jabber module from connecting properly to a jabber server. (Bullseye Image)
To Reproduce Steps to reproduce the behavior: Try to connect to a jabber server within a FHEM-Bullseye container. (If libauthen-sasl-cyrus-perl is removed a connection can be established.)
Expected behavior A connection to a jabber server should be established properly.