-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
RPM update to 7.5.1 prevents start of elasticsearch #50631
Comments
Pinging @elastic/es-core-infra (:Core/Infra/Packaging) |
I'll look into this and raise the issue with the dev team if necessary. |
I'm having a tough time reproducing this in a clean environment. In particular, I can't see how the file The relevant script is
If the file exists and md5sum can read it, md5sum will be able to calculate a checksum. We'd get a size of Are you running your RPM commands as root, or do you have a different permissions scheme in place? Are you using the keystore for secure settings for your cluster? |
I am equally confused by the zero size of the md5sum file. The update was done with a standard root initiated "yum update". % ls -l /var/log/yum.log % sudo fgrep elasticsearch /var/log/yum.log only root can write to the yum log, and the update was recorded by the yum update process. I also agree that the relevant script is posttrans The only way that the md5sum could be zero is if the keystore file did not exist and the command md5sum /etc/elasticsearch/elasticsearch.keystore > /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum was run. |
I've tried a number of different combinations of keystore modifications and Elasticsearch upgrades, and I'm unable to reproduce this behavior on an RHEL 7 Vagrant image. Are you able to find a series of steps to reproduce the problem? |
Jan 16 11:45:53 test206 systemd[1]: Starting Elasticsearch...
|
I got the same issue that installed es 7.5.1 by "yum install elasticsearch" when starting the service |
@Daych Was this a fresh installation, or was it an upgrade from a previous version of Elasticsearch? Assuming Elasticsearch has been installed to |
@williamrandolph Hi William, I had installed the elasticsearch 6.8.5 before, then I just remove all the file related to the elasticsearch before I install the 7.5.1 version |
This issue is continuing to come up in various environments, and I still haven't traced down why. The intention is for the RPM scripts to handle all of the keystore setup so that the Elasticsearch application will not try to do any writing in the configuration directory. Our work in this direction fell under #28928 and #41755. |
A summary of where we are right now: The intended workaround for this problem is running When you're running Elasticsearch as a Thus, it's easy to create a situation where you get a When we upgrade the RPM, we intend to have the In the case above where the
If anyone runs into this problem and is able to view output from the Since one way the I would like to fix this problem for our users, but I need enough information to reproduce it first. |
reinstalling the same 7.5.1 RPM I get the following issue that prevents the posttrans from running correctly. Running transaction |
@erempel Ah, that's very interesting. The |
No, it does not. I thought that we had included all of the un-commented settings from the original elasticsearch.conf file and set any settings in our ansible deploy tasks. I guess I will be adding this one back in. |
@erempel I'm able to reproduce the error now. I hope that adding I'm going to see if I can put out a fix so that if an error like this happens in the scriptlet, the RPM upgrade will fail with a reasonable message, and to make sure that Thank you for reporting this issue and helping me figure out how to reproduce it. |
FWIW I ran into similar problems because a elasticsearch 5.6 version of /etc/sysconfig/elasticsearch (which does not have ES_PATH_CONF) was placed into an elasticsearch 6.8 install. Upgrading to 7.5.2 reported a lot of errors and I had to manually fix the keystore. |
Platform: Redhat EL 7.7 (systemd)
Previous ES package: elasticsearch-7.4.2-1.x86_64
Upgraded ES package: elasticsearch-7.5.1-1.x86_64
ES forum post at
https://discuss.elastic.co/t/elasticsearch-7-5-1-rpm-update-prevents-restart-of-service/213636
made me look into things more.
After the upgrade and host reboot, the ES service would not start and gave the error
Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: org.elasticsearch.cli.UserException: unable to create temporary keystore at [/etc/elasticsearch/elasticsearch.keystore.tmp], write permissions required for [/etc/elasticsearch] or run [elasticsearch-keystore upgrade]
I can confirm that there is a "posttrans scriptlet" in the RPM used used during the upgrade and that the scriptlet containes the commands to perform the keystore upgrade, and that this scriptet was run at the time of the update (we upgrade automatically starting at 04:00)
% ls -al /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
-rw-r--r-- 1 root elasticsearch 0 Jan 1 04:34 .elasticsearch.keystore.initial_md5sum
Adding group write permissions to the /etc/elasticsearch directory permitted the service to start, which create or rewrote the keystore file.
% ls -al /etc/elasticsearch/elasticsearch.keystore
-rw-rw---- 1 elasticsearch elasticsearch 199 Jan 2 14:57 elasticsearch.keystore
Two things I note
The posttrans scriptlet sets the owner:group of the keystore file to root:elasticsearch however, after the service started the file is owned by elasticsearch:elasticsearch
The md5sum output file is of size 0, which indicates to me that the posttrans scriptlet failed to create the initial keystore file, or perhaps ran the "else" clause of the posttrans scriptlet which only created the md5sum file.
The text was updated successfully, but these errors were encountered: