Issue 62229 - Cannot acccess any resources via AFP
Summary: Cannot acccess any resources via AFP
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 2.0
Hardware: Mac Mac OS X, all
: P3 Trivial (vote)
Target Milestone: OOo 2.1
Assignee: obrmac
QA Contact: issues@framework
URL:
Keywords:
: 60804 (view as issue list)
Depends on: 16228
Blocks: 29284 61865 67331 71255
  Show dependency tree
 
Reported: 2006-02-17 21:26 UTC by net_buoy
Modified: 2007-02-05 13:33 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Use Advisory Locks instead of Byte Range Locking (2.01 KB, patch)
2006-03-19 20:42 UTC, nospam4obr
no flags Details | Diff
This patch allows to open and lock a file on an AFP share. (2.57 KB, patch)
2006-10-29 11:56 UTC, obrmac
no flags Details | Diff
New version of previous patch which adjust's the comment and does not generally change the lock flag to O_SHLOCK. Thanks to Pavel and Mox for their reviews. (2.57 KB, patch)
2006-10-29 13:29 UTC, obrmac
no flags Details | Diff
Replacing previous fix, which did not work as expected (2.57 KB, patch)
2006-11-14 00:32 UTC, obrmac
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description net_buoy 2006-02-17 21:26:01 UTC
Any attempt to access any resource via AFP fails.  This is especially problematic apparently when a user's 
home directory is remotely mounted,  which is now a fairly typical configuration being promoted by Apple. 
If you do attempt to save a file remotely you will get an error message and will create a file of zero bytes 
on the remote resource.  You can view a remote file you wish to access,  but the attempt  to open it will 
result in the same error.   I am aware that there are quite a number of issues concerning AFP access of 
resources simply inherent in AFP (it is not uncommon to be unable to open on a local host as user X a 
remote file owned by User Y files, even where one has authenticated to the server as user Y),  but I am 
advised that this problem arises even where Apples WGM has been used and users are authenticated as 
the same user owning the resource in question.  It has also been suggested to me that this is related to an 
nfslock problem and there has been some discussion of the problem as OOo users who have downloaded 
the OS X port  of OOo 2.x have complained of these isssues on the pertinent forums.
Comment 1 net_buoy 2006-02-19 03:43:52 UTC
This should apparently be assign to ericb or fheckl
Comment 2 pavel 2006-02-19 08:54:40 UTC
Some information about AFP (Apple Filing Protocol) can be found at

http://developer.apple.com/documentation/Networking/Conceptual/AFP/index.html

If I understand it correctly it could be reproduced only with two Macs
interconnected and some volume shared over AFP which I unfortunately do not have.

We probably do not detect AFP specific error code or user rights correctly or
something similar.
Comment 3 fipa 2006-02-19 09:44:24 UTC
I can confirm this on two machines running MacOS X 10.4.5 and OpenOffice.org 2.0.2 RC1. Cannot save/
open file on AFP.

OO.o says: General input/output error.
Comment 4 net_buoy 2006-02-19 18:30:47 UTC
1) This is an issue with AFP,  and arguably not with the Mac hardware platform
or OS,  so the issue should be replicatable between and two nodes in which Node
A is accessing data over AFP that is shared by Node B.  
2) I do have a linux server up and running that has  AFP running on it and I
endeavor to replicate this error Tuesday where one or both nodes are not Macs
and are not running OS X so as to confirm this.
3) The NeoOffice people apparently had a pretty good idea where the problem
exists and how to fix the problem. 
Comment 5 net_buoy 2006-02-19 18:38:31 UTC
There is a recently posted (Feb. 6, 2006) suggestion at:
http://www.oooforum.org/forum/viewtopic.phtml?t=31367&highlight=afp
which argues:
*************************
Solved! Here's a tip I found in another forum:
Comment out two lines in the soffice file.
Right or control click on the application and select Show Package Contents.
Double click on Contents and again on openoffice.org2.0. Double click on the
program folder and open the file soffice using TextEdit or some other plain text
editor.
Add comments (#) to the lines which enable file locking so they appear as below.

# file locking now enabled by default
#SAL_ENABLE_FILE_LOCKING=1
#export SAL_ENABLE_FILE_LOCKING

Save the changes and start OOo. Everything should work as expected. 
***************************
I saw other comments which suggested that this was not a solution including the
statements on the OpenOffice Mac support forum (which is at trinity, not at
oooforum.)

Of course, turning off file locking does not solve the problem,  it just means
you can now corrupt the subject file ;=}

WHile this may be a workaround for short term,  I don;t think its a good diea to
have all Mac users turning off file locking in ordfer to be able to use OOo
Comment 6 net_buoy 2006-02-19 19:06:35 UTC
This thread:
http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=1947
disappeared for a bit asI think it was moved so I could not cite it earlier.....

Here is another cites to that forum:
http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=1928

