Elasticsearch: plugin install using absolute file path on Windows requires three protocol slashses

Created on 4 May 2016  路  5Comments  路  Source: elastic/elasticsearch

Elasticsearch version: 2.3.2

JVM version: 1.8.0_u45

OS version: Windows 7 and Windows 10

Description of the problem including expected versus actual behavior:
The plugin install using a URL with absolute file path on Windows requires use of three slashes in the protocol file:///C:\ as opposed to file://C:\.

Provide logs (if relevant):

Here where proper file URL format is used, plugin is not installed.

C:\Users\IEUser\Downloads\elasticsearch-2.3.2>bin\plugin.bat install file://C:\Users\IEuser\Downloads\license-2.3.2.zip
-> Installing from file://C:/Users/IEuser/Downloads/license-2.3.2.zip...
Plugins directory [C:\Users\IEUser\Downloads\elasticsearch-2.3.2\plugins] does not exist. Creating...
Trying file://C:/Users/IEuser/Downloads/license-2.3.2.zip ...
Failed: UnknownHostException[C]
ERROR: failed to download out of all possible locations..., use --verbose to get detailed information

Here where three slashes in the URL is required:

C:\Users\IEUser\Downloads\elasticsearch-2.3.2>bin\plugin.bat install file:///C:\Users\IEuser\Downloads\license-2.3.2.zip

-> Installing from file:/C:/Users/IEuser/Downloads/license-2.3.2.zip...
Trying file:/C:/Users/IEuser/Downloads/license-2.3.2.zip ...
Downloading .DONE
Verifying file:/C:/Users/IEuser/Downloads/license-2.3.2.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed license into C:\Users\IEUser\Downloads\elasticsearch-2.3.2\plugins\license

Most helpful comment

Three slashes is actually the proper syntax for Windows

It's not just Windows. It's all file URIs. Some parsers will handle file://path but they are not supposed to as that is invalid per the RFC.

All 5 comments

Three slashes is actually the proper syntax for Windows. See https://blogs.msdn.microsoft.com/ie/2006/12/06/file-uris-in-windows/

This is how file URIs are specified. A file URI is of the form file://host/path so you can say file://localhost/path or file:///path to also indicate localhost if the host part is omitted (as per RFC 1738 3.10).

This is why you see Failed: UnknownHostException[C] in the logs; with two slashes the C: is being interpreted as hostname.

Three slashes is actually the proper syntax for Windows

It's not just Windows. It's all file URIs. Some parsers will handle file://path but they are not supposed to as that is invalid per the RFC.

It looks like I need to file in Kibana instead then, as it fails if three slashes are used but succeeds if two are used.

It looks like I need to file in Kibana instead then, as it fails if three slashes are used but succeeds if two are used.

That's a paddlin'.

Was this page helpful?
0 / 5 - 0 ratings