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

Broken 403 Error pg #5967

Closed
mheppler opened this issue Jun 24, 2019 · 4 comments · Fixed by #6023
Closed

Broken 403 Error pg #5967

mheppler opened this issue Jun 24, 2019 · 4 comments · Fixed by #6023

Comments

@mheppler
Copy link
Contributor

mheppler commented Jun 24, 2019

I have been seeing this horrible yellow error pg in my localhost (Firefox, develop v 4.15) a lot lately, while I believe most of them are of the 500 variety, I am creating this issue specifically for the 403, because that's easier for me to reproduce.

Screen Shot 2019-06-24 at 4 19 32 PM

Navigate to an unpublished dataset as an admin in one browser, copy and paste the URL into another browser, when prompted log in as a user without access permissions, and boom, ugly error pages.

The Google Chrome version ain't much better.

Screen Shot 2019-06-24 at 4 21 05 PM

The 404 pg works as expected, for what it's worth.

This behavior also appears on demo (v 4.14 build 1326-57a392d). However, dataverse-internal (v. 4.15 build 1359-631db06) is properly displaying the 403 error pg in both Firefox and Chrome

@mheppler
Copy link
Contributor Author

mheppler commented Jun 26, 2019

Randomly found this warning/error Exception processing ErrorPage[errorCode=404, location=/404.xhtml] in my server log when clicking on a dataverse from the featured carousel. Not sure why it popped up. My browser loaded the target dataverse pg with no problems.

Warning:   org.apache.catalina.core.StandardHostValve@7ec925bd: Exception processing ErrorPage[errorCode=404, location=/404.xhtml]
java.io.IOException: Broken pipe
	at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
	at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
	at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
	at sun.nio.ch.IOUtil.write(IOUtil.java:51)
	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
	at org.glassfish.grizzly.nio.transport.TCPNIOUtils.flushByteBuffer(TCPNIOUtils.java:149)
	at org.glassfish.grizzly.nio.transport.TCPNIOUtils.writeCompositeBuffer(TCPNIOUtils.java:87)
	at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:112)
	at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:91)
	at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:261)
	at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:170)
	at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:70)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:126)
	at org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:848)
	at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:817)
	at org.glassfish.grizzly.http.io.OutputBuffer.flushBuffer(OutputBuffer.java:1024)
	at org.glassfish.grizzly.http.io.OutputBuffer.flushBinaryBuffers(OutputBuffer.java:1011)
	at org.glassfish.grizzly.http.io.OutputBuffer.flushBinaryBuffersIfNeeded(OutputBuffer.java:1173)
	at org.glassfish.grizzly.http.io.OutputBuffer.flushCharsToBuf(OutputBuffer.java:1166)
	at org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:454)
	at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:405)
	at org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:217)
	at org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:225)
	at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:240)
	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:473)
	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
	at org.ocpsoft.rewrite.faces.RewriteViewHandler.renderView(RewriteViewHandler.java:196)
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:873)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:577)
	at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:546)
	at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:428)
	at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:505)
	at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:699)
	at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:380)
	at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:234)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:417)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
	at java.lang.Thread.run(Thread.java:748)

@djbrooke
Copy link
Contributor

  • There was an issue a few months back about Google Analytics changes causing this. This may be related to that or completely different.

@mheppler mheppler moved this from IQSS Sprint 7/10 - 7/24 to IQSS Team Dev 💻 in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Jul 15, 2019
@mheppler mheppler self-assigned this Jul 15, 2019
mheppler added a commit that referenced this issue Jul 15, 2019
@mheppler
Copy link
Contributor Author

mheppler commented Jul 15, 2019

It appears that there was a problem with some special characters in the analytics code (thank you, @landreev), as the first screenshot above outlines. With a little digging, it appears a workaround is the "CDATA trick" added inside the script tag of the analytics javascript code.

This will work so long as your code doesn't contain characters which are "special" in XML, which usually means < and &. If your code contains either of these, you can work around this with CDATA sections:

Creating a pull request for this quick fix, but still plan to investigate if there are other places we should also add the CDATA section to inline javascript code.

@mheppler
Copy link
Contributor Author

Reviewed all of the script tags for javascript code to add the CDATA sections for inline resources, also reviewed the type attribute warnings from the W3C Validator and removed those.

Screen Shot 2019-07-16 at 11 54 31 AM

  • dashboard-datamove.xhtml
  • dashboard.xhtml
  • dataset-versions.xhtml
  • dataset.xhtml
  • datasetFieldForEditFragment.xhtml
  • dataverse.xhtml
  • dataverse_template.xhtml
  • dataverseuser.xhtml
  • editFilesFragment.xhtml
  • editdatafiles.xhtml
  • file-versions.xhtml
  • filesFragment.xhtml
  • harvestclients.xhtml
  • harvestsets.xhtml
  • iframe.xhtml
  • loginpage.xhtml
  • manage-groups.xhtml
  • mydata_fragment.xhtml
  • permissions-manage-files.xhtml
  • provenance-popups-fragment.xhtml
  • provenance/files_prov_tab.xhtml
  • roles-assign.xhtml
  • search-include-fragment.xhtml
  • subset/gui_subset.xhtml

Smoke tested various pgs and features. Can log in, create dataset, upload files, ingest, publish and load version differences as expected. Found a problem on My Data, which was related to ui:remove tags inside of the new CDATA sections added to the inline javascript code. So those comments contained in those tags were moved outside the CDATA section. This is not the most elegant solution, but neither was including those tags in script tags.

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

Successfully merging a pull request may close this issue.

3 participants