Comment 7 eric.bachard 2006-02-20 08:35:57 UTC
ericb->net_buoy

Thank you for reporting this bug. I already have answered on ac@porting mailing list, and we will try to 
find a solution.

ericb->molcanf

With your report, status changed to new

Have you the possibility to test with last 2.0.rc1 please ?  nfslockroblem is included inside, and should 
solve this problem. If not, I'll ask nfslockproblem owner.




Comment 8 nospam4obr 2006-03-19 20:42:08 UTC
Created attachment 35037 [details]
Use Advisory Locks instead of Byte Range Locking
Comment 9 nospam4obr 2006-03-19 20:48:58 UTC
The patch changes the locking method from Byte Range Locking to Advisory
Locking, which is what Apple recomments for MacOS X Applications using the BSD
subsystem in http://developer.apple.com/technotes/tn/tn2037.html. 

BSD Advisory Locking seem to be fully sufficient for OOo's purpose, so it
probabl make sense to check other platforms for O_EXLOCK support as well.

Works fine for me with afp/smb.

BTW: Byte Range Locking seems not even to be implemented for afp/smb (ENOTSUP).

Comment 10 moxfox 2006-03-20 19:56:14 UTC
obr: ha! seems you have found the real fix for the locking problems. The code
that Patrick donated was checking against ENOTSUP and then ignoring it. So
Patricks patch was fixing a symptom, not the real issue.

Excellent, now just lot's of testing :)
Comment 11 net_buoy 2006-03-26 22:20:23 UTC
Is there a patched build we can test.  I am not clear on what happens now....
Comment 12 nospam4obr 2006-04-03 19:37:47 UTC
I am going to integrate the patch to CWS macosx20xfixes02 for 2.0.3 - it will
most likely show up in 2.0.2 rc5 as well.
Comment 13 nospam4obr 2006-04-03 19:49:26 UTC
Patch commited in CWS macosx20xfixes02.
Comment 14 nospam4obr 2006-04-22 19:36:32 UTC
@tra : can you please verify this issue, so that we finally can integrate
macosx20xfixes02 ? TIA.
Comment 15 eric.bachard 2006-04-22 21:01:43 UTC
Issue verified fixed

System : local network, with 2 machines 

Machine 1 : Mac Intel : 192.168.0.1

Machine 2 : Powerbook  192.168.0.2

(machine2) : Using System preferences -> Mac file sharing -> enable

Result : it's written : other user MacIntosh can access your computer using AFP://192.168.0.2

The remote Volume must be mounted using the finder ( Go -> connect to server , and choose 
machine2 )


Process used for tests : 

File : accented_chars.sxw , located on machine2

from machine1, opening accented_chars : R/W ok, no error -> AFP works.

On machine2, opening accented_chars.sxw , already open on machine2 : read only access

Little limitation : accented_chars.sxw can be modified, and changes saves only if not open (read only) 
on machine2




Comment 16 nospam4obr 2006-07-13 19:19:15 UTC
.
Comment 17 nospam4obr 2006-07-13 19:24:38 UTC
*** Issue 60804 has been marked as a duplicate of this issue. ***
Comment 18 obrmac 2006-10-20 22:43:03 UTC
Problem is back with MacOS X Tiger: error message " Could not create backup copy". :(
Comment 19 obrmac 2006-10-20 22:48:45 UTC
.
Comment 20 obrmac 2006-10-29 11:56:18 UTC
Created attachment 40137 [details]
This patch allows to open and lock a file on an AFP share.
Comment 21 obrmac 2006-10-29 11:59:01 UTC
Unfortunatly the second patch does not yet resolve the issue of OOo not being able to start from an AFP 
volume. Error message: the component manager is not available :(.
Comment 22 obrmac 2006-10-29 12:29:13 UTC
I have filed issue 70976 for the startup problem on AFP.
Comment 23 moxfox 2006-10-29 13:19:43 UTC
obrmac: Great, the patch looks nice :) Excellent that you added a proper comment
to it.

Just small nit:
The comment should be titled "adjustLockFlags", not "getLockFlags" as it is now.
Comment 24 obrmac 2006-10-29 13:29:22 UTC
Created attachment 40140 [details]
New version of previous patch which adjust's the comment and does not generally change the lock flag to O_SHLOCK. Thanks to Pavel and Mox for their reviews.
Comment 25 obrmac 2006-11-14 00:32:10 UTC
Created attachment 40557 [details]
Replacing previous fix, which did not work as expected
Comment 26 pavel 2006-11-20 14:07:17 UTC
set target to 2.1.
Comment 27 obrmac 2006-11-20 20:54:42 UTC
Fix commited to CWS afplock.
Comment 28 eric.bachard 2006-11-20 21:06:59 UTC
Verified fixed in OOE680_m4

Thanks !
Comment 29 Mathias_Bauer 2007-02-05 13:33:25 UTC
closing ancient issues