Bug #5519


Replicated data files are 0 bytes

Added by ben leinfelder over 12 years ago. Updated over 12 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


We set up 2-way replication between PPBio and PELD (Brazilian Metacat instances) and have since seen that the replicated data files have no content on the target server.
Hi Ben,

today I noticed something in some data in the replication between PELD and PPBio2.

When I open a datafile that was originally inserted in Metacat through PELD, it is ok, but when I open the same datafile in PPBio2, the file is empty.
The same thing happens the other way around.

Ex: This package was inserted originally in PELD:

But in PPBio2 the data file is empty:

File inserted originally on PPBio2:

Empty file:

Related issues

Blocked by Metacat - Bug #5536: Restore replicated data files that are 0 bytesResolvedben leinfelder11/09/2011

Actions #1

Updated by ben leinfelder over 12 years ago

I set up one-way replication from -->
Using the Tomcat-only certificate generation/exchange approach, the data file was successfully replicated (with its content) to fred from bespin.

Actions #2

Updated by ben leinfelder over 12 years ago

Switching to use Apache for the SSL handling still left the data replication working as expected (the data is in the replicated file).

Actions #3

Updated by ben leinfelder over 12 years ago

Now with BOTH servers using Apache certificate/SSL mechanisms the replication is still successful. is running a 1.10.0 variant with the semtools plugin and fred is running a pretty up-to-date version of the same (we recently changed trunk to use 2.0.0 versioning).

So this looks like a problem that exists in the 1.9.5 tag/branch and not currently in trunk -- will try to track down where it might have been resolved.

Actions #4

Updated by ben leinfelder over 12 years ago

There's no difference between 1.9.5 tag and trunk for the ReplicationService.handleGetDataFileRequest() method -- maybe there's a configuration difference that is causing this for peld->knb?

Actions #5

Updated by ben leinfelder over 12 years ago

After installing Metacat 1.9.5 on I was able to see the failure point. It was something that I fixed in trunk a long time ago (probably during my character encoding enhancements) but never made it into our release branches. I'm not sure how old an issue this is for us, but I can't imagine it ever worked coded the way it is in 1.9.5 (which is an evolution of 1.9.3 when it first branched from trunk).
When ReplicationServlet handles any request it first gets a PrintWriter from the response object. But when we try to send data to the response by getting it's OutputStream, we throw an IllegalStateException -- only one of those can be called on the same response object.

stack trace:
knb 20111101-00:02:26: [DEBUG]: ReplicationServlet.handleGetOrPost - Action "readdata" accepted for server: [ReplicationLogging]
knb 20111101-00:02:26: [ERROR]: Servlet.service() for servlet replication threw exception [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/knb].[replication]]
java.lang.IllegalStateException: getWriter() has already been called for this response
at org.apache.catalina.connector.Response.getOutputStream(
at org.apache.catalina.connector.ResponseFacade.getOutputStream(
at edu.ucsb.nceas.metacat.replication.ReplicationServlet.handleGetOrPost(
at edu.ucsb.nceas.metacat.replication.ReplicationServlet.doGet(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.jk.server.JkCoyoteHandler.invoke(
at org.apache.jk.common.HandlerRequest.invoke(
at org.apache.jk.common.ChannelSocket.invoke(
at org.apache.jk.common.ChannelSocket.processConnection(
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(
at org.apache.tomcat.util.threads.ThreadPool$

Actions #6

Updated by ben leinfelder over 12 years ago

This is fixed. We just need to figure out the files that have not replicated successfully. Any 0-length files on KNB and LTER are suspect. Then we will need to track down where they came from in order to get the content.

Actions #7

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 5519


Also available in: Atom PDF