Can not run Elastic Search on ubuntu (Error opening log file) - java

I have problems with running Elastic Search on my ubuntu 20.04 server (I can do it locally). When I run ./bin/elasticsearch in terminal I get lines below
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
[0.000s][error][logging] Error opening log file 'logs/gc.log': Permission denied
[0.001s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed.
error:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Could not rename log file 'logs/gc.log' to 'logs/gc.log.05' (Permission denied).
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
at org.elasticsearch.tools.launchers.JvmOption.flagsFinal(JvmOption.java:119)
at org.elasticsearch.tools.launchers.JvmOption.findFinalOptions(JvmOption.java:81)
at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:38)
at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:135)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:86)
What I tried: sudo chmod -R +w /home/ubuntu/data/stepa/elasticsearch-7.16.2/logs/. It didn't help.
I didn't succeed to find answer on elastic search forum.
Thank you for any help.

Finally, I found the solution. Log lines mean problems with rights. Current user has to be an owner of directory. In my case owner of /home/ubuntu/data/stepa/elasticsearch-7.16.2/logs/ was root. I changed it using this command sudo chown username:group /home/ubuntu/data/stepa/elasticsearch-7.16.2/logs
("ubuntu: " in my case because group is default and username is ubuntu)
Thanks to ilvar for clues.

Related

Elasticsearch couldn't start in windows

warning: ignoring JAVA_HOME=C:\Program Files\Java\jdk-11.0.15; using bundled JDK
Installing service : "elasticsearch-service-x64"
Using ES_JAVA_HOME (64-bit): "C:\Program Files\elasticsearch-8.2.0\jdk"
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
[0.150s][error][logging] Error opening log file 'logs/gc.log': Permission denied
[0.150s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed.
error:
Could not rename log file 'logs/gc.log' to 'logs/gc.log.10' (Permission denied).
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
at org.elasticsearch.tools.launchers.JvmOption.flagsFinal(JvmOption.java:114)
at org.elasticsearch.tools.launchers.JvmOption.findFinalOptions(JvmOption.java:79)
at org.elasticsearch.tools.launchers.MachineDependentHeap.determineHeapSettings(MachineDependentHeap.java:61)
at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:135)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:87)
Did you try changing jvm.options and set Xms and Xms memory arguments?
Both should be the same value, and value should be below the total available system memory.
Also try changing log level in log4j.properties file to get some detailed error log, if that helps.

Error: Installation did not succeed. The application could not be installed in Android Studio

I am new to android studio. And the app on which I am working was not giving the installation error with the last code change. Once I add another line of code, I start getting error:
Timed out waiting for the process (com.iab.omid.sampleapp) to appear on
Pixel_3a_API_32_arm64-v8a [emulator-5554].
Installation did not succeed.
The application could not be installed.
List of apks:
[0] '/Users/mukul/Documents/jivox/jivox-android/omsdk-android-1.3.31-Jivox/OM-DemoApp/build/intermediates/apk/defaults/debug/OM-DemoApp-defaults-debug.apk'
Installation failed due to: ''cmd package install-create -r -t --user current --full --dont-kill -r -t --skip-verification -S 10540209' returns error 'Unknown failure: Exception occurred while executing 'install-create':
android.os.ParcelableException: java.io.IOException: Requested internal only, but not enough space
The app is still opening and it seems like the newly added code is not reflected there. (not sure about this).
How can I fix this issue?
Please let me know if more details are required from my side.
Your emulator has ran out of space.
You can clear space by wiping the data
You can add more space by going to advanced settings in AVD popup

How to fix camel-k-kit error in camel-k version 1.0.0?

I just installed camel-k 1.0.0 as described in the installation documentation and ran a simple groovy example.
I installed camel-k on a 1.17 virtual on-prem kubernetes test-cluster.
The error:
Error during unshare(CLONE_NEWUSER): Invalid argument
User namespaces are not enabled in /proc/sys/user/max_user_namespaces.
level=error msg="error parsing PID \"\": strconv.Atoi: parsing \"\": invalid syntax"
level=error msg="(unable to determine exit status)"
How I installed:
kamel install --registry sonatype.nexus3.reg. --registry-auth-username MyUsername --registry-auth-password MyPassword
Then I executed hello.groovy:
kamel run hello.groovy
A camel-k-kit pod is created then running after a couple of seconds into the above error.
What am I doing wrong?

Elasticsearch: Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker

I'm using CentOS and have downloaded Elasticsearch 6.2.1. I created a new user "elastic" and when I run ./bin/elasticsearch I get the error:
Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker
I tried placing this user in an admin group ("wheel"), and the same problem occurs. If I try it with "sudo ./bin/elasticsearch" I get:
[2018-02-15T17:42:39,776][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.2.1.jar:6.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.1.jar:6.2.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.1.jar:6.2.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.1.jar:6.2.1]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.1.jar:6.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.1.jar:6.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.1.jar:6.2.1]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-6.2.1.jar:6.2.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) ~[elasticsearch-6.2.1.jar:6.2.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.1.jar:6.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.1.jar:6.2.1]
I searched a bit and saw that it this error can be due to the java version, but it seems to be up to date:
[elastic#sandbox-hdp elasticsearch-6.1.1]$ sudo update-alternatives --config java
There are 3 programs which provide 'java'.
Selection Command
1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
*+ 2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
3 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
This also happens if I try Elasticsearch 6.1
Any suggestions would be appreciated.
In case you still have this problem... or just for curiosity... take a look at the file ./bin/elasticsearch-env.sh, around the line 70, look for the command:
"$JAVA" -cp "$ES_CLASSPATH" org.elasticsearch.tools.launchers.JavaVersionChecker
Check if it is correctly "spelled" for your environment, write this command just before it and see what you've got:
echo "$JAVA" -cp "$ES_CLASSPATH" org.elasticsearch.tools.launchers.JavaVersionChecker
in my case... I was running in a Git Bash inside a Windows machine, and the command was pointing to:
/c/Users/Ualter/Developer/ELKStack/elasticsearch-6.2.2/lib/*
Changing to:
/Users/Ualter/Developer/ELKStack/elasticsearch-6.2.2/lib/*
As I was running on a Windows S.O. it get up and running OK the Elasticsearch.
I was trying hard to use elasticsearch 6.7.1 on Windows.
I had this exact error when running bin/elasticsearch.bat .
Long story short, there was probably an issue with my java version and elastic search, it couldn't run the jars (using Java 8 211).
I installed the last ElasticSearch 6.x from here :
https://www.elastic.co/downloads/past-releases#elasticsearch
And unset the existing ES_HOME and ES_CLASSPATH environment variables that I created, and all went well.
I also encounter such strange question, the first time it raises exception for running elastic as root, after I add a new user elastic and run it as elastic , I see this exception "Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker
".
I solved this problem by moving the program dirs to the non /root/ dirs, for example, I put it to /opt/elk/, and it works.
So I guess elastic may not allow to run as root for security , thus we can not put the program in the root user's dir. Hope it can make some tips for you.
I'm installing elasticsearch plugin es-sql on windows.
In my case, run the cmd as administrator role.
Seems like you don't have right permissions. Try to set them to 774 (rwxrwxr--) and check again:
sudo chmod 774 -R elasticsearch-6.3.2/

Selendroid, command android no longer available

I'm starting with Selendroid. I followed the user guide, which is in the official site and I've had troubles after this command:
java -jar selendroid-standalone-0.17.0-with-dependencies.jar -app selendroid-test-app-0.17.0.apk
I obtain this error:
GRAVE: Error building server: io.selendroid.standalone.exceptions.ShellCommandException: Error executing shell command: /home/ceibal/Android/Sdk/tools/android list avds
If I try executing this command line directly from terminal, I get the following message:
The android command is no longer available. For manual SDK and AVD management, please use Android Studio. For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
Then I tried:
$ANDROID_HOME/tools/bin/sdkmanager list avds
And the result was:
Warning: File /home/ceibal/.android/repositories.cfg could not be loaded. Warning: Failed to find package list
Finally, if I check that the application(s) and the devices are recognized by opening a browser and navigating to:
http://localhost:4444/wd/hub/status.
I can't connect to the server.
I wait for your help. Thanks in advance.

Categories