x-isi-ifs-copy-source encoding

95 views
Skip to first unread message

Joe Bond

unread,
Jun 4, 2020, 5:12:47 PM6/4/20
to Isilon Technical User Group
Hi folks!

Trying to use the isilon copy api and am having problems copying a file with a Greek character μ in the name. Any idea what the encoding would be for the isilon x-isi-ifs-copy-source Header?

Thanks!

Peter Serocka

unread,
Jun 5, 2020, 4:51:26 AM6/5/20
to 'Adam Fox' via Isilon Technical User Group
Have you tried percent encoding aka URL encoding?
> --
> You received this message because you are subscribed to the Google Groups "Isilon Technical User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isilon-user-gr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/isilon-user-group/cf1a6ec3-c66c-49e7-aefa-57ab2e2cbd35o%40googlegroups.com.
>

Joe Bond

unread,
Jun 5, 2020, 10:47:17 AM6/5/20
to isilon-u...@googlegroups.com
Here's a bit more information.  Tried url encoding the data and that doesn't work.  



curl --location --request PUT 'https://[host_port_namespace_path]/test/copy3.pdf' \
--header 'x-isi-ifs-copy-source: /path/with spaces/works/B177I- 10%B5m SunFire Prep, TN.pdf' \
--header 'Authorization: Basic [basic_creds]' \
--data-raw ''

{
    "errors": [
        {
            "code": "AEC_BAD_REQUEST",
            "message": "x-isi-ifs-copy-source '/path/with spaces/works/B177I- 10%B5m SunFire Prep, TN.pdf' is invalid."
        }
    ]
}



curl --location --request PUT 'https://[host_port_namespace_path]/test/copy3.pdf' \
--header 'x-isi-ifs-copy-source: /path/with spaces/works/test- 10µm file andacomma, test.pdf' \
--header 'Authorization: Basic [basic_creds]' \
--data-raw ''



{
    "errors": [
        {
            "code": "AEC_BAD_REQUEST",
            "message": "x-isi-ifs-copy-source '/path/with spaces/works/B177I- 10�m SunFire Prep, TN.pdf' is invalid."
        }
    ]
}

mandar kolhe

unread,
Jun 5, 2020, 12:48:23 PM6/5/20
to Isilon Technical User Group
Hello Joe, can you list that file using curl command ? and see how does that file look ? And may be use that path while copying ?


On Friday, June 5, 2020 at 8:17:17 PM UTC+5:30, Joe Bond wrote:
Here's a bit more information.  Tried url encoding the data and that doesn't work.  



curl --location --request PUT 'https://[host_port_namespace_path]/test/copy3.pdf' \
--header 'x-isi-ifs-copy-source: /path/with spaces/works/B177I- 10%B5m SunFire Prep, TN.pdf' \
--header 'Authorization: Basic [basic_creds]' \
--data-raw ''

{
    "errors": [
        {
            "code": "AEC_BAD_REQUEST",
            "message": "x-isi-ifs-copy-source '/path/with spaces/works/B177I- 10%B5m SunFire Prep, TN.pdf' is invalid."
        }
    ]
}



curl --location --request PUT 'https://[host_port_namespace_path]/test/copy3.pdf' \
--header 'x-isi-ifs-copy-source: /path/with spaces/works/test- 10µm file andacomma, test.pdf' \
--header 'Authorization: Basic [basic_creds]' \
--data-raw ''



{
    "errors": [
        {
            "code": "AEC_BAD_REQUEST",
            "message": "x-isi-ifs-copy-source '/path/with spaces/works/B177I- 10�m SunFire Prep, TN.pdf' is invalid."
        }
    ]
}

On Fri, Jun 5, 2020 at 4:51 AM Peter Serocka <pese...@gmail.com> wrote:
Have you tried percent encoding aka URL encoding?


> On Jun 4, 2020, at 23:12, Joe Bond <imjo...@gmail.com> wrote:
>
> Hi folks!
>
> Trying to use the isilon copy api and am having problems copying a file with a Greek character μ in the name.  Any idea what the encoding would be for the isilon  x-isi-ifs-copy-source Header?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "Isilon Technical User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isilon-u...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/isilon-user-group/cf1a6ec3-c66c-49e7-aefa-57ab2e2cbd35o%40googlegroups.com.
>

--
You received this message because you are subscribed to the Google Groups "Isilon Technical User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isilon-u...@googlegroups.com.

Peter Serocka

