Hide Forgot
Description of problem: mvn client can not handle Project that have spaces Version-Release number of selected component (if applicable): Zanata version 1.3-alpha-1 (20110330-1649). How reproducible: 100% Steps to Reproduce: 1. Create a project called 'Test Publican Project' and its version is 1.0 2. mvn zanata:publican-pull -Dzanata.username=kenichi -Dzanata.key=0cd462bd76943ca3f5abae0f9b27d0d2 -Dzanata.dstDir=dest Actual results: Embedded error: java.net.URISyntaxException: Illegal character in path at index 52: http://10.64.12.214:8080/zanata/rest/projects/p/Test Publican Project/iterations/i/1.0/r Expected results: Normal output. Additional info:
... https://bugzilla.redhat.com/show_bug.cgi?id=701525#c1 should be put in here.
Quoting the above-mentioned comment: -------------------------------------------------------------------- I have changed project name to 'Test_publican_project' replacinf ' ' by '_' but the command still produces the same error. mysql> select * from HProject; | iteration | 2 | 2011-05-03 01:16:15 | 2011-05-03 05:04:12 | 4 | tpp1 | Test_publican_project | test__ | Test_publican_project | 0 | +-------------+----+---------------------+---------------------+------------+------+------------------------------------------+--------------------------------------------+------------------------------------------+-----------------+ 2 rows in set (0.00 sec) -------------------------------------------------------------------- Kenichi, what's the exact error message now that you've changed the ID of the project? I assume the URI doesn't still have a space in it? Did you manage to create a project with a space in the ID? We have validation to prevent that. If it's just the name that has a space, make sure you're not using the project name in your zanata.xml. zanata.xml should contain the project ID, not the name. If you're still having trouble, please attach your zanata.xml.
Thanks for your comment. Yes my mistake. I set project name in zanata.xml I re-tried using project id and it worked. But again error message is not kind enough to tell user regarding troubleshooting. If you specify wrong project id without spaces it says Embedded error: operation returned 404 (Not Found): Project Iteration 'tpp11:1.0' not found. This is better but with spaces it says Embedded error: java.net.URISyntaxException: Illegal character in path at index 49: This confuses user and looks like a system error. Please correct error message.
The client should probably escape any IDs which are used to build URIs. (Alternatively, it could try to validate the IDs, but it will be tricky keeping the client-side validation in sync with the server-side validation if we ever change the rules. URI escaping should guarantee legal URIs, and when the ID is valid, escaping shouldn't change anything.)
Assigning to Scrum product owner for prioritisation.
Solution: will catch URISyntaxException and produce a more meaningful error message. Committed in master: https://github.com/zanata/zanata-client/commit/76308576a1274917b41f0ab69816c7217107bc6d
verified with maven client 1.6.0-alpha-3-SNAPSHOT
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Consequence Error message is not meaningful for end user. Fix A more detailed error message is displayed. Result When user has inadvertently put in space into project ID field (either in zanata.xml or given as command line argument), a more meaningful error message is displayed.