Chunk split failed when pushing big files (more than 1MiB)

Description

Created attachment 1024073
Step 5 server.log

Description of problem:
If file is more than 1MiB, the client will split files into chunks.
However, the push then failed when
1) --chunk-size was not specified
2) files are bigger than what chunk specified.

Version-Release number of selected component (if applicable):
Zanata 3.7.0-SNAPSHOT (git-server-3.6.2-244-g5ba88b1)
Client: 3.7.0-SNAPSHOT (commit 62aa4858eb8a391540f217b27b5da52c0d2a77da)

How reproducible:
Always

Steps to Reproduce:
1. Clone the Spacework project:
git clone https://github.com/spacewalkproject/spacewalk.git/

2. Set up project spacework, version master
3. Download the attached zanata.xml, and change the <url> to fit your environment
4. Run
zanata-cli -e push --file-types "GETTEXT,XLIFF" --copy-trans false
5. Run
zanata-cli -e push --file-types "GETTEXT,XLIFF" --copy-trans false --chunk-size 500000

Actual results:
Step 4. Failed with error as shown in
https://github.com/zanata/zanata-client/pull/57#issuecomment-99774102

Step 5. Failed with:

[INFO] pushing chunk 1 of 3
Done in 0 secs
[INFO] pushing chunk 2 of 3
[== ][ERROR] Operation failed: POST http://zanata.server:8080/zanata/rest/file/source/spacewalk/master?docId=java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource.xml returned a response status of 500 Internal Server Error
To retry from the last document, please add the option: --from-doc "java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource.xml"
[ERROR] Execution failed:
java.lang.RuntimeException: POST http://zanata.server:8080/zanata/rest/file/source/spacewalk/master?docId=java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource.xml returned a response status of 500 Internal Server Error
at org.zanata.client.commands.push.RawPushCommand.run(RawPushCommand.java:401)
at org.zanata.client.commands.ConfigurableCommand.runWithActions(ConfigurableCommand.java:110)
at org.zanata.client.commands.ArgsUtil.runCommand(ArgsUtil.java:48)
at org.zanata.client.ZanataClient.processArgs(ZanataClient.java:170)
at org.zanata.client.ZanataClient.main(ZanataClient.java:95)
Caused by: com.sun.jersey.api.client.UniformInterfaceException: POST http://zanata.server:8080/zanata/rest/file/source/spacewalk/master?docId=java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource.xml returned a response status of 500 Internal Server Error

Expected results:
Both case work

Additional info:

Environment

None

Status

Assignee

Alex Eng

Reporter

Ding-Yi Chen

Labels

None

Tested Version/s

None

Components

Sprint

None

Fix versions

Priority

unspecified
Configure