Issue Details (XML | Word | Printable)

Key: JRA-4980
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anton Mazkovoi [Atlassian]
Reporter: Maik Schreiber
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
JIRA

CDATA sections in comments not escaped correctly

Created: 19/Oct/04 09:47 AM   Updated: 30/Jul/06 07:34 PM
Component/s: Import / Export
Affects Version/s: 3.0.1
Fix Version/s: 3.1

Time Tracking:
Not Specified

Issue Links:
Duplicate
 
Reference

Participants: Andrew Michalec, Anton Mazkovoi [Atlassian], Derek MacKie, Greg Warden, Jeff Turner [Atlassian], Maik Schreiber and Nick Menere [Atlassian]
Since last comment: 2 years, 42 weeks, 5 days ago
Resolution Date: 06/Dec/04 05:24 PM
Labels:


 Description  « Hide
When an issue comment contains a CDATA section, this section's closing tag is not escaped correctly when exporting to XML. This causes a subsequent XML import to fail.

Proposed fix: Insert a closing and an opening CDATA tag right in the middle of the comment's CDATA closing tag. This causes the closing tag to break up and not mess up JIRA's escaping.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Maik Schreiber added a comment - 19/Oct/04 02:07 PM
Just to make sure: This issue is breaking automatic backups, too.

Jeff Turner [Atlassian] added a comment - 20/Oct/04 08:32 PM
Hi,

We have partially implemented the solution you suggest. It should appear in JIRA 3.1

Thanks for the report.


Maik Schreiber added a comment - 23/Oct/04 01:20 PM
I'm sorry, but what exactly do you mean by saying "partially"?

Anton Mazkovoi [Atlassian] added a comment - 25/Oct/04 12:43 AM
Hi,

We have implemented the fix, but the code has not gone through a great deal of testing. We would like to test the fix and roll the code into JIRA 3.1.

Thanks,
Anton


Jeff Turner [Atlassian] added a comment - 05/Dec/04 11:29 PM
The fix appears to work. To use this locally, download:

http://repository.atlassian.com/ofbcore/jars/ofbcore-entity-2.1.1-atlassian-06122004.jar

and copy to your WEB-INF/lib/ directory (atlassian-jira/WEB-INF/lib/ in JIRA Standalone; webapp/WEB-INF/lib/ in JIRA WAR/Webapp). You must also delete the old WEB-INF/lib/ofbcore-entity-2.1.1.jar file, which this replaces.


Andrew Michalec added a comment - 27/Jan/05 10:48 AM
This bug is similar to JRA-4980

Greg Warden added a comment - 14/Aug/05 09:42 PM
I have an XML file generated from Jira 3.2 that appears to still have this problem.

In my comment I have:

...
The MessageArg of ANSWER_TIMEOUT_DURATION gets passed
<MessageArg>
<Name>ANSWER_TIMEOUT_DURATION</Name>
<Value><![CDATA[96:00:00]]></Value>
</MessageArg>

In the XML I get:

...
The MessageArg of ANSWER_TIMEOUT_DURATION gets passed
<MessageArg>
<Name>ANSWER_TIMEOUT_DURATION</Name>
<Value><Unable to render embedded object: File ([CDATA[96:00:00]]]]><) not found.[CDATA[></Value>
</MessageArg>

but nothing else]]></description>

What is the XML supposed to look like?


Greg Warden added a comment - 14/Aug/05 09:57 PM
My mistake – I think that one woked right – its a different bit:

In the comment we have:

WE had EX fail a event which had no reachable contacts. One we sent over was marked unreachable in the db. Alarm on 10/11/04, our log says:
<ContactMethod Label="21085669">
<Transport>email</Transport>
<Ordinal>1</Ordinal>
<Qualifier>office</Qualifier>
<EmailAddress><![CDATA[2013b7b7]]></EmailAddress>
</ContactMethod>
[ContactMethodLabel is our ContactInfoId]

the XML looked like:

<description><![CDATA[WE had EX fail a event which had no reachable contacts. One we sent over was marked unreachable in the db. Alarm on 10/11/04, our log says:
<ContactMethod Label="21085669">
<Transport>email</Transport>
<Ordinal>1</Ordinal>
<Qualifier>office</Qualifier>
<EmailAddress><![CDATA[2013b7b7]]></EmailAddress>
</ContactMethod>
[ContactMethodLabel is our ContactInfoId]]]></description>

looks like this closing ]] was missed.


Greg Warden added a comment - 14/Aug/05 10:14 PM
I appologize for the comment spam, but now I am a little confused.

The same backup file which is failing on my 3.3 enterprise system running under orion, correctly imports into my standalone 3.3 system (tomcat).

So maybe this has nothing to do with this bug, even though the error message on the import pointed me here.


Jeff Turner [Atlassian] added a comment - 17/Aug/05 12:50 AM
Greg,

Orion 2.0.2 works fine with that snippet (the ']]>' has been already escaped, so I wouldn't expect it to cause problems). If you work out what is breaking it, please comment here.

Cheers,
Jeff


Greg Warden added a comment - 06/Sep/05 10:12 AM
Just getting back to this now (well this past weekend):

With Orion/EAR/MySQL distribution of 3.3.1 when I try to restore my backup (made by a 3.2 system) I get

Parser has reached the entity expansion limit "64,000" set by the Application.

I dont get this on the standalone Tomcat/MySQL installation (different machine).

I tried then making a mackup from the Tomcat system and restoring that on the Orion system and still get the same error.

Where is this expansion limit set, and is this something I should be changing? Or is this something with the DB driver in Orion for MySQL?

Is the XML parser the same in both the Standalone and WAR/EAR distributions?


Nick Menere [Atlassian] added a comment - 06/Sep/05 11:06 PM
Hi Greg,

I believe if you start JIRA with the option (or even bigger):
-DentityExpansionLimit=100000

You should be able ot import the file.

This was found at:
http://java.sun.com/j2se/1.5.0/docs/guide/xml/jaxp/JAXP-Compatibility_150.html

Cheers,
Nick


Derek MacKie added a comment - 09/Dec/05 06:11 PM
re:
----------------
The fix appears to work. To use this locally, download:

http://repository.atlassian.com/ofbcore/jars/ofbcore-entity-2.1.1-atlassian-06122004.jar

and copy to your WEB-INF/lib/ directory (atlassian-jira/WEB-INF/lib/ in JIRA Standalone; webapp/WEB-INF/lib/ in JIRA WAR/Webapp). You must also delete the old WEB-INF/lib/ofbcore-entity-2.1.1.jar file, which this replaces.
-----------------

Does this mean:
Copy that file onto our OLD jira version. Then do an export, and it wont produce the bad cdata anymore?. Or does it mean, copy that onto our NEW jira version, then when we import. It will be able to compensate for the bad cdata?


Anton Mazkovoi [Atlassian] added a comment - 12/Dec/05 04:27 PM
Derek,

> Copy that file onto our OLD jira version. Then do an export, and it wont produce the bad cdata anymore?
This is the one it means.

The problem is that once 'bad' CDATA sections have been produced, its impossible to deal with them properly. Hence we need to ensure the export escapes the data properly.

Thanks,
Anton