Bug 812205

Summary: Maven client gets 400 Bad Request using pushTrans option
Product: [Retired] Zanata Reporter: Ding-Yi Chen <dchen>
Component: Component-MavenAssignee: Carlos Munoz <camunoz>
Status: CLOSED CURRENTRELEASE QA Contact: Joyce Chang <jochang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.6-SNAPSHOTCC: camunoz, damason, petersen, sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: 1.6-alpha-1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: maven client 1.6.0-alpha-3-SNAPSHOT Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-22 00:58:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Maven client log
none
Server log
none
Source pot
none
Translation to be pushed with pushTrans none

Description Ding-Yi Chen 2012-04-13 05:43:55 UTC
Created attachment 577226 [details]
Maven client log

Description of problem:
It looks like maven can no longer push with -Dzanata.pushTrans

Version-Release number of selected component (if applicable):
client API version: 1.6-SNAPSHOT, server API version: 1.6-SNAPSHOT
[WARNING] client API timestamp is 20120412-1426, but server API timestamp is 20120413-0001

How reproducible:
Quite a lot of time

Steps to Reproduce:
1. Server enable locale ja
2. Project/Version to be pushed "AboutFedora/f13"
3. edit zanata.xml as follows:
<config xmlns="http://zanata.org/namespace/config/">
  <url>SERVERURL</url>
  <project>AboutFedora</project>
  <project-version>f13</project-version>
  <project-type>podir</project-type>
  <locales>
    <locale map-from="ja-JP">ja</locale>
  </locales>
</config>

4. mvn -e zanata:push -B -Dzanata.pushTrans
  
Actual results:
[ERROR] Failed to execute goal org.zanata:zanata-maven-plugin:1.6-SNAPSHOT:push (default-cli) on project null: Zanata mojo exception: operation returned 400 (Bad Request): empty TextFlowTarget 6bb2aaa48c3a478925800ff269953856 must have ContentState New, uri: http://zanata-empire.lab.eng.bne.redhat.com:8080/rest/projects/p/UserGuide/iterations/i/f14/r, annotations: [@javax.ws.rs.PUT(), @javax.ws.rs.Path(value={id}/translations/{locale})] -> [Help 1]

See attached client.log and server.log for details.

Expected results:
Translation pushed without error

Additional info:
Python client seems working fine.

Comment 1 Sean Flanigan 2012-04-13 05:57:47 UTC
Could you please attach the PO file you were using?

Comment 2 Ding-Yi Chen 2012-04-13 06:36:47 UTC
Created attachment 577237 [details]
Server log

Comment 3 Ding-Yi Chen 2012-04-13 06:39:04 UTC
Created attachment 577238 [details]
Source pot

Comment 4 Ding-Yi Chen 2012-04-13 06:40:16 UTC
Created attachment 577239 [details]
Translation to be pushed with pushTrans

Comment 5 Carlos Munoz 2012-04-18 03:41:03 UTC
Changed the way the PO file reader determines the state of a translation unit based on its content(s).

See:
https://github.com/zanata/zanata/commit/54df7f5c29b121cbb39ceb6c58ac2e6ba405080b

Comment 6 Sean Flanigan 2012-04-19 04:28:42 UTC
This should be fixed now, but note bug 814006 concerning plural forms and invalid PO files.

Comment 7 Joyce Chang 2012-05-02 05:17:01 UTC
verified with maven client 1.6.0-alpha-3-SNAPSHOT