# Mbeans error

**URL:** https://discuss.elastic.co/t/mbeans-error/93541
**Category:** Elasticsearch
**Created:** [July 18, 2017, 9:32am UTC](https://discuss.elastic.co/t/mbeans-error/93541 "2017-07-18T09:32:44Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![alvaro13](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@alvaro13](https://discuss.elastic.co/u/alvaro13)
#### Post date: [July 18, 2017, 9:32am UTC](https://discuss.elastic.co/t/mbeans-error/93541/1 "2017-07-18T09:32:44Z")

</div>

Hello,

I just started studying elasticsearch and kibana for a project that I have in mind, and I am trying to set this up.

When I downloaded elasticsearch 5.5.0 and I try to run it, is showing up:

blues-mbp:bin bluenarkotic$ ./elasticsearch  
2017-07-18 12:08:48,096 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")  
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)  
at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)  
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)  
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)  
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)  
at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)  
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)  
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)  
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:556)  
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)  
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206)  
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:221)  
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197)  
at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:175)  
at org.elasticsearch.common.logging.LogConfigurator.configureWithoutConfig(LogConfigurator.java:99)  
at org.elasticsearch.cli.Command.main(Command.java:85)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)

Exception in thread "main" SettingsException[Failed to load settings from /Users/bluenarkotic/elasticsearch-5.5.0/config/elasticsearch.yml]; nested: AccessDeniedException[/Users/bluenarkotic/elasticsearch-5.5.0/config/elasticsearch.yml];  
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:102)  
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:72)  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67)  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122)  
at org.elasticsearch.cli.Command.main(Command.java:88)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)  
Caused by: java.nio.file.AccessDeniedException: /Users/bluenarkotic/elasticsearch-5.5.0/config/elasticsearch.yml  
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)  
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)  
at java.nio.file.Files.newByteChannel(Files.java:361)  
at java.nio.file.Files.newByteChannel(Files.java:407)  
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)  
at java.nio.file.Files.newInputStream(Files.java:152)  
at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1033)  
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:100)  
... 6 more

When I try to run it as root is not letting me.

any ideas? thanks.

---

<div class="post-metadata">

### Author: ![AitZaid](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@AitZaid](https://discuss.elastic.co/u/AitZaid)
#### Post date: [July 18, 2017, 10:13am UTC](https://discuss.elastic.co/t/mbeans-error/93541/2 "2017-07-18T10:13:07Z")

</div>

hi it is normal as they say it is super insecure to launch it in root, so it is disabled natively, but you still can do it: all you have to do is allow insecure root :

modify the file and add this property as follow : ES\_JAVA\_OPTS="-Des.insecure.allow.root=true"  
1/ vi bin/elasticsearch  
2/ add this property ES\_JAVA\_OPTS="-Des.insecure.allow.root=true"

and I'll leave here a forum from stackoverflow that discuss the same issue 🙂

> <https://stackoverflow.com/questions/34920801/how-to-run-elasticsearch-2-1-1-as-root-user-in-linux-machine>

hope it works for you 🙂

---

<div class="post-metadata">

### Author: ![AitZaid](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@AitZaid](https://discuss.elastic.co/u/AitZaid)
#### Post date: [July 18, 2017, 10:14am UTC](https://discuss.elastic.co/t/mbeans-error/93541/3 "2017-07-18T10:14:25Z")

</div>

altough i know this was written at time for elastic 2.X and now we're in 5.x but this will still do the trick 😉

---

<div class="post-metadata">

### Author: ![alvaro13](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@alvaro13](https://discuss.elastic.co/u/alvaro13)
#### Post date: [July 18, 2017, 10:19am UTC](https://discuss.elastic.co/t/mbeans-error/93541/4 "2017-07-18T10:19:32Z")

</div>

Where is the script file?

thanks

---

<div class="post-metadata">

### Author: ![AitZaid](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@AitZaid](https://discuss.elastic.co/u/AitZaid)
#### Post date: [July 18, 2017, 10:22am UTC](https://discuss.elastic.co/t/mbeans-error/93541/5 "2017-07-18T10:22:42Z")

</div>

it depends where you've installed it i guess try an updatedb then locate elasticsearch to see where it is ?

what os do you use ?

---

<div class="post-metadata">

### Author: ![alvaro13](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@alvaro13](https://discuss.elastic.co/u/alvaro13)
#### Post date: [July 18, 2017, 10:23am UTC](https://discuss.elastic.co/t/mbeans-error/93541/6 "2017-07-18T10:23:31Z")

</div>

I am currently running osx.

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [July 18, 2017, 10:24am UTC](https://discuss.elastic.co/t/mbeans-error/93541/7 "2017-07-18T10:24:26Z")

</div>

Please do not try to run Elasticsearch as root. Running anything as root is not secure and leaves you vulnerable to attack. The option mentioned here was removed in 5.0 and is no longer available. You should run Elasticsearch as a non-root user, preferably a user with only the minimal permissions required by Elasticsearch. If you are running on a mac for development purposes then you should run Elasticsearch as your normal logged in user.

---

<div class="post-metadata">

### Author: ![alvaro13](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@alvaro13](https://discuss.elastic.co/u/alvaro13)
#### Post date: [July 18, 2017, 10:25am UTC](https://discuss.elastic.co/t/mbeans-error/93541/8 "2017-07-18T10:25:40Z")

</div>

I understand, I tried to run it as normal user but still, you can see the logs, is complaining about the java exemption, so I can do anything.

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [July 18, 2017, 10:27am UTC](https://discuss.elastic.co/t/mbeans-error/93541/9 "2017-07-18T10:27:28Z")

</div>

What are the permissions on this file: `/Users/bluenarkotic/elasticsearch-5.5.0/config/elasticsearch.yml` ?

The exception is saying it doesn't have permission to access that file.

---

<div class="post-metadata">

### Author: ![alvaro13](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@alvaro13](https://discuss.elastic.co/u/alvaro13)
#### Post date: [July 18, 2017, 10:30am UTC](https://discuss.elastic.co/t/mbeans-error/93541/10 "2017-07-18T10:30:14Z")

</div>

-rw-rw---- 1 root wheel 2854 Jul 1 01:14 elasticsearch.yml

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [July 18, 2017, 10:34am UTC](https://discuss.elastic.co/t/mbeans-error/93541/11 "2017-07-18T10:34:01Z")

</div>

Ok so it looks like the problem is that the file is owned by the root user rather than your user. When you unzipped Elasticsearch did you do that as `root` (or with a `sudo` command)?

If so I would suggest that you delete the `elasticsearch-5.5.0` directory and unzip the .tar.gz/.zip file again but as your user rather than root and without using sudo.

Alternatively you could `chown bluenarkotic:bluenarkotic` all the files in `elasticsearch-5.5.0` but I think the above option would be safer

---

<div class="post-metadata">

### Author: ![alvaro13](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@alvaro13](https://discuss.elastic.co/u/alvaro13)
#### Post date: [July 18, 2017, 10:36am UTC](https://discuss.elastic.co/t/mbeans-error/93541/12 "2017-07-18T10:36:26Z")

</div>

Yes! that was the issue, looks like I Started the package and installed it as root user, cleared terminal and exit, and when I did it from the beginning with a normal user it worked! now is fine.

Thank you so much!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 15, 2017, 10:36am UTC](https://discuss.elastic.co/t/mbeans-error/93541/13 "2017-08-15T10:36:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
