Skip to content
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

Issue with Http Rest only on es 1.7.4 #23

Closed
ngenain opened this issue Feb 9, 2016 · 10 comments
Closed

Issue with Http Rest only on es 1.7.4 #23

ngenain opened this issue Feb 9, 2016 · 10 comments

Comments

@ngenain
Copy link

ngenain commented Feb 9, 2016

Hi,

My configuration is :

readonlyrest:
    enable: true
    response_if_req_forbidden: Sorry, your request is forbidden.
    access_control_rules:
    - name:  full access if Basic HTTP auth
      type: allow
      auth_key: "user:password"

And installed from https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin/blob/master/download/elasticsearch-readonlyrest-v1.4_es-v1.7.1.zip?raw=true
And the node won't start with the following stack trace:

[2016-02-09 16:04:24,186][INFO ][node                     ] [es-dev-04] version[1.7.4], pid[3022], build[0d3159b/2015-12-15T11:25:18Z]
[2016-02-09 16:04:24,187][INFO ][node                     ] [es-dev-04] initializing ...
[2016-02-09 16:04:24,241][INFO ][plugins                  ] [es-dev-04] loaded [readonlyrest], sites [head]
[2016-02-09 16:04:24,265][INFO ][env                      ] [es-dev-04] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [44.5gb], net total_space [98.4gb], types [ext4]
[2016-02-09 16:04:25,971][ERROR][rest.action.readonlyrest ] [es-dev-04] impossible to initialize ACL configuration
org.elasticsearch.rest.action.readonlyrest.acl.RuleConfigurationError: insufficient or invalid configuration for rule: 'full access if Basic HTTP auth'
    at org.elasticsearch.rest.action.readonlyrest.acl.Rule.build(Rule.java:90)
    at org.elasticsearch.rest.action.readonlyrest.acl.ACL.readRules(ACL.java:31)
    at org.elasticsearch.rest.action.readonlyrest.acl.ACL.<init>(ACL.java:20)
    at org.elasticsearch.rest.action.readonlyrest.ReadonlyRestAction.<init>(ReadonlyRestAction.java:49)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:54)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
    at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:57)
    at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:200)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:830)
    at org.elasticsearch.common.inject.InjectorBuilder.loadEagerSingletons(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:175)
    at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)
    at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
    at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
    at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:59)
    at org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:210)
    at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:77)
    at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:245)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
[2016-02-09 16:04:27,111][ERROR][bootstrap                ] Exception
org.elasticsearch.common.inject.CreationException: Guice creation errors:

1) Error injecting constructor, org.elasticsearch.rest.action.readonlyrest.acl.RuleConfigurationError: insufficient or invalid configuration for rule: 'full access if Basic HTTP auth'
  at org.elasticsearch.rest.action.readonlyrest.ReadonlyRestAction.<init>(Unknown Source)
  while locating org.elasticsearch.rest.action.readonlyrest.ReadonlyRestAction

1 error
    at org.elasticsearch.common.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:344)
    at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:178)
    at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)
    at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
    at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
    at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:59)
    at org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:210)
    at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:77)
    at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:245)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Caused by: org.elasticsearch.rest.action.readonlyrest.acl.RuleConfigurationError: insufficient or invalid configuration for rule: 'full access if Basic HTTP auth'
    at org.elasticsearch.rest.action.readonlyrest.acl.Rule.build(Rule.java:90)
    at org.elasticsearch.rest.action.readonlyrest.acl.ACL.readRules(ACL.java:31)
    at org.elasticsearch.rest.action.readonlyrest.acl.ACL.<init>(ACL.java:20)
    at org.elasticsearch.rest.action.readonlyrest.ReadonlyRestAction.<init>(ReadonlyRestAction.java:49)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:54)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
    at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:57)
    at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:200)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:830)
    at org.elasticsearch.common.inject.InjectorBuilder.loadEagerSingletons(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:175)
    ... 9 more

Nevertheless, with IP filtering it worked like a charm. Is something missing in my configuration? Or is there a bug?

Thanks,

@ngenain
Copy link
Author

ngenain commented Feb 16, 2016

Hi,

So after looking at the code, it seems that on the branch ES_1.x api_keys and auth_keys are not supported.

Do you have any plans on this?

Thanks!

@sscarduzio
Copy link
Owner

Actually I'm quite surprised there's so much demand for ES 1.x, as you're not the first one asking for feature backport.

Last time I refused saying backporting features does not add value to the project, but apparently the upgrade path to ES 2.x is really steep and the demand for 1.x is still high.

How do you feel about creating a pull request to 1.x branch? I can help you if needed.

@ngenain
Copy link
Author

ngenain commented Feb 19, 2016

I am actually in the process of switching to 2.X. I was testing your plugin on 1.7 before switching since the previous plugin I was using has been abandonned.

As much as I would like to help backporting to 1.X it's been a long time since I have written any program in java... I guess I'll install after jumping to 2.X!

@sscarduzio
Copy link
Owner

OK then, if you are upgrading you're all set! I generally make sure that at least the newest 3 releases get all the bug fixes and features.

@chandanjog
Copy link

Experienced the same. Would also like to have this feature for ES 1.7, still some time before we can upgrade to 2.x. Happy to help back-porting it. Any pointers would be good to get started @sscarduzio.

@chandanjog
Copy link

Looks like you have already started working on the backport. Is this https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin/compare/PORT_ES_1.x ready to use?

@sscarduzio
Copy link
Owner

The basic unit tests are already passing, I still have to run some integration-tests manually to see everything is in order, hopefully we’ll have a packaged release late this afternoon UK time (I can’t work on this in office hours).

If you feel lucky, by all means, go ahead and run the ./build.sh on that branch and test the zip.

On 3 Mar 2016, at 09:23, Chandan Jog notifications@github.com wrote:

Looks like you have already started working on the backport. Is this https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin/compare/PORT_ES_1.x https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin/compare/PORT_ES_1.x ready to use?


Reply to this email directly or view it on GitHub #23 (comment).

@chandanjog
Copy link

Thanks for the quick turnaround @sscarduzio!

@sscarduzio
Copy link
Owner

No worries @chandanjog, you're very welcome. Just let me know if:

  • There's a bug
  • Something could be easier to use (configuration usability)
  • It would be nice if this plugin could do X, Y, ...

Also it would be really nice (and motivating!) to know how you guys are using this plugin, what problems it solved and what other it didn't solve, etc.

@ngenain this is for you as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants