Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Could not import InfluxDB modules - (you may need to install the JSON::MaybeXS module) #179

Closed
1 task done
pizzydizzy opened this issue Jul 27, 2024 · 7 comments · Fixed by #180
Closed
1 task done

Comments

@pizzydizzy
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

After configuring the influxdb section, when the container starts it logs:

ERROR: Could not import InfluxDB modules, but InfluxDB host was configured: Can't locate JSON/MaybeXS.pm in @inc (you may need to install the JSON::MaybeXS module) (@inc entries checked: .. /usr/share/smokeping /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 13.
BEGIN failed--compilation aborted at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 13.
Compilation failed in require at /usr/share/smokeping/Smokeping.pm line 4169.

Expected Behavior

No response

Steps To Reproduce

  1. Create the container and configure the influxdb section configured in "Database" config file (at the end):

*** InfluxDB ***

host = <influxdb_host>
database = <database_name>
timeout = 10
port = <influx_port>
username = <influxdb_username>
password = <influxdb_password>

  1. Start the container and see logs on open the webgui:

ERROR: Could not import InfluxDB modules, but InfluxDB host was configured: Can't locate JSON/MaybeXS.pm in @inc (you may need to install the JSON::MaybeXS module) (@inc entries checked: .. /usr/share/smokeping /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 13.
BEGIN failed--compilation aborted at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 13.
Compilation failed in require at /usr/share/smokeping/Smokeping.pm line 4169.

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

docker run -d \
  --name=smokeping \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e CACHE_DIR=/tmp `#optional` \
  -p 80:80 \
  -v /local-smokeping-config-path/config:/config \
  -v /local-smokeping-data-path/data:/data \
  --restart unless-stopped \
  lscr.io/linuxserver/smokeping:latest

Container logs

DBG: Setting up a new InfluxDB connection
ERROR: Could not import InfluxDB modules, but InfluxDB host was configured: Can't locate JSON/MaybeXS.pm in @INC (you may need to install the JSON::MaybeXS module) (@INC entries checked: .. /usr/share/smokeping /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 13.
BEGIN failed--compilation aborted at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 13.
Compilation failed in require at /usr/share/smokeping/Smokeping.pm line 4169.
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thespad
Copy link
Member

thespad commented Jul 27, 2024

Can you do docker exec -it smokeping apk add perl-json-maybexs and see if that is sufficient to resolve the dep issue? If so we can get it added to the image.

@pizzydizzy
Copy link
Author

Can you do docker exec -it smokeping apk add perl-json-maybexs and see if that is sufficient to resolve the dep issue? If so we can get it added to the image.

Done, but now it needs:

DBG: Setting up a new InfluxDB connection
ERROR: Could not import InfluxDB modules, but InfluxDB host was configured: Can't locate Object/Result.pm in @inc (you may need to install the Object::Result module) (@inc entries checked: .. /usr/share/smokeping /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 15.
BEGIN failed--compilation aborted at /usr/local/share/perl5/site_perl/InfluxDB/HTTP.pm line 15.
Compilation failed in require at /usr/share/smokeping/Smokeping.pm line 4169.

@thespad
Copy link
Member

thespad commented Jul 27, 2024

OK, this is going to be fun walking the dependencies.

Exec into a shell in the container and do:

apk add build-base perl-app-cpanminus perl-dev
cpanm Object::Result

And then try again; we'll have to keep going until we find all the deps. With any luck it'll just be that one.

@thespad
Copy link
Member

thespad commented Jul 27, 2024

Looks like Object::Result depends on Method::Signatures which is from 2017 and therefore fails its tests due to deprecated deps. Going to be horribly messy but might be able to do:

apk add build-base perl-app-cpanminus perl-dev
cpanm Method::Signatures --force
cpanm Object::Result

@pizzydizzy
Copy link
Author

Looks like Object::Result depends on Method::Signatures which is from 2017 and therefore fails its tests due to deprecated deps. Going to be horribly messy but might be able to do:

apk add build-base perl-app-cpanminus perl-dev
cpanm Method::Signatures --force
cpanm Object::Result

I was just dealing with it.
It also needs:

cpanm InfluxDB::LineProtocol

Now it starts without errors and any dependencies issues.

@thespad
Copy link
Member

thespad commented Jul 27, 2024

OK, let me put a PR together to add all the bits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants