cancel
Showing results for 
Search instead for 
Did you mean: 

CIFS server caching problem?

joshaber
Champ on-the-rise
Champ on-the-rise
We've encountered a problem that appears to be with the CIFS server caching stuff.

In our repository, when someone uploads a file that already exists we want to copy the content across with versioning. This works fine usually. But when I upload a file via CIFS and then try to update it, Windows gives me the error that the file already exists (which it does… I want to update it though). If I restart Alfresco and try again, it works fine. To me, that sounds like Alfresco's CIFS server is caching something it shouldn't be and won't forget about that file until I restart.

Anyone have a guess at a solution?
5 REPLIES 5

cpaul
Champ on-the-rise
Champ on-the-rise
I'm actually encountering the same issue, although from a different angle:

When mounting an Alfresco directory into Tomcat via CIFS, I'm able to browse that directory from a web browser, but the file contents are not updated if I make changes to those files in Alfresco. I believe it may have something to do with CIFS caching as well.

Does anyone have any idea how to overcome this issue? Am I completely crazy for thinking this will work?

mrogers
Star Contributor
Star Contributor
What do you mean by "mounting an Alfresco directory into Tomcat via CIFS"?   

Are you using CIFS for the filestore?   Or are you using Alfresco's CIFS interface?  Or something else?

How are you accessing a CIFS directory from a web browser?    What are you looking at?

cpaul
Champ on-the-rise
Champ on-the-rise
Hi Mike,

To answer your questions, let me explain what I'm trying to do. I have another webapp running in Alfresco's Tomcat (say, "mywebapp"), and this app needs to access files in Alfresco. We'd like this access to be direct, rather than using content copied/pushed from Alfresco.

To do this, I turn on CIFS in Alfresco and mount the document library folder on the Alfresco server using "mount.cifs" to /usr/mnt/doclib:

mount.cifs //[SERVER_IP]/alfresco/sites/[SITE_NAME]/documentLibrary/mywebapp_content /usr/mnt/doclib -o user=admin,pass=admin,port=1445,forcedirectio

Then I symbolically link "/usr/mnt/doclib" to "tomcat/webapps/mywebapp/doclib" and turn on symbolic link following in Tomcat's server.xml. This allows me to hit "http://localhost/mywebapp/mywebapp_content" and I can browse the Alfresco folder in a web browser. Now, ultimately, this use case is not the goal, but this allows mywebapp to directly access certain documents in Alfresco.

All of this works great.

The problem is when a file is modified in Alfresco. When I browse to the file in a web browser, it always displays the unmodified version, which leads me to believe that CIFS is caching data. I've cleared the browser cache, so I know it's not the browser. And I've looked into and have seen recommendations to set the "forcedirectio" flag on the mount.cifs command, but this has not helped.

Does this make sense? Any thoughts or recommendations?

EDIT: Note that if I unmount and re-mount the directory, the file contents are updated!

mrogers
Star Contributor
Star Contributor
There won't be caching on alfresco's side, the caching you seem to be experiencing is elsewhere.  And there's an interaction between your app server and cifs client,  I suspect one of those is not quite right.

cpaul
Champ on-the-rise
Champ on-the-rise
Mike, you're right – the caching was being done on Tomcat's side of things.

Once I added
cachingAllowed="false"
to the <Context> tag in my_webapp/META-INF/context.xml, it worked like a charm.

Thanks for your input!