Hide Forgot
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= -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.
Fixed in 2.1-SNAPSHOT. Generation of translated raw documents now uses document type from the database to select an appropriate adapter. See: https://github.com/zanata/zanata/commit/22d5e22cd6bafd4df060587a6eb6141bb75dbd4d
VERIFIED with Zanata version 2.1-SNAPSHOT (20121214-0032)