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

Make possible to set rest_transport_uri relative #2596

Closed
hc4 opened this issue Aug 3, 2016 · 2 comments
Closed

Make possible to set rest_transport_uri relative #2596

hc4 opened this issue Aug 3, 2016 · 2 comments

Comments

@hc4
Copy link
Contributor

@hc4 hc4 commented Aug 3, 2016

Problem description

If I configure rest_transport_uri =, then graylog able to open main page and some other (e.g. streams, search), but some rest requests won't work.
For example:
image
return error: {"type":"ApiError","message":"Illegal URL: "}

Also error can be found in logs:

2016-08-03T11:56:34.538+03:00 ERROR [AnyExceptionClassMapper] Unhandled exception in REST resource
java.lang.IllegalArgumentException: Illegal URL:
        at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:437) ~[graylog.jar:?]
        at org.graylog2.rest.RemoteInterfaceProvider.get(RemoteInterfaceProvider.java:58) ~[graylog.jar:?]
        at org.graylog2.shared.rest.resources.ProxiedResource.lambda$createRemoteInterfaceProvider$1(ProxiedResource.java:90) ~[graylog.jar:?]
        at org.graylog2.shared.rest.resources.ProxiedResource.lambda$getForAllNodes$0(ProxiedResource.java:66) ~[graylog.jar:?]
        at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321) ~[?:1.8.0_91]
        at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:1.8.0_91]
        at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1683) ~[?:1.8.0_91]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_91]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_91]
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_91]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_91]
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_91]
        at org.graylog2.shared.rest.resources.ProxiedResource.getForAllNodes(ProxiedResource.java:65) ~[graylog.jar:?]
        at org.graylog2.shared.rest.resources.ProxiedResource.getForAllNodes(ProxiedResource.java:58) ~[graylog.jar:?]
        at org.graylog2.rest.resources.cluster.ClusterMetricsResource.multipleMetricsAllNodes(ClusterMetricsResource.java:69) ~[graylog.jar:?]
        at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[gra                                  ylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) ~[graylog.j                                  ar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) ~[graylog.                                  jar:?]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.j                                  ava:205) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) ~[graylog                                  .jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [graylog.jar:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [graylog.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [graylog.jar:?]
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384) [graylog.jar:?]
        at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [graylog.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_91]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]

Environment

  • Graylog Version: 2.1.0-beta2
@joschi
Copy link
Contributor

@joschi joschi commented Aug 3, 2016

@hc4 The rest_transport_uri MUST NOT be a relative URI (we should check that and fail fast if it is, though) because it's being used by Graylog itself to locate and communicate with other Graylog nodes.

@joschi joschi closed this Aug 3, 2016
@hc4
Copy link
Contributor Author

@hc4 hc4 commented Aug 3, 2016

Got it :)

Changed config and everything works fine!

rest_transport_uri = http://127.0.0.1:80/
web_endpoint_uri =
joschi pushed a commit that referenced this issue Aug 3, 2016
bernd added a commit that referenced this issue Aug 3, 2016
…bsolute URIs (#2600)

* Upgrade to JadConfig 0.13.0
* Ensure that {rest,web}_{listen,transport,endpoint}_uri settings are absolute URIs

Refs #2596
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants