You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2025/03/04 14:32:00 UTC

[jira] [Updated] (SOLR-17638) Some CLI errors not logged when starting prometheus exporter

     [ https://issues.apache.org/jira/browse/SOLR-17638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated SOLR-17638:
----------------------------------
    Labels: pull-request-available  (was: )

> Some CLI errors not logged when starting prometheus exporter
> ------------------------------------------------------------
>
>                 Key: SOLR-17638
>                 URL: https://issues.apache.org/jira/browse/SOLR-17638
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - prometheus-exporter
>    Affects Versions: 9.8
>            Reporter: Philipp Trulson
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hey everyone, we are currently upgrading our 8.11 setup to 9.8 and right now I'm working on the prometheus-exporter.
> To my surprise, the program was exiting directly without any output at all, which was very frustrating. Only after manually putting a log4j2 config in the classpath the culprit was finally visible:
>  
> {noformat}
> org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: --zkhost{noformat}
>  
> So the program was exiting because the cli option was renamed from zkhost to zk-host, would have been an easy fix normally, _if_ the program would have told me. What's funny though is that other messages are being logged to the console and I can't find the difference atm. My guess is that something got messed up after switching the cli lib in SOLR-16996.
> Reproduction:
> {code:java}
> $ podman run --rm -it --entrypoint bash solr:9.8.0 /opt/solr/prometheus-exporter/bin/solr-exporter --port=9854
> ERROR - 2025-01-30 08:52:53.052; org.apache.solr.prometheus.exporter.SolrExporter; Must provide either --base-url or --zk-host
> Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.apache.solr.prometheus.exporter.SolrScrapeConfiguration.getType()" because "configuration" is null
>     at org.apache.solr.prometheus.exporter.SolrExporter.createScraper(SolrExporter.java:127)
>     at org.apache.solr.prometheus.exporter.SolrExporter.<init>(SolrExporter.java:90)
>     at org.apache.solr.prometheus.exporter.SolrExporter.main(SolrExporter.java:426)
> $ podman run --rm -it --entrypoint bash solr:9.8.0 /opt/solr/prometheus-exporter/bin/solr-exporter --zkhost=lalala
>   -> no output{code}
>  
> (Small sidenote: The program errors when not providing --base-url or --zk-host, even though the help text says {_}If omitted both the -b parameter and the -z parameter, connect to http://localhost:8983/solr{_}. Not sure if it's worth opening a separate issue for that, looks like the CLI args are being worked on already in 9.9)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org