unread,
Jun 5, 2020, 1:16:56 PM6/5/20
to 'Adam Fox' via Isilon Technical User Group
The error message looks suspicious...

If we just mis-encoded the filename somehow, but have everything else in place correctly,
we should get something like:

"code" : "AEC_NOT_FOUND",
"message" : "Unable to open object '/data/src-name-with-greek-µ' in store 'ifs' -- not found."

However, you get an AEC_BAD_REQUEST error,
which I can reproduce here only with a malformed path in the source header:

--header 'x-isi-ifs-copy-source: /ifs/data/src-name-with-greek-µ'

Everything works fine here when adding /namespace (verbatim):

--header 'x-isi-ifs-copy-source:  /namespace/ifs/data/src-name-with-greek-µ'

even without any explicit encoding ;)

So your '/path/with spaces/' should start with a literal '/namespace'.

If it does already, and copying works well with other files, then it would be
a mystery why introducing a greek µ produces an AEC_BAD_REQUEST error
rather than AEC_NOT_FOUND, and I'd recommend hand-crafting more examples,
both working and non-working ones.





Joe Bond

unread,
Jun 8, 2020, 6:19:37 PM6/8/20
to isilon-u...@googlegroups.com
You are right that I forgot /namespace on the copy source header.  I did that cleaning up the data to post on here.  Here is the content when I list the file out.

{
"children": [
{
"change_time": "Mon, 08 Jun 2020 22:07:11 GMT",
"container_path": "/ifs/data/path_to_data/testing",
"create_time": "Mon, 08 Jun 2020 22:07:11 GMT",
"id": 4490405054,
"last_modified": "Mon, 25 Feb 2013 22:36:15 GMT",
"name": "10µm.pdf",
"size": 44094,
"type": "object"
}
]
}

curl --location --request PUT 'https://mysilon:8080/namespace/ifs/data/some_dir/copy3.csv' \
--header 'x-isi-ifs-copy-source: /namespace/ifs/data/path_to_data/testing/10µm.pdf' \
--header 'Authorization: Basic <my_basic_creds>' \
--data-raw ''

fails with 
{
"errors": [
{
"code": "AEC_NOT_FOUND",
"message": "Unable to open object '/data/path_to_data/testing/10▒m.pdf' in store 'ifs' -- not found."
}
]
}
 

John Beranek - PA

unread,
Jun 10, 2020, 6:44:59 PM6/10/20
to Isilon Technical User Group
I can confirm this works for me too, from a Linux server to an 8.1.2 test system:

$ curl --location --request PUT https://pool.isilon.example.com:8080/namespace/whatever/with-greek-µ.txt.copy2 --header 'x-isi-ifs-copy-source: /namespace/whatever/with-greek-µ.txt' -u john --data-raw ''
Enter host password for user 'john':

and so far as if I try the same again, I get:

$ curl --location --request PUT https://pool.isilon.example.com:8080/namespace/whatever/with-greek-µ.txt.copy2 --header 'x-isi-ifs-copy-source: /namespace/whatever/with-greek-µ.txt' -u john --data-raw ''
Enter host password for user 'john':
{"copy_errors":[{
   "error_src" : "target side",
   "message" : "target exists(not copied)",
   "source" : "/whatever/with-greek-µ.txt",
   "target" : "/whatever/with-greek-µ.txt.copy2"
}
],"success":false}%


From what I can tell curl is just sending the µ verbatim in UTF-8.

$ echo $LANG
en_GB.UTF-8

Cheers,

John
> To unsubscribe from this group and stop receiving emails from it, send an email to isilon-u...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/isilon-user-group/cf1a6ec3-c66c-49e7-aefa-57ab2e2cbd35o%40googlegroups.com.
>

--
You received this message because you are subscribed to the Google Groups "Isilon Technical User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isilon-u...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Isilon Technical User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isilon-u...@googlegroups.com.

John Beranek - PA

unread,
Jun 10, 2020, 6:49:25 PM6/10/20
to Isilon Technical User Group
In fact, this is what the Apache logs show:

isilon-3: 2020-06-10T23:37:48+01:00 <19.6> isilon-3 httpd: 10.11.12.13 - john [10/Jun/2020:23:37:48 +0100] "PUT /namespace/whatever/with-greek-\xc2\xb5.txt.copy2 HTTP/1.1" 200 211 "-" "curl/7.69.1"

John
Reply all
Reply to author
Forward
0 new messages