Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

performance-analyzer not working after upgrade to opendistro-performance-analyzer-1.13.0.0-1.noarch #281

Open
TheMeier opened this issue Mar 1, 2021 · 1 comment

Comments

@TheMeier
Copy link

TheMeier commented Mar 1, 2021

The script referenced in the systemd unit does not exist

$ ls /usr/share/elasticsearch/bin/performance-analyzer-agent-cli
ls: cannot access '/usr/share/elasticsearch/bin/performance-analyzer-agent-cli': No such file or directory
$ rpmverify opendistro-performance-analyzer-1.13.0.0-1.noarch
missing     /usr/share/elasticsearch/bin/performance-analyzer-agent-cli

There is a PR related to this https://github.com/opendistro-for-elasticsearch/performance-analyzer/pull/254/files but that seems to be outdated. (refereces $ES_HOME/plugins/opendistro_performance_analyzer instead of $ES_HOME"/plugins/opendistro-performance-analyzer)

The scripts which is in the RPM
/usr/share/elasticsearch/plugins/opendistro-performance-analyzer/bin/performance-analyzer-agent-cli exits with
Error: Could not find or load main class com.amazon.opendistro.elasticsearch.performanceanalyzer.PerformanceAnalyzerApp

@sbruno
Copy link

sbruno commented Apr 20, 2021

I found the same problem today.

It is not only /usr/share/elasticsearch/bin/performance-analyzer-agent-cli which is gone after an RPM upgrade, also the whole /usr/share/elasticsearch/performance-analyzer-rca directory and the /usr/share/elasticsearch/data/rca_enabled.conf configuration file.

Only the CLI file is identified by the verify command because that path is present in the %files list of the RPM. The other files are created in the post script of the RPM:
Those files are removed by the postrm script:

So what I think that happens is that the post script of the new RPM is executed first, creating (overwriting) those files, and then the postrm script of the old package removes them.

This RPM behavior seems to cause other problems. I also filed a bug in elasticsearch because that behavior causes that the service fails to restart on upgrades: elastic/elasticsearch#71784

But is the expected RPM upgrade behavior: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering

The steps I used to reproduce this are:

# Install elastcisearch older version
curl https://d3g5vo6xdbdb9a.cloudfront.net/yum/opendistroforelasticsearch-artifacts.repo -o /etc/yum.repos.d/opendistroforelasticsearch-artifacts.repo
yum install -y curl unzip wget libcap java-11-openjdk-devel
yum install -y opendistroforelasticsearch-1.12.0-1
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service

# Check that performance analyzer is running
systemctl status opendistro-performance-analyzer
ps aux | grep elasticsearch | grep java

# Check that files exist
ls /usr/share/elasticsearch/bin/performance-analyzer-agent-cli
ls /usr/share/elasticsearch/performance-analyzer-rca
ls /usr/share/elasticsearch/data/rca_enabled.conf

rpm -V opendistro-performance-analyzer

# Install newer version
yum install -y opendistroforelasticsearch-1.13.2-1
systemctl daemon-reload
systemctl restart elasticsearch.service

# Check that performance analyzer did not run
systemctl status opendistro-performance-analyzer
ps aux | grep elasticsearch | grep java

# Check that files do not exist
ls /usr/share/elasticsearch/bin/performance-analyzer-agent-cli
ls /usr/share/elasticsearch/performance-analyzer-rca
ls /usr/share/elasticsearch/data/rca_enabled.conf

rpm -V opendistro-performance-analyzer

And as workaround, to set up the performance analyzer again, some steps that the RPM does can be done manually:

echo  true > /usr/share/elasticsearch/data/rca_enabled.conf
cp -r /usr/share/elasticsearch/plugins/opendistro-performance-analyzer/performance-analyzer-rca /usr/share/elasticsearch/
cp /usr/share/elasticsearch/plugins/opendistro-performance-analyzer/bin/performance-analyzer-agent-cli /usr/share/elasticsearch/bin/
chmod +x /usr/share/elasticsearch/bin/performance-analyzer-agent-cli
systemctl restart elasticsearch.service

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

No branches or pull requests

2 participants