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

Sword API: Can't create study when hidden characters are introduced in atom.xml #894

Closed
raprasad opened this issue Sep 2, 2014 · 3 comments
Assignees
Labels
Type: Bug a defect

Comments

@raprasad
Copy link
Contributor

raprasad commented Sep 2, 2014


Author Name: Elda Sotiri (@esotiri)
Original Redmine Issue: 3313, https://redmine.hmdc.harvard.edu/issues/3313
Original Date: 2013-09-18
Original Assignee: Philip Durbin


This was tested on dvn-build 3.6 #111

I am attaching the atom file that on line 16 has a hidden character, and it fails creating a study. I can see the char with emacs or xcode.
dcterms:publisherhere is the hidden char /dcterms:publisher

@raprasad raprasad added this to the In Review milestone Sep 2, 2014
@raprasad raprasad modified the milestones: Dataverse 4.0: In Review, In Review Sep 2, 2014
@eaquigley eaquigley modified the milestones: Dataverse 4.0: In Review, In Review - Dataverse 4.0, Beta 8 - Dataverse 4.0 Sep 2, 2014
@pdurbin
Copy link
Member

pdurbin commented Oct 20, 2014

In 326f120 I committed a test file to reproduce the bug but things are a little better because we now catch the org.apache.abdera.parser.ParseException due to work in #893. Upstream I reported this as the same bug: swordapp/JavaServer2.0#6 (comment)

@pdurbin
Copy link
Member

pdurbin commented Oct 21, 2014

As of f181c0d we are doing more sanity checks on both creating datasets via SWORD and editing the metadata.

Here's and example of testing the creation of a dataset.

$ curl --insecure --data-binary @scripts/api/data-deposit/data/atom-entry-study-894-invisible-character.xml -H 'Content-Type: application/atom+xml' -u pete:pete https://localhost:8181/dvn/api/data-deposit/v1/swordv2/collection/dataverse/peteTop

<?xml version="1.0" encoding="ISO-8859-1"?> <sword:error href="http://purl.org/net/sword/error/ErrorBadRequest" xmlns:sword="http://purl.org/net/sword/terms/"><atom:title xmlns:atom="http://www.w3.org/2005/Atom">ERROR</atom:title><atom:updated xmlns:atom="http://www.w3.org/2005/Atom">2014-10-21T10:10:09Z</atom:updated><atom:generator uri="http://www.swordapp.org/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"/><sword:treatment>Processing failed</sword:treatment><atom:summary xmlns:atom="http://www.w3.org/2005/Atom">Can not create dataset due to malformed Atom entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 19)) at [row,col {unknown-source}]: [14,23]</atom:summary></sword:error>

The expected error message for replacing metadata with a bad XML file (hidden characters, etc.) is "Can not replace dataset metadata due to malformed Atom entry".

Passing to QA.

@pdurbin pdurbin removed their assignment Oct 21, 2014
@esotiri esotiri self-assigned this Oct 21, 2014
@esotiri
Copy link
Contributor

esotiri commented Oct 24, 2014

Getting the correct error msg: "Illegal character ((CTRL-CHAR, code 19))
at [row,col {unknown-source}]: [14,23]/atom:summary/sword:error"

<sword:error href="http://purl.org/net/sword/error/ErrorBadRequest" xmlns:sword="http://purl.org/net/sword/terms/"><atom:title xmlns:atom="http://www.w3.org/2005/Atom">ERROR/atom:title<atom:updated xmlns:atom="http://www.w3.org/2005/Atom">2014-10-24T14:31:02Z/atom:updated<atom:generator uri="http://www.swordapp.org/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"/>sword:treatmentProcessing failed/sword:treatment<atom:summary xmlns:atom="http://www.w3.org/2005/Atom">Can not create dataset due to malformed Atom entry: org.apache.abdera.parser.ParseException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 19))
at [row,col {unknown-source}]: [14,23]/atom:summary/sword:error

@esotiri esotiri closed this as completed Oct 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug a defect
Projects
None yet
Development

No branches or pull requests

5 participants