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
Debian package needs java dependency #31845
Comments
@stumyp In the interests of avoiding duplicate issues & discussion, I'm going to close this issue. |
@tvernum Those discussions were 4 and 2 years ago, and some things have changed in that time. For example, starting with jdk10 the oracle packages are now gpl, so it might be easier to depend on them now soon (since we recommend the oracle jdk). I think it is at least worth having another discussion, even if it results in the same outcome as the one from 4 years ago (note the one from 2 years was simply closed, referring to the 4 year old issue). |
Pinging @elastic/es-core-infra |
I'm sorry, even if this is intentional I do not agree with this intention, one of the major reasons there are package managers is managing dependencies and resolving them if needed. It was tolerable when install scripts did not depend on existence of java binary, now they are and this is breaking change. All people usually want is to run
on stock Debian or Ubuntu freshly installed system and have it all. Not think of dependencies ahead of time and working around them. There is instruction on Debian web site how to install desired Java version: https://wiki.debian.org/JavaPackage I just followed it and made .deb package from Oracle JRE. This is what it has as
Basically, similar to what I suggested as Advanced users can always switch to desired version of JRE, in Debian-way. By using packages and |
I totally agree with @stumyp . It took me half of my work day trying to figure this out. If you really really really want to avoid dependencies on java packages, you can always just check for availability of java libs and/or binaries in the pre-installation script and clearly suggest that they must be installed before deb installation can continue. |
Yes i totally agree with ohaleck and stumyp - the .deb package should at least provide a proper error - like 'install the jre' - or at least include it in the documentation of installing elasticsearch. Would have had NO idea if this post didn't exist. |
Just registering agreement here with @stumyp and others who say this is confusing. Thanks for opening this thread! |
Thank you all for the feedback, and I am sorry for the difficulties that you are experiencing here. We have thought about this quite hard in the last few weeks and have come to the conclusion to change our stance here on not declaring a Java dependency. It will take for us some time to investigate a solution that works for all the distributions that we support, and we are unlikely to make a change like this in a minor release but we intend to have this solved before our next major release. The solution that we are looking for will have two aims:
We will also aim to clarify the documentation and to make the error that occurs when you Again, thank you so much 🙏 for the feedback and thank you for your patience. We will use this issue to track progress. |
Thank you, @jasontedor
|
This is unknown to me. There is no Debian package for the Oracle JDK. So these users would be using the tar.gz but maybe re-packaging it with |
Hi guys, Got the same issue. ES package need java. So after installing this one http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html everything's working perfectly. But hell yeah the apt error is not explicit at all. I spent hours on it before seeing the light |
If elasticsearch needs java, please have it as a dependency in the deb. I just spent ages trying to work out why elastic search won't even install.
fixed with this:
|
@Br3nda Please see my previous comment. We will change this. |
Relates #33607 |
Especialistas, um erro que acontece em todo mundo, em todas as linguagens com relação a suporte de Tecnologia, principalmente em LINUX, são as informações incompletas sobre os COMANDOS. Abs !!! "Experts, an error that happens worldwide, in all languages with regard to Technology support, especially in LINUX, are the incomplete information on the COMMANDS. |
Currently is `java` is not in $PATH the preinst script fails prematurely and prevents an appropriate message from getting displayed for the user. Make package installation more user friendly when java is not in $PATH. Relates: elastic#31845
Currently is `java` is not in $PATH the preinst script fails prematurely and prevents an appropriate message from getting displayed for the user. Make package installation more user friendly when java is not in $PATH. Also use a she-bang in the preinst script, as, at least in Debian, maintainer scripts must start with the #! convention [1]. Relates: elastic#31845 [1] https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
) Currently is `java` is not in $PATH the preinst script fails prematurely and prevents an appropriate message from getting displayed to the user. Make package installation more user friendly when java is not in $PATH and add a test for it. Also use a she-bang in the preinst script, as, at least in Debian, maintainer scripts must start with the #! convention [1]. Relates #31845 [1] https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
) Currently is `java` is not in $PATH the preinst script fails prematurely and prevents an appropriate message from getting displayed to the user. Make package installation more user friendly when java is not in $PATH and add a test for it. Also use a she-bang in the preinst script, as, at least in Debian, maintainer scripts must start with the #! convention [1]. Relates #31845 [1] https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
) Currently is `java` is not in $PATH the preinst script fails prematurely and prevents an appropriate message from getting displayed to the user. Make package installation more user friendly when java is not in $PATH and add a test for it. Also use a she-bang in the preinst script, as, at least in Debian, maintainer scripts must start with the #! convention [1]. Relates #31845 [1] https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
For RPM packages, at least, if you have a "Requires" on a generic capability, and there's a java already installed that matches that capability, then it won't install any other java. If not, it will install the java that's available to it (not sure what happens when there's choices about OpenJDK and Oracle available) The requirement could be "java", "java-1.8.0", "jre" or "jre-1.8.0", which both openjdk and oraclejava announces as "provides". (I don't know what determines the use of "java" vs "jre".) So, this will ensure java is installed, or fetch and install it, and doesn't preclude the administrator's choice of which flavor. It does, however, let rpm-install get the install ordering right, which it can't otherwise. P.s.: It really would be nice if this was fixed in a patch release... or even just a repackaging of the RPM, which is what "Release" is for :) |
Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes elastic#31845
Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes elastic#31845
Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes elastic#31845
* Bundle java in distributions Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes #31845
* Bundle java in distributions Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes elastic#31845
* Bundle java in distributions Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes elastic#31845
So, instead of fixing it on system level. by building proper packages, you decided to just bundle java version you define into the package? Is it wise to make large enough package even larger, plus not leaving a choice to the customer what version to use? I think this change is making things worse, not better. I'm not even complaining on how you create you packages (fpm is a nightmare). This just indicates to me that Elasticsearch is not meant to be integrated into the system. On more general topic, it is harder to me to defend my choice of Elasticsearch, more and more problems appear and such decisions do not make it easier. I really would switch to something else, if there is an alternative... |
You still have a choice, you can override |
* Bundle java in distributions Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes #31845
* Bundle java in distributions Setting up a jdk is currently a required external step when installing elasticsearch. This is particularly problematic for the rpm/deb packages as installing a jdk in the same package installation command does not guarantee any order, so must be done in separate steps. Additionally, JAVA_HOME must be set and often causes problems in selecting a correct jdk when, for example, the system java is an older unsupported version. This commit bundles platform specific openjdks into each distribution. In addition to eliminating the issues above, it also presents future possible improvements like using jlink to build jdk images only containing modules that elasticsearch uses. closes #31845
Elasticsearch version:
6.3.1
Plugins installed: []
JVM version: any
OS version Debian or Ubuntu
Description of the problem including expected versus actual behavior:
elasticsearch debian package must list dependency on java runtime.
Both Debian and Ubuntu have the same names for default java runtimes.
current Depends field looks like this:
while it should look like something like this:
If people want to use different version of java, they can always use
update-alternatives
command to update default version.Steps to reproduce:
let's say you have apt sources configured.
simple install never worked, but now it also fails before it even tries to unpack:
OK, since that never worked, I install desired openjdk version together with elasticsearch, and it used to work before:
so it still ends with error, also leaving all java packages unconfigured.
It works only if I install java runtime separately, before elasticsearch
This happens because elasticsearch package doesn't have direct dependency on jre. If there is one, package manager would configure jre before trying to unpack elasticsearch.
The text was updated successfully, but these errors were encountered: