Philipp Trulson created SOLR-17638: -------------------------------------- Summary: 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
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} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org