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

Simplify usage of rest/web_listen_uri #2603

Closed
mariussturm opened this Issue Aug 3, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@mariussturm
Member

mariussturm commented Aug 3, 2016

Problem description

The desired state is to have the web interface on <domain>/ and the api listener on <domain>/api.

1st try: web_listen_uri: http://0.0.0.0:9000/ rest_listen_uri: http://0.0.0.0:9000/api
Error message is: com.github.joschi.jadconfig.ValidationException: If REST and Web Interface are served on the same host/port, the web interface must have a path prefix!

This is confusing because the default setting is exactly the other way around: web_listen_uri: http://0.0.0.0:12900/web rest_listen_uri: http://0.0.0.0:12900/ I would expect to swap both URIs without a problem.

2nd try: web_listen_uri: http://0.0.0.0:9000/web rest_listen_uri: http://0.0.0.0:9000/api
This works but nothing is on the root listener. At least a redirect to web_listen_uri or web_endpoint_uri should be send there.

3rd try web_listen_uri: http://0.0.0.0:9000/web rest_listen_uri: http://0.0.0.0:9000/
Opening http://<IP>:9000 works after some seconds, a redirect to http://<IP>:9000/web happens but a stacktrace shows up in the server log:

graylog_1          | Caused by: java.io.IOException: Broken pipe
graylog_1          |    at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[?:1.8.0_91]
graylog_1          |    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) ~[?:1.8.0_91]
graylog_1          |    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[?:1.8.0_91]
graylog_1          |    at sun.nio.ch.IOUtil.write(IOUtil.java:51) ~[?:1.8.0_91]
graylog_1          |    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) ~[?:1.8.0_91]
graylog_1          |    at org.glassfish.grizzly.nio.transport.TCPNIOUtils.flushByteBuffer(TCPNIOUtils.java:149) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.nio.transport.TCPNIOUtils.writeCompositeBuffer(TCPNIOUtils.java:87) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:129) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:106) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:260) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:169) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:71) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:126) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:890) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:858) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.http.io.OutputBuffer.flushBuffer(OutputBuffer.java:1029) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:681) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.grizzly.http.server.NIOOutputStreamImpl.write(NIOOutputStreamImpl.java:83) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:229) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:299) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.ReaderWriter.writeTo(ReaderWriter.java:116) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider.writeTo(AbstractMessageReaderWriterProvider.java:79) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:105) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.InputStreamProvider.writeTo(InputStreamProvider.java:60) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) ~[graylog.jar:?]
graylog_1          |    at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86) ~[graylog.jar:?]
graylog_1          |    ... 20 more

Environment

  • Graylog Version: 2.1.0-beta.2
  • Browser version: FF 45

@kroepke kroepke added the improvement label Aug 8, 2016

@kroepke kroepke added this to the 2.1.0 milestone Aug 8, 2016

joschi added a commit that referenced this issue Aug 8, 2016

kroepke added a commit that referenced this issue Aug 10, 2016

Enable running Graylog REST API on different context path (#2634)
* Allow web interface to listen on root context

Refs #2603

* Merge RestApiService and WebInterfaceService into JerseyService

* Merge StreamAlertReceiverResource into StreamAlertResource

StreamAlertReceiverResource had the same @path annotation as StreamAlertResource which
ultimately led to duplicate Resource models and Jersey throwing exceptions.

* Avoid endless loading if stream throughput cannot be loaded

* Use relative paths in remote resources

* Ensure to normalize all configurable URIs

* Add PrefixAddingModelProcessor

* Serve web interface assets from "assets/" path

* Allow running REST API and web interface on the same port

* Add Jersey response filter for catching 404 responses

* Fix Swagger UI

* Change HTTP listener default configuration settings

* rest_listen_uri = http://127.0.0.1:9000/api/
* web_listen_uri = http://127.0.0.1:9000/

* Add "fallback" prefix for JAX-RS resource packages (e. g. plugins)

* Fix path of plugin resources for web interface

* Replace String.prototype.startsWith() with "manual" variant in Swagger UI

Looking at you, Internet Explorer! ಠ_ಠ

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Browser_compatibility

* Fix context path of standalone web interface listener

* Print correct URI for REST API on startup
@joschi

This comment has been minimized.

Contributor

joschi commented Aug 11, 2016

@mariussturm These issues should be fixed by #2634.

@joschi joschi closed this Aug 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment