Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1112205

Summary: Unable to push the POT file beginning from the underscore (_) in the filename
Product: [Retired] Zanata Reporter: Akira TAGOH <tagoh>
Component: Component-MavenAssignee: Patrick Huang <pahuang>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: high Docs Contact:
Priority: urgent    
Version: client-3.3CC: damason, dchen, pahuang, zanata-bugs
Target Milestone: ---   
Target Release: client-3.4   
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:43:57 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:

Description Akira TAGOH 2014-06-23 10:40:50 UTC
Description of problem:
When the POT filename is beginning from the underscore, such as _Exit.2.pot, zanata-cli always fails due to:
[main] ERROR org.zanata.client.commands.push.PushCommand - Operation failed: Error status 404 Not Found returned

Version-Release number of selected component (if applicable):
zanata-client-3.3.2-2.fc21.noarch

How reproducible:
always

Steps to Reproduce:
1.push the pot file to the server
2.
3.

Actual results:
the above error happens.

Expected results:
no error

Additional info:

Comment 1 Ding-Yi Chen 2014-06-24 04:25:17 UTC
This can also be reproduced with 

Server: Zanata 3.4.2-SNAPSHOT (git-server-3.4.1-47-g88e8fe3) 
Client: zanata-maven-plugin:3.3.2:push
client API version: 3.3.1, server API version: 3.3.1

Project type: gettext
Filename: libstdc++-v3/po/libstdc++.pot (gcc-4.9.0)

Comment 2 David Mason 2014-08-06 01:39:45 UTC
This has something to do with RESTEasy paths, and there would probably be similar issues with some other characters such as commas. The problem stems from the use of filenames as part of a URL: the rules for what can be in a URL are a lot more stringent than for what can be in a filename.

Proposed fix: Make filenames a query parameter with escaping. This would get around this and all other issues with RESTEasy's handling of different characters. This would require deprecating the current REST endpoint and implementing a new endpoint with the filename as a query parameter.

Comment 3 Patrick Huang 2014-08-28 00:10:00 UTC
A workaround exists:
Add command hook to zanata.xml to rename the file before push and back again after pull.
Example (not tested only in theory)
<hooks>
  <hook command="push">
    <before>mv _Exit.2.pot Exit.2.pot</before>
    <after>mv Exit.2.pot _Exit.2.pot</after>
  </hook>
  <hook command="pull">
    <!-- assuming this is a gettext project. For podir it will be different -->
    <!-- need to rename all locales but here just use ja as one example -->
    <after>mv Exit_ja.po _Exit_ja.po</after>
  </hook>
</hooks>

Comment 4 Zanata Migrator 2015-07-31 01:43:57 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-519