jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Halvdan Hoem Grelland (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-1015) BlobStore.putBlob throws RuntimeException with filesystem provider on localized Windows
Date Fri, 16 Oct 2015 10:17:06 GMT

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

Halvdan Hoem Grelland commented on JCLOUDS-1015:

[~gaul] Here's the stack trace (I've snipped out the irrelevant parts).

java.lang.RuntimeException: java.nio.file.attribute.UserPrincipalNotFoundException
        at org.jclouds.filesystem.strategy.internal.FilesystemStorageStrategyImpl.setBlobAccess(FilesystemStorageStrateg
        at org.jclouds.filesystem.strategy.internal.FilesystemStorageStrategyImpl.putBlob(FilesystemStorageStrategyImpl.
        at org.jclouds.blobstore.config.LocalBlobStore.putBlob(LocalBlobStore.java:487)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
        at com.sun.proxy.$Proxy116.putBlob(Unknown Source)

... snipped ...

Caused by: java.nio.file.attribute.UserPrincipalNotFoundException
        at sun.nio.fs.WindowsUserPrincipals.lookup(WindowsUserPrincipals.java:147)
        at sun.nio.fs.WindowsFileSystem$LookupService$1.lookupPrincipalByName(WindowsFileSystem.java:270)
        at org.jclouds.filesystem.util.Utils.setPrivate(Utils.java:83)
        at org.jclouds.filesystem.strategy.internal.FilesystemStorageStrategyImpl.setBlobAccess(FilesystemStorageStrateg
        ... 20 more

As you can see it's not File per se throwing errors but the lookup UserPrincipalLookupService
(which is part of NIO.2 as far as I can tell). The call fails within setPublic and setPrivate
which are both trying to set the Windows ACL permissions for the file being stored on the
Everyone group.

I did try to investigate a solution, but as far as my limited knowledge on the subject can
take me I can't seem to find a solution. I'll sniff around some more, but hope someone with
deeper understanding of the File APIs and Windows in particular could have a look as well.

> BlobStore.putBlob throws RuntimeException with filesystem provider on localized Windows
> ---------------------------------------------------------------------------------------
>                 Key: JCLOUDS-1015
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1015
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 1.9.1
>         Environment: Microsoft Windows (tested on 7 and 10), Java 7 and 8.
>            Reporter: Halvdan Hoem Grelland
>            Assignee: Zack Shoylev
>            Priority: Minor
>              Labels: filesystem, windows
> When using the filesystem provider on a localized Windows system putBlob consistenly
throws a RuntimeException. The put operation does succeed, however, meaning a viable workaround
is to catch-and-ignore.
> The cause of the Exception is a UserPrincipalNotFoundException which is thrown in org.jclouds.filesystem.util.Utils
while trying to resolve the Windows 'Everyone' user group using UserPrincipalLookupService.lookupPrincipalByName.
> Turns out the 'Everyone' group/user is only actually available on Windows systems set
to an English locale, whilst other locales will likely have localized names for the group
(tested on Norwegian Windows in which the Everyone group is known as "Alle").
> The only ubiquitous reference to any of the built-in groups or users on a Windows system
are the SIDs. For example, 'Everyone' is known as 'S-1-1-0'. 
> Unfortunately, the API exposed in java.nio.file doesn't accept SIDs for lookup, meaning
there is, as far as I can tell, no pure Java solution to resolving the UserPrincipal without
knowing the (localized) name.

This message was sent by Atlassian JIRA

View raw message