cancel
Showing results for 
Search instead for 
Did you mean: 

NFS Authentication NullPointerException

jmharris
Champ in-the-making
Champ in-the-making
Using Alfresco 3.2r (Tomcat bundle). Setting up NFS mount as per instructions.

Config is:

   <bean id="nfsServerConfig" class="org.alfresco.filesys.config.NFSConfigBean">
      <property name="serverEnabled">                                          
         <value>${nfs.enabled}</value>                                         
      </property>                                                              
      <property name="NFSServerPort"><value>12049</value></property>           
      <property name="mountServerPort"><value>1678</value></property>          

      <property name="debugFlags"><value>RxData,Search,Info,File,FileIO,Error,Directory,Timing,Session</value></property>
      <property name="portMapperDebug"><value>true</value></property>                                                   
      <property name="mountServerDebug"><value>true</value></property>                                                  

      <!– Map NFS user/group ids to Alfresco users –>
      <property name="rpcAuthenticator">              
         <bean class="org.alfresco.filesys.auth.nfs.AlfrescoRpcAuthenticator">
            <property name="userMappings">                                   
               <ref bean="nfs.user.mappings" />                              
            </property>                                                      
         </bean>                                                             
      </property>                                                            
   </bean>

Attempting to mount via:

exe-201:~# mount -v -o port=12049,mountport=1678,udp localhost:/alfresco /mnt/alfresco
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: internal error

Get a NullPointerException in the Alfresco debug.

13:21:52,994  DEBUG [nfs.protocol.auth] RpcAuth: Type=Unix uid=0, gid=0
13:21:52,994  DEBUG [nfs.protocol.auth] RpcAuth: RPC from U127.0.0.1:731, authType=Unix, sessKey=9151314447111815168
13:21:52,994  DEBUG [nfs.protocol.auth] RpcClientInfo: username=admin, uid=0, gid=0
13:21:52,994  DEBUG [nfs.protocol.auth] RpcAuth: Client info, type=Unix, name=exe-201, uid=0, gid=0, groups=1
13:21:52,994  DEBUG [org.alfresco.fileserver] [Mount] Mount request from U127.0.0.1:731 path=/alfresco
13:21:52,995  DEBUG [org.alfresco.fileserver] MountPath path=/alfresco
13:21:52,995  DEBUG [org.alfresco.fileserver] Mounted path=/alfresco, handle=[Share:0x65d1d071]
13:21:52,996  DEBUG [nfs.protocol.auth] RpcAuth: Type=Null client=/127.0.0.1
13:21:52,996  DEBUG [nfs.protocol.auth] RpcAuth: RPC from U127.0.0.1:1001, authType=Null, sessKey=2130706433
13:21:52,996  DEBUG [org.alfresco.fileserver] [NFS] Found session org.alfresco.jlan.oncrpc.nfs.NFSSrvSession@956740
13:21:52,996  DEBUG [org.alfresco.fileserver] [NFS] RPC Authencation Exception: java.lang.NullPointerException

Am I obviously doing something wrong or is this just a bug?
9 REPLIES 9

mrogers
Star Contributor
Star Contributor
That does not look like 3.2 configuration.

What file is your "nfsServerConfig" bean from?

jmharris
Champ in-the-making
Champ in-the-making
Hi, thanks for the response.

I have used the self extracting bundle 'Alfresco-Community-3.2r-Linux-x86-Install'.

Those settings are from the file: ~/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/fileServers/default/file-servers-context.xml

I added these lines:

      <property name="NFSServerPort"><value>12049</value></property>           
      <property name="mountServerPort"><value>1678</value></property>          

      <property name="debugFlags"><value>RxData,Search,Info,File,FileIO,Error,Directory,Timing,Session</value></property>
      <property name="portMapperDebug"><value>true</value></property>                                                  
      <property name="mountServerDebug"><value>true</value></property>

And of course I had to switche on nfs.enabled in: ~/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/fileServers/default/file-servers.properties

jmharris
Champ in-the-making
Champ in-the-making
Is it worth me filing this as a bug report? Even if it's a configuration issue something should probably be done about the fact I could not know what was going on without turning on the logger output.

mrogers
Star Contributor
Star Contributor
There's clearly at least one logging required if an exception is being silently swallowed.    

However its never valid to change the files in the WEB-INF folder.    And your "enable.nfs" property should be in your alfresco-global.properties.
Whether that's the cause of your problem I don't know :?

jmharris
Champ in-the-making
Champ in-the-making
I appreciate that settings can be changed elsewhere than WEB-INF but out of the box the only files that contain the nfs.enabled setting are:

    ~/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.properties
    ~/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/fileServers/default/file-servers.properties
So some more guidance/examples are required if something else is meant to be done.

Given that the changes I have made only turn the NFS server on and set its port and I am clearly connecting to it using the mount line, I doubt the way in which the settings have been made is causing a problem.

