jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-278) SwiftClient parse exception on '%' symbols
Date Mon, 09 Jun 2014 19:19:02 GMT

    [ https://issues.apache.org/jira/browse/JCLOUDS-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14025587#comment-14025587

ASF subversion and git services commented on JCLOUDS-278:

Commit b1c163636dbf07b360f85f2ca8a3e570e9c494bd in jclouds's branch refs/heads/master from
[ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=b1c1636 ]

Adding a test to check for JCLOUDS-278

Contributed by Bill Branan.

> SwiftClient parse exception on '%' symbols
> ------------------------------------------
>                 Key: JCLOUDS-278
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-278
>             Project: jclouds
>          Issue Type: Bug
>    Affects Versions: 1.5.10, 1.6.2
>         Environment: Tested on:
> org.jclouds:jclouds-allblobstore:1.5.5
> org.apache.jclouds:jclouds-allblobstore:1.6.2-incubating
>            Reporter: Erik Paulsson
>         Attachments: JCLOUDS-278-master.patch
> I've tested this using org.jclouds:jclouds-allblobstore v1.5.5 and 1.6.2-incubating.
 I get a parse exception using the SwiftClient when object names contain a '%' symbol.
> For example an object whose name is 'AND_-_100%_TVX/test.txt' will get stored fine, but
when I attempt to list the contents of the container that the object is in I get the following
> Sep 10, 2013 10:26:40 AM org.jclouds.logging.jdk.JDKLogger logError
> SEVERE: Error parsing input
> java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%)
pattern - For input string: "_T"
>     at java.net.URLDecoder.decode(URLDecoder.java:192)
>     at org.jclouds.util.Strings2.urlDecode(Strings2.java:97)
>     at org.jclouds.http.Uris$UriBuilder.appendPath(Uris.java:157)
>     at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse$3.apply(ParseObjectInfoListFromJsonResponse.java:82)
>     at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse$3.apply(ParseObjectInfoListFromJsonResponse.java:80)
>     at com.google.common.collect.Iterators$9.transform(Iterators.java:893)
>     at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
>     at com.google.common.collect.Sets.newTreeSet(Sets.java:345)
>     at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:79)
>     at org.jclouds.openstack.swift.functions.ParseObjectInfoListFromJsonResponse.apply(ParseObjectInfoListFromJsonResponse.java:54)
>     at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:66)
>     at org.jclouds.http.functions.ParseJson.apply(ParseJson.java:46)
>     at com.google.common.util.concurrent.Futures$3.apply(Futures.java:376)
>     at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:518)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at java.lang.Thread.run(Thread.java:724)
> This may affect more than just the SwiftClient API since it looks like the bug may be
>   org.jclouds.util.Strings2.urlDecode
>   org.jclouds.http.Uris$UriBuilder.appendPath
> Here is an example of a simple method that generates the exception:
> private PageSet<ObjectInfo> listObjects(String containerName,
>                                         String prefix,
>                                         int maxResults,
>                                         String marker) {
>     ListContainerOptions containerOptions = ListContainerOptions.Builder.maxResults(maxResults);
>     if(marker != null) containerOptions.afterMarker(marker);
>     if(prefix != null) containerOptions.withPrefix(prefix);
>     return swiftClient.listObjects(containerName, containerOptions);
> }
> Calling this method with the container name of the container containing the object whose
name contains a '%' symbol and a maxResults of 1000 and null for both prefix and marker will
result in the above exception.
> Let's just say my container name is "percent-container" and I have an object in this
container with the name "AND_-_100%_TVX/test.txt"
> So this is what the method call to the above method might look like:
> listObjects("percent-container", null, 1000, null);
> Even if I URL encode the object name before storing it I still get the same exception
when retrieving a list of contents for the space.
> I can run a cURL command straight to the Swift storage provider to get the object and
it returns fine.
> Am I doing anything wrong?  Do I need to handle '%' symbols in a special way?  The docs
swift docs don't express any character restrictions on object names: http://docs.openstack.org/trunk/openstack-object-storage/admin/content/containers-and-objects.html

This message was sent by Atlassian JIRA

View raw message