Bug 1009779

Summary: zanata-cli should show the filename of corrupted file
Product: [Retired] Zanata Reporter: Ding-Yi Chen <dchen>
Component: Component-zanata-clientAssignee: David Mason <damason>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-31 01:24:07 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:
Attachments:
Description Flags
Sample files that trigger this bug none

Description Ding-Yi Chen 2013-09-19 07:26:59 UTC
Created attachment 799758 [details]
Sample files that trigger this bug

Description of problem:
When encounter a corrupted file, zanata failed to show the filename.
Moreover, the error message is so misleading that user have no way to find the actual corrupted file.

For example, the project looks like:
pot/About_Fedora.pot
de/About_Fedora.po
ja/About_Fedora.po

Suppose ja/About_Fedora.po is corrupted, pushing this project you will get:

[INFO] Pushing target doc [name=About_Fedora size=24 client-locale=de] to server [locale=de]
Done in 4 secs
[ERROR] Execution failed:
java.lang.RuntimeException: Operation failed.

    To retry from the last document, please set the following option(s):

        --from-doc "About_Fedora"

.
        at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:459)
        at org.zanata.client.commands.push.PushCommand.run(PushCommand.java:207)
        at org.zanata.client.commands.ArgsUtil.runCommand(ArgsUtil.java:56)
        at org.zanata.client.ZanataClient.processArgs(ZanataClient.java:164)
        at org.zanata.client.ZanataClient.main(ZanataClient.java:90)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

It does not show any thing that ja/About_Fedora.po is corrupted.

Version-Release number of selected component (if applicable):
zanata-cli-3.1.2

How reproducible:
Always

Steps to Reproduce:
1. Download and extract the attached file.
2. cd AboutFedora
3. Create project: AboutFedora and version: f13
4. zanata-cli -B  -e  push -s pot -t . --push-type both


Actual results:
[INFO] pushing source doc [name=About_Fedora size=24] to server
Done in 4 secs
[INFO] Pushing target doc [name=About_Fedora size=24 client-locale=de] to server [locale=de]
Done in 4 secs
[ERROR] Execution failed:
java.lang.RuntimeException: Operation failed.

    To retry from the last document, please set the following option(s):

        --from-doc "About_Fedora"

.
        at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:459)
        at org.zanata.client.commands.push.PushCommand.run(PushCommand.java:207)
        at org.zanata.client.commands.ArgsUtil.runCommand(ArgsUtil.java:56)
        at org.zanata.client.ZanataClient.processArgs(ZanataClient.java:164)
        at org.zanata.client.ZanataClient.main(ZanataClient.java:90)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1



Expected results:
Fail to read ja/About_Fedora.po

Additional info:

Comment 1 Zanata Migrator 2015-07-31 01:24:07 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-483