Elasticsearch failed to start - CreateJavaVM Failed - elasticsearch

sorry if this is a trivial question, but I've been banging my head against this and I'm getting nowhere, so I thought I'd throw it up.
I'm trying to install Elasticsearch on an Windows 2008 server on Azure. It appears to have installed correctly, but I cannot get it to start.
I have looked around for similar errors and double-checked my JAVA_HOME variable - it appears to be correct, as does the config file.
I also expanded out the heap size via editing the java options files, still no luck.
Any help would be greatly appreciated
Output Log file
JAVA_HOME variable

Which version are you installing? The latest, which would be 5.5.0?
Which installation method did you use? The ZIP or the MSI file?
The last line in your Output Log file screenshot actually shows the error message: The data area passed to a system call is too small.
I'm taking a wild guess: You set Java_HOME in the user variables, but it must be set in the system variables.

Related

Elasticsearch Error: Could not evaluate jvm.options

So I've been trying to setup Elasticsearch using Windows for the past half a day, and after going through errors and errors, I reached an error that occurs when I try to run the program by typing in elasticsearch.exe in the command prompt, or clicking on the desktop/file explorer shortcut for Elasticsearch. I don't know how to fix this error, nor could I find a solution online. I've tried uninstalling and reinstalling but get the same problem. The error is as follows:
Can anyone provide some help on how to fix this? Been trying and searching for hours but nada. I have my Paths setup correctly as shown here:
Thank you.
I suggest the problem is that the "config" folder in your case placed at the different address.
In my case the same problem was solved by moving "Elastic" folder (with all its content) from the "C:\Program Files" folder directly to the disc "C:". In this case the "config\jvm.options" folder\file appeared directly in the "Elastic" folder. After that update the nesessary pathes: the "ES_HOME", the "ES_PATH_CONF" and created a "ES_JAVA_HOME" path as well since this is a specific path that ElasticSearch (ES) will use. In my case all pathes looked like that:
ES_HOME C:\elasticsearch-7.16.2
ES_PATH_CONF C:\elasticsearch-7.16.2\config
ES_JAVA_HOME C:\elasticsearch-7.16.2\jdk
Important: ES_PATH_HOME should be created and exist along with the JAVA_HOME path that in my case was the next:
JAVA_HOME C:\Program Files\Java\jdk-17.0.1

Install Anywhere unsuccesfull scenario

In InstallAnywhere project, how it detects that installation is unsuccessful. It does not seem to see the log file for it. Does it check if the exception has occured anywhere then it will fail?
There is a variable named, $INSTALL_SUCCESS$. If the installation is successful, then you can get some value from this variable.

Postgres "psql not recognized as an internal or external command"

For Postgres, I keep getting this error multiple times even though I have already set the location of the bin folder to the path variable in Windows 8. Is there something else I'm missing?
(I can't post pictures since I don't have enough reputation)
Just an update because I was trying it on Windows 10 you do need to set the path to the following:
;C:\Program Files\PostgreSQL\14\bin ;C:\Program Files\PostgreSQL\9.5\lib
PS : 14 is the current version, check whatever version you are on.
You can do that either through the CMD by using set PATH [the path]
or from my
computer => properties => advanced system settings=> Environment
Variables => System Variables
Then search for path.
Important: don't replace the PATHs that are already there just add one beside them as follows ;C:\Program Files\PostgreSQL\9.5\bin ;C:\Program Files\PostgreSQL\9.5\lib
Please note: On windows 10, if you follow this: computer => properties => advanced system settings=> Environment Variables => System Variables> select PATH, you actually get the option to add new row. Click Edit, add the /bin and /lib folder locations and save changes.
Then close your command prompt if it's open and then start it again
try psql --version
If it gives you an answer then you are good to go if not try echo %PATH% and see if the path you set was added or not and if it's added is it added correctly or not.
Important note:
Replace 9.5 with your current version number. As of 2021, that is 13.
For 2022 is 14.
Windows 10
It could be that your server doesn't start automatically on windows 10 and you need to start it yourself after setting your Postgresql path using the following command in cmd:
pg_ctl -D "C:\Program Files\PostgreSQL\11.4\data" start
You need to be inside "C:\Program Files\PostgreSQL\11.4\bin" directory to execute the above command.
EX:
You still need to be inside the bin directory to work with psql
Enter this path in your System environment variable.
C:\Program Files\PostgreSQL\[YOUR PG VERSION]\bin
In this case i'm using version 10. If you check the postgres folder you are going to see your current versions.
In my own case i used the following on separate lines:
C:\Program Files\PostgreSQL\10\bin
C:\Program Files\PostgreSQL\10\lib
You can follow the following steps below.
C:\Program Files\PostgreSQL\yourversion
I had your issue and got it working again (on windows 7).
My setup had actually worked at first. I installed postgres and then set up the system PATH variables with C:\Program Files\PostgreSQL\9.6\bin; C:\Program Files\PostgreSQL\9.6\lib. The psql keyword in the command line gave no errors.
I deleted the PATH variables above one at a time to test if they were both really needed. Psql continued to work after I deleted the lib path, but stopped working after I deleted the bin path. When I returned bin, it still didn't work, and the same with lib. I closed and reopened the command line between tries, and checked the path. The problem lingered even though the path was identical to how it had been when working. I re-pasted it.
I uninstalled and reinstalled postgres. The problem lingered. It finally worked after I deleted the spaces between the "; C:..." in the paths and re-saved.
Not sure if it was really the spaces that were the culprit. Maybe the environment variables just needed to be altered and refreshed after the install.
I'm also still not sure if both lib and bin paths are needed since there seems to be some kind of lingering memory for old path configurations. I don't want to test it again though.
If you tried all the answers and still spinning your heads, don't forget to change the version with your one which you downloaded.
For example, don't simply copy paste
;C:\Program Files\PostgreSQL\9.5\bin ;C:\Program Files\PostgreSQL\9.5\lib
More clearly,
;C:\Program Files\PostgreSQL\[Your Version]\bin ;C:\Program Files\PostgreSQL\[Your Version]\lib
I was spinning my heads. Hope this helps.
Make sure that the path actually leads to the executables. I'm using version 11 and it did not work until this was set as the path:
C:\Program Files\PostgreSQL\11\bin\bin
Maybe this is how version 11 is structured or I somehow botched the installation but I haven't had a problem since.
Even if it is a little bit late, i solved the PATH problem by removing every space.
;C:\Program Files\PostgreSQL\<installed version>\bin;C:\Program Files\PostgreSQL\<installed version>\lib
works for me now.
Simple solution that hasn't been mentioned on this question: restart your computer after you declare the path variable.
I always have to restart - the path never updates until I do. And when I do restart, the path always is updated.
Find your binaries file where it is saved. get the path in terminal mine is
C:\Users\LENOVO\Documents\postgresql-9.5.21-1-windows-x64-binaries (1)\pgsql\bin
then find your local user data path, it is in mostly
C:\usr\local\pgsql\data
now all we have to hit the following command in the binary terminal path:
C:\Users\LENOVO\Documents\postgresql-9.5.21-1-windows-x64-binaries (1)\pgsql\bin>pg_ctl -D "C:\usr\local\pgsql\data" start
done!
Always better to install a previous version or in the installation make sure you specify the '/data' in a separate directory folder "C:\data"
For Windows 10 and 11 users, here are the steps:
Go to Edit environment variables for your account (search for it on the start menu)
It will open the System Properties form — click the Environment Variables
Under the User variables for <username> (or you can add it in system variables), find the path variables and click edit, and add the path to your Postgres bin file address (in my case it's C:\Program Files\PostgreSQL\15\bin).
And save it and re-open the terminal.

Hermes Cofiguration with SoapUI 5.0.0

I am trying to set hermesJMS config file under prefernces --> tools and have given the whole path of hermes-config.xml file like this c:\..\..\hermes-config.xml and saved the preferences. But when I am trying to open HermesJMS under tools from soapUI 5.0.0 it complains about setting the prefernces, which I've already set. I also tried restarting soapUI but doesnt work. Any help is appreciated. HermesJMS was installed when I installed soapui 5.0.0. I didnt install it separately. Thanks.
Got it working, we've to give path upto hermesJMS folder and not to hermes-config.xml file for soapUI 5.0.0 (hermes installed with soapUI). Thanks
I got a similar issue on latest version 5.0 - Error: Could not create the Java Virtual Machine.
Just that it may be helpful for others I am sharing the work around. Most likely, it was a memory issue.
By default, the location is C:\Program Files (x86)\SmartBear\SoapUI-5.0.0\hermesJMS what you mentioned above. So, no need to change it.
One can go hermes.bat file at location C:\Program Files (x86)\SmartBear\SoapUI-5.0.0\hermesJMS\bin and edit last line -XX:NewSize=256m -Xmx512m to -XX:NewSize=256m -Xmx1024m.

WKHTMLTOPDF and "Error: Unable to create temporery file"

I've written a piece of code in PHP to generate PDF using WKHTMLTOPDF binary file. It was working fine till I had to recompile my Apache. Now it fails with error Error: Unable to create temporery file (this is the exact wording).
The situation in which the error is reproducible is a little complicated. I managed to narrow down the error and now I'm pretty sure that the error happens because of the user that Apache runs as. It seems to me that when WKTHMLTOPDF is running as a user with no home folder, it's unable to access a temporary folder within the user's home folder.
Surely I can change the Apache's user but I would rather resolve this problem once and for all. To this end it would be great if I could somehow set the temp folder for WKHTMLTOPDF or at least print its current value to make it valid! Does anyone know how to do any of these two?
BTW, I'm using WKHTMLTOPDF 0.11.0 rc1.
I saw the same error today in Rails4 + pdfkit gem(0.8.2) + wkhtmltopdf(0.12.2.1) under CentOS 6.7.
This error came from wkhtmltopdf and the reason was it couldn't create temporary file. wkhtmltopdf depends on some temporary filename creation API (I'm not sure), but probably following shows some hints:
$ man tempfile
$ man tempnam
In my case, my TMPDIR environment variable showed wrong path (I had accidentaly deleted the directory!) so that wkhtmltopdf couldn't create work file.
When I unset TMPDIR, then it worked! Of course, setting correct existence directory to TMPDIR should be OK too.

Resources