Of course the problem is I cannot know for sure since NFS is disabled by default in 3.2r and the docs do not show a complete working example (or I've missed it)- has anyone had this working in 3.2r? Presumably there is some acceptance testing prior to release so I can't imagine that this is just broken, but the NullP looks pretty suspect given such a simple configuration.

dward
Champ on-the-rise
Champ on-the-rise
some more guidance/examples are required if something else is meant to be done

See http://wiki.alfresco.com/wiki/File_Server_Subsystem#Configuration_3

Please log this in JIRA if it reproduces using spring overrides as described in the above section.

jmharris
Champ in-the-making
Champ in-the-making
Thanks for the reply, I've done as asked but I don't think that makes much difference to what I'm experiencing. I'll file this as a bug as well, but for the record here is the current situation:

Fresh install, now using Alfresco-Community-3.2r2-Linux-x86-Install.

Settings in ~/Alfresco/tomcat/shared/classes/alfresco-global.properties

nfs.enabled=true
nfs.user.mappings=admin
nfs.user.mappings.value.admin.uid=0
nfs.user.mappings.value.admin.gid=0

Am I right in saying those are ignored once I configure a spring bean extension? It seems so anyway, so-

Settings in ~/Alfresco/tomcat/shared/classes/alfresco/extension/subsystems/fileServers/default/default/custom-file-servers-context.xml

Note I've tried to keep this to the bare minimum needed to start NFS file server only.

<?xml version="1.0" encoding="UTF-8"?>                                                                                                                             
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">                                                            
<beans>                                                                                                                                                           

       <bean id="fileServerConfiguration" class="org.alfresco.filesys.config.ServerConfigurationBean" parent="fileServerConfigurationBase">
          <property name="nfsConfigBean">                                                                                                 
             <ref bean="nfsServerConfig" />                                                                                               
          </property>                                                                                                                     
          <property name="filesystemContexts">                                                                                            
             <ref bean="filesystemContexts" />                                                                                            
          </property>                                                                                                                     
          <property name="securityConfigBean">                                                                                            
             <ref bean="fileSecurityConfig" />                                                                                            
          </property>                                                                                                                     
       </bean>                                                                                                                            

       <!– NFS Server –>

       <bean id="nfsServer" class="org.alfresco.filesys.NFSServerBean" destroy-method="stopServer">
          <constructor-arg>                                                                       
             <ref local="fileServerConfiguration" />                                              
          </constructor-arg>                                                                      
       </bean>                                                                                    

      <!–The configurable RPC user mappings - actually a post-processed composite property! –>
       <bean id="nfs.user.mappings" class="org.springframework.beans.factory.config.ListFactoryBean">
          <property name="sourceList">                                                              
             <list>                                                                                 
                <bean class="org.alfresco.filesys.auth.nfs.UserMapping">                            
                   <property name="beanName">                                                       
                      <value>admin</value>                                                          
                   </property>                                                                      
                   <property name="uid">                                                            
                      <value>0</value>                                                              
                   </property>                                                                      
                   <property name="gid">                                                            
                      <value>0</value>                                                              
                   </property>                                                                      
                </bean>                                                                             
             </list>                                                                                
          </property>                                                                               
       </bean>                                                                                      

  <bean id="nfsServerConfig" class="org.alfresco.filesys.config.NFSConfigBean">
                                                                              
      <property name="serverEnabled"><value>true</value></property>           

      <property name="NFSServerPort"><value>51000</value></property>               

      <property name="debugFlags"><value>RxData,Search,Info,File,FileIO,Error,Directory,Timing,Session</value></property>
      <property name="portMapperDebug"><value>true</value></property>
      <property name="mountServerDebug"><value>true</value></property>

          <!– Map NFS user/group ids to Alfresco users –>
          <property name="rpcAuthenticator">
             <bean class="org.alfresco.filesys.auth.nfs.AlfrescoRpcAuthenticator">
                <property name="userMappings">
                   <ref bean="nfs.user.mappings" />
                </property>
             </bean>
          </property>

  </bean>

        <bean id="filesystemContexts" class="org.springframework.beans.factory.config.ListFactoryBean">
          <property name="sourceList">
             <list>
                <!– Alfresco repository access shared filesystem –>
                <bean class="org.alfresco.filesys.repo.ContentContext">
                   <property name="deviceName">
                      <value>alfresco</value>
                   </property>
                   <property name="storeName">
                      <value>${spaces.store}</value>
                   </property>
                   <property name="rootPath">
                      <value>/${spaces.company_home.childname}</value>
                   </property>
                </bean>
             </list>
          </property>
        </bean>


</beans>

Server details:

    Debian Lenny
    Native Portmap service ON
    Native nfs OFF
No errors while starting Alfresco. It's my understanding with this configuration Alfresco should register the NFS server with the native portmap service.

Hence try to mount the share:

mount -v localhost:/alfresco /mnt/alfresco
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 51000
mount.nfs: mount to NFS server 'localhost' failed: timed out, retrying
mount.nfs: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 51000

… and so on.

So it seems the custom NFS port has been picked up from the portmap service, then something else has gone wrong. The corresponding error log from Alfresco:

13:01:28,593  DEBUG [nfs.protocol.auth] RpcAuth: Type=Null client=/127.0.0.1
13:01:28,595  DEBUG [nfs.protocol.auth] RpcAuth: RPC from T127.0.0.1:60988, authType=Null, sessKey=2130706433
13:01:28,597  DEBUG [nfs.protocol.auth] RpcAuth: Client info, type=Null, addr=127.0.0.1
13:01:28,597  DEBUG [org.alfresco.fileserver] [NFS] Added Null session 2130706433
13:01:28,598  DEBUG [org.alfresco.fileserver] [NFS] Found session org.alfresco.jlan.oncrpc.nfs.NFSSrvSession@1ad9f73
13:01:28,598  DEBUG [org.alfresco.fileserver] [NFS] RPC Authencation Exception: java.lang.NullPointerException

I'm stumped at this point. Several variations of the available config parameters have been tried but it always comes down to this error. Does anyone have a working example of doing this with Alfresco 3.2?

jmharris
Champ in-the-making
Champ in-the-making

dakabali
Champ in-the-making
Champ in-the-making
I confirm the exactly same issue with Alfresco-Community-3.2r on Windows 2003/2008 server with Alfresco's native JLAN NFS Server on the standard port 2049.

New issue is https://issues.alfresco.com/jira/browse/ALFCOM-3684