[zanata-bugs] [Bug 886711] New: Error when using pull for project type raw when the document name does not include a type extension

bugzilla at redhat.com bugzilla at redhat.com
Wed Dec 12 23:38:14 UTC 2012


Product: Zanata
https://bugzilla.redhat.com/show_bug.cgi?id=886711

            Bug ID: 886711
           Summary: Error when using pull for project type raw when the
                    document name does not include a type extension
           Product: Zanata
           Version: 2.0
         Component: Component-Maven
          Severity: high
          Priority: medium
          Reporter: damason at redhat.com
            Blocks: 864277

Description of problem:
When using pull command with projectType=raw, if the project contains any
documents that have been uploaded as raw documents, but the document name does
not include an extension matching the type, a 500 error (caused by
NullPointerException) is returned by the server.


Version-Release number of selected component (if applicable):
Server version 2.0.3

How reproducible:
Always


Steps to Reproduce:
1. Use curl to upload a raw document under a name with no extension
     e.g. curl -F type=txt -F file=@document.txt -F hash=`md5sum document.txt |
awk '{print $1}'`   -F first=true -F last=true   -H "X-Auth-User:USERNAME" -H
"X-Auth-Token:API_KEY"   
"SERVER/rest/file/source/PROJECT_SLUG/VERSION_SLUG?docId=document

     Note: docId=document has no file extension

2. Download zanata.xml for the project-version and ensure project type is raw
(e.g. <project-type>raw</project-type>
3. From the directory containing zanata.xml, run zanata pull command (e.g. mvn
zanata:pull)

Actual results:
500 internal server error when the process reaches the document from step 1.
Some documents that have a matching extension may be pulled successfully,
depending on the order that the documents are pulled.

Expected results:
All documents pulled successfully, regardless of document name.

Additional info:
Caused by use of document name to look up a file format adapter. Should use
document type from database.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=uJa9436TR0&a=cc_unsubscribe




More information about the zanata-bugs mailing list