Bug 1112205 - Unable to push the POT file beginning from the underscore (_) in the filename
Summary: Unable to push the POT file beginning from the underscore (_) in the filename
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Maven
Version: client-3.3
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ---
: client-3.4
Assignee: Patrick Huang
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-23 10:40 UTC by Akira TAGOH
Modified: 2015-07-31 01:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-31 01:43:57 UTC
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.