Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#51 OpenOffice can't save files over davfs

closed-fixed
nobody
None
5
2014-09-15
2005-10-25
No

Hi everybody.

I have allready told the openoffice crew about the
following bug. I'm not quite sure this an openoffice or a
webdav bug. Here is my problem:

1.) One PC with Windows XP embedded with IIS 5.1
2.) One PC with Linux (Knoppix 3.9, Kernel 2.6.11,
XFree 4.3)
3.) I mount with the Linux PC to the Xp PC over dvfs 2.6
(mount -t davfs
http://192.1681.250/Documents /home/knoppix/Documen
ts)

4.) The mount process works fine. I can create file
change it, read and write it.
5.) Then I start OpenOffice 2.0 (writer or calc) and create
a new File with some simple content.
6.) Then I save the file
7.) I check now the File on the Windows Side. The file
was created but it is empty.
8.) I can open it on the linux site and it is still empty.
9.) Now I save a new File with the same or another
content but with a different extension such as .doc
or .pdf
10.) This works fine. The file is save on the windows
directory.

It seems to me that all Open Documents Formats can't
be saved over a mounted
wedav directory.

I have made also another test:
1.) Start OpenOffice and start writing a letter.
2.) Save it on teh Linux PC. This works fine.
3.) Copy the file to the mounted webdav directory.
4.) It can be open on the windows site without any
problems.

For me it seems to be a problem in the saving
mechanism in conjunction with davfs.

I will also report this problem to the guys of davfs.

I hope you can fix this problem.

Thank you.

Best regrads

Juergen

Discussion

  • Werner Baumann
    Werner Baumann
    2005-10-28

    Logged In: YES
    user_id=1260327

    Hello Juergen,

    I can't reproduce the error. But my test system differs
    significantly from your system.

    Could you please record the HTTP traffic betwen davfs2 and
    the WebDav server. Steps 5, 6 and 8 are of special interest.

    If you configure davfs2 --with-debug and compile and install
    you also get a lot of messages in the log files. But
    analysing the HTTP traffic should be the first step.

    Greetings
    Werner

     
  • Werner Baumann
    Werner Baumann
    2005-11-02

    Logged In: YES
    user_id=1260327

    Hello Juergen,

    I am not clear about the error, but
    a response from IIS like

    HTTP/1.1 207 Multi-Status

    Server: Microsoft-IIS/5.1

    Date: Thu, 03 Nov 2005 06:53:03 GMT

    X-Powered-By: ASP.NET

    Connection: close

    Content-Type: text/xml

    Transfer-Encoding: chunked

    is perfectly ok. It just tells that xml-data will be
    transfered and that the connection will be closed
    afterwords. That is pretty normal HTTP traffic.

    From your log I could see:

    1. The file /default_Documents_P/test_davfs.odt does not
    exist on the server. OK you create a new file.

    2. davfs request a LOCK. This is correct, to prevent
    somebody else from creating a file with the same name.
    IIS should lock the *name* and send back the lock token with
    200 OK. But IIS responts with 201 Created. It created a new
    empty file. It should not do this. Im not sure, but I think
    this does not confirm to RFC 2518 (the WebDAV standard).

    3. Now OpenOffice and davfs seem confused. They retrieve the
    empty file from the server and replace your file with this
    empty file. davfs should not do this. But OpenOffice should
    at least inform the user, that somebody else changed the
    file. I should ask you which version to use.

    4. Now OpenOffice and davfs store the now empty file on the
    server. They shall store, but not the empty file, but your
    version.

    Though I think IIS does not behave correct, OpenOffice and
    davfs should not be confused by this. I will look up the
    davfs code, but this will take about one week. You may help
    by this:

    cd into the davfs source directory and do:
    $ ./configure --with-debug
    $ make
    as root
    # make install

    Now davfs will write a lot of debug messages into some log
    file (the log file is different an different systems).

    Do the same file creation example again and send me:
    the recorded http-traffic (as you did) and additionally
    the log output from davfs.

    This log output from davfs will show me the file system
    calls from OpenOffice.

    Greetings
    Werner

     
  • Logged In: YES
    user_id=114700

    Okay I will create davfs with debug outputs. I will send the file
    next week to you. I hope we will find the problem.

    Thanks Werner.

    Bye

    J

     
  • Logged In: YES
    user_id=114700

    Okay I will create davfs with debug outputs. I will send the file
    next week to you. I hope we will find the problem.

    Thanks Werner.

    Bye

    J

     
  • Werner Baumann
    Werner Baumann
    2005-12-02

    Logged In: YES
    user_id=1260327

    Hello Juergen,

    thanks for the log files.
    After analyzing, I am almost sure it's the fault of IIS. As
    I wrote 2005-11-02: When davfs2 locks the nonexisting file,
    IIS must *not* respond with CREATED. And when davfs2 does a
    GET-request on this 'lock-null resource', IIS must *not*
    respond with OK and must *not* send an empty file. (This
    empty file replaces your file in the cache of davfs2.)

    Here is the chapter from RFC 2518, to see whether you
    understand it the same way I do:

    '7.4 Write Locks and Null Resources

    It is possible to assert a write lock on a null resource
    in order to
    lock the name.

    A write locked null resource, referred to as a lock-null
    resource,
    MUST respond with a 404 (Not Found) or 405 (Method Not
    Allowed) to
    any HTTP/1.1 or DAV methods except for PUT, MKCOL,
    OPTIONS, PROPFIND,
    LOCK, and UNLOCK. A lock-null resource MUST appear as a
    member of
    its parent collection. Additionally the lock-null
    resource MUST have
    defined on it all mandatory DAV properties. Most of these
    properties, such as all the get* properties, will have no
    value as a
    lock-null resource
    *does not support the GET method.* (Emphasized by me, Werner)
    Lock-Null
    resources MUST have defined values for lockdiscovery and
    supportedlock properties.

    Until a method such as PUT or MKCOL is successfully
    executed on the
    lock-null resource the resource MUST stay in the
    lock-null state.
    However, once a PUT or MKCOL is successfully executed on
    a lock-null
    resource the resource ceases to be in the lock-null state.

    If the resource is unlocked, for any reason, without a
    PUT, MKCOL, or
    similar method having been successfully executed upon it
    then the
    resource MUST return to the null state."

    At this point, I have one proposol for a workaround and some
    proposals for further investigation:

    The workaround:
    You might store locally an empty template file. Before
    editing with open office, you copy this file to the mounted
    webdav file system. ($ cp template.odt Documents/test.odt).
    Now it should be possible to edit this file without errors.

    Further investigations:

    To be sure whether it is the fault of IIS or of davfs2, and
    whether we could do something about it, a check with another
    webserver would be usefull. I don't get the error with
    apache, but I don't have an IIS available. So if you could
    test with some apache server, this would be fine. If you
    don't have access to an alternative server: I have an
    account on a public webdav server (bscw.fit.fraunhofer.de).
    As I understand, I am allowed to invite other people. So
    please write, if you are interested in an account on this
    server. The connectin is rather slow, but it works.

    Log files:
    The davfs2 logs you sent are from the neon part. As you
    configured davfs2 --with-debug there should be also another
    kind of log entries, something like:

    Dec 2 22:31:17 ginster mount.davfs: open
    Dec 2 22:31:17 ginster mount.davfs:
    base://ipsec-netfilter/test.sxw
    Dec 2 22:31:17 ginster mount.davfs: flags:0x1
    Dec 2 22:31:17 ginster mount.davfs: WebDAV URL:
    /bscw/bscw.cgi/0/44766065/ipsec-netfilter/test.sxw
    Dec 2 22:31:18 ginster mount.davfs: WebDAV URL:
    /bscw/bscw.cgi/0/44766065/ipsec-netfilter/test.sxw
    Dec 2 22:31:19 ginster mount.davfs: returning SUCCESS (0),
    24 bytes
    Dec 2 22:31:24 ginster mount.davfs: got 040 byte command:
    opcode = 36
    Dec 2 22:31:24 ginster mount.davfs: id: 1000
    Dec 2 22:31:24 ginster mount.davfs: close
    Dec 2 22:31:24 ginster mount.davfs:
    base://ipsec-netfilter/test.sxw
    Dec 2 22:31:24 ginster mount.davfs: CLOSE
    Dec 2 22:31:24 ginster mount.davfs: the current VFid list
    has 13 elements
    Dec 2 22:31:24 ginster mount.davfs: returning SUCCESS (0),
    12 bytes

    These logs tell me, what file system calls came from coda to
    davfs2. Comparing them with the HTTP-requests would show,
    whether davfs2 really works the way it should.

    At the moment I am working on a solution, that allows davfs2
    to detect this kind of errors. But it will take some time
    and it will not completely solve the problem. Even if davfs2
    detects the error, it could not save the file. It would have
    to handle it as a 'lost update problem' (the file was
    changed locally and at the same time was changed by someone
    else on the server). In this case davfs2 could only store a
    local backup file.

    I think the most usefull next step would be to compare IIS
    with some other webdav server.

    Greetings
    Werner

     
  • Werner Baumann
    Werner Baumann
    2005-12-19

    Logged In: YES
    user_id=1260327

    Hello,

    now I have installed IIS 6.0 and done some testing.

    I found a remarkable 'feature' of IIS which seems to be the
    reason of all the trouble:

    IIS delivers only files with extensions that are known to
    IIS and that have a MIME-type registered. But it does not
    require this when storing files.

    So when I create a new file with openoffice and store it
    on a davfs2-file-system, IIS will accept and store the
    file. It will also list this file, when answering a
    PROPFIND request; so the newly created file will be listed
    by davfs2. But when I try to open the file, this will
    create a GET request and IIS will answer with
    404 NOT FOUND. Unfortunately davfs2 does not report this
    error, but serves an empty file instead.

    I think this is just the behaviour Juergen reported.

    I know changed IIS:
    I opened the manager for IIS, and selected the website that
    containes the webdav resources and opened 'properties'
    ('Eigenschaften' in German). Choose tab 'HTTP-Headers' and
    open MIME types. Now I registered a MIME type with the
    apropriate extension (sxw).
    Clicking OK, OK, ...
    Now everthing works (with xxx.sxw files).

    It seems you have to register every extension that is
    unknown to windows this way. And it seems there is no
    way to handle files without extensions.

    You willfind the apropriate mime types at
    http://framework.openoffice.org/documentation/mimetypes/mimetypes.html

    davfs2 should report an error instead of delivering an
    empty file when it gets a 404 NOT FOUND response. I will
    try to fix this as soon as I have got time.

    Greetings
    Werner

     
  • Werner Baumann
    Werner Baumann
    2005-12-20

    Logged In: YES
    user_id=1260327

    Hello Juergen,

    sorry, but your Ethereal-file just stopped before the
    interesting part. There is no successful GET request, so I
    can't tell the difference to davfs2.

    I am running OpenOffice.org 1.1.3, IIS 6.0 and davfs 0.2.6
    (Debian package, kernel 2.6.8).
    Definitely:
    If IIS does *not* recognize the extension, openoffice over
    davfs2 will *not* work. But also other simple programs like
    cat an cp don't work with davfs2 and IIS with this unknown
    file extension.
    If IIS recognizes the file extension, openoffice over davfs2
    works (and also the other programs).

    Be aware, that changing the settings of IIS, you will have
    to deal with common windows mysteries. Several times I
    thought I removed the MIME type, and there it was again.

    So here is a plan for systematic research:

    STEP 1:
    -------
    Make sure, there is a file in your webdav-directory of IIS
    with the extension in question, and make sure this file is o.k.
    Make sure, the extension is registered with IIS, and it is
    still registered after restarting IIS or windows.

    STEP 2:
    -------
    Do *not* mount the davfs2 file system.
    Try to get the file with an ordinary Web browser. You have
    to type the complete URL by hand.
    Make sure the request is not served out of the browser
    cache. Lynx will be fine for this.
    Wait up to one minute and read the IIS log file (/somewhere
    in windows/system32/LogFiles/). Look in the log file for
    your request. The response must be 200 OK.

    If this does not work, there is a problem with the IIS
    settings. You must repeat STEP 1 until STEP 2 succeeds
    without any problems.

    If STEP 2 succeeds, we assume IIS serves the files with the
    extension in question.
    From now on, you must not change anything on the IIS side (a
    restart is a change), or you have to repeat STEP 2.

    STEP 3:
    -------
    Now mount the davfs2 file system.
    List the contents of the directory that contains your file.
    Copy the file with cp to your local host.
    Do a 'cat' on the file in your davfs file system (This will
    propably confuse your terminal. Reset or close and start a
    new terminal).
    Wait a minute and look and the log file of IIS. You should
    find a lot of PROPFIND requests, but also a GET request for
    cp and one for cat, both with 200 OK.

    If any of this fails, there seems to be problem with davfs2.
    Please send me: output from davfs2 and IIS log file; the
    debug messages of davfs2 would be fine too (you only get
    them if davfs2 is configured --with-debug).

    If everything is o.k. up to here, I'm sure the next step
    will succeed too.

    STEP 4:
    -------
    Now start openoffice and try to open this same file (in your
    davfs2 file system).
    Finally create a new file with openoffice, store it in your
    davfs2 file system, and open it again.

    If STEP 4 fails, there is something strange going on in the
    interaction of openoffice, davfs2 and IIS.
    In this case I need:
    - IIS log file (may be openoffice tries to use some file
    with unknown extension as backup?)
    - davfs2 debug messages. You must configure davfs2
    --with-debug and compile yourself. But without the messages
    from kernel to davfs2 and back, I can only guess what's
    going on.
    - Log from ethereal. But please wait some time (some
    minutes) untill you are sure, it is complete.

    Greetings
    Werner

    P.S.
    Please send replies to this list, so everybody may read it.

     
  • Logged In: YES
    user_id=114700

    Hi Werner,

    Sorry for writing directly to you, but the I have only mail-
    access on my working station.
    I will later make an entry in the bug report from a
    different place.

    I have add the mime types and made your four step tests.

    Step 1: Okay

    Step 2: Okay

    Step 3: Okay

    Step 4: Failed

    Step 5: OpenOffice direct saving

    I have attached 5 Log-Files. The files davfs.log and
    IIS6.0.log contains the capture of step 3 to 5.
    I have have always waited a certain time to capture the
    whole communication.
    It's really strange, the only thing whicjh doesn't work, is
    when I create a new file with openoffice.
    An existing file can be opend and changed without any
    problems.

    My current test system at the moment is Suse 10.0, davfs-
    0.26, neon-0.24.7, Windows Server 2003 with IIS 6.0
    I configured neon and davfs with the option "--with-debug".
    Then make and make install.

    Any other ideas?

    Thank you very much for helping.

    Regards

    Juergen

     
  • Logged In: YES
    user_id=114700

    No no. Step3 worked fine. Step 3 was cat/cp/mv a file from
    and to IIS6.0.
    I can open and change existing files without any problems
    from openoffice.
    The attached files are logs from open and change the
    QuickBrownFox.odt.

    It is step4 which concerns me!!!
    --------------------------------
    Step4 is creating a new file with OpenOffice and saving it
    on the mounted webdav partition.
    In the previous IIS 6.0 log file Timestamp 12:39:41 to
    12:40:12 I tried to save the file test_step4.odt.

    Here is part of the log:

    2005-12-21 12:39:53 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/ - 80 - 192.168.1.251
    davfs2+0.2.6+neon/0.24.7 207 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C - 80 - 192.168.1.251
    davfs2+0.2.6+neon/0.24.7 207 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/ - 80 - 192.168.1.251
    davfs2+0.2.6+neon/0.24.7 207 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    LOCK /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 201 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    GET /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 200 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    PUT /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 200 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    UNLOCK /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 204 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 207 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    LOCK /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 200 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    GET /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 200 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 207 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    GET /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 200 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    PUT /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 200 0 0
    2005-12-21 12:40:12 W3SVC1 192.168.1.250
    UNLOCK /default_Documents_C/test_step4.odt - 80 -
    192.168.1.251 davfs2+0.2.6+neon/0.24.7 204 0 0

    In step5 where I save directly from OpenOffice without any
    davfs. The communication is much shorter. I got more
    PROPFIND.
    Here is the part for step5

    2005-12-21 12:44:37 W3SVC1 192.168.1.250
    OPTIONS /default_Documents_C/OpenOfficeDirect.odt - 80 -
    192.168.1.251 - 200 0 0
    2005-12-21 12:44:37 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/OpenOfficeDirect.odt - 80 -
    192.168.1.251 - 404 0 0
    2005-12-21 12:44:37 W3SVC1 192.168.1.250
    OPTIONS /default_Documents_C - 80 - 192.168.1.251 - 200 0 0
    2005-12-21 12:44:37 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C - 80 - 192.168.1.251 - 207 0 0
    2005-12-21 12:44:37 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C - 80 - 192.168.1.251 - 207 0 0
    2005-12-21 12:44:39 W3SVC1 192.168.1.250
    OPTIONS /default_Documents_C/ - 80 - 192.168.1.251 - 200 0 0
    2005-12-21 12:44:39 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/ - 80 - 192.168.1.251 - 207 0
    0
    2005-12-21 12:44:39 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/ - 80 - 192.168.1.251 - 207 0
    0
    2005-12-21 12:44:39 W3SVC1 192.168.1.250
    PUT /default_Documents_C/OpenOfficeDirect.odt - 80 -
    192.168.1.251 - 201 0 0
    2005-12-21 12:44:39 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/ - 80 - 192.168.1.251 - 207 0
    0
    2005-12-21 12:44:39 W3SVC1 192.168.1.250
    PROPFIND /default_Documents_C/OpenOfficeDirect.odt - 80 -
    192.168.1.251 - 207 0 0

    The strange thing is that I have only one PUT in log from
    step5. In the log from step4 I got LOCK->GET->PUT->UNLOCK...
    What went wrong?

    Cheers J

    -----Original Message-----
    From: Werner Baumann [mailto:werner.baumann@onlinehome.de]
    Sent: Mittwoch, 21. Dezember 2005 18:32
    To: Messerer Jürgen
    Subject: Re: [ dav-Bugs-1337129 ] OpenOffice can't save
    files over davfs

    Hello Juergen,

    I can see several successfull attempts to retrieve
    /default_Documents_C/QuickBrownFox.odt from IIS.

    10:33:06 GET by Firefox
    10:41:36 GET by Firefox
    12:24:46 GET by davfs2
    12:25:11 GET by davfs2

    Which one was STEP 3, which one STEP 4?

    What happend when you tried to open QuickBrownFox.odt with
    openoffice.org?

    Assuming 12:24:46 and 12:25:11 belong to STEP 3 (as
    suggested), did you
    really try to open QuickBrownFox.odt with openoffice? Could
    you see the
    file in the file chooser of openoffice? Error messages from
    openoffice? What did openoffice display?

    There are no further attempts from davfs2 to get this file.
    If you
    really tried to open it with openoffice and openoffice
    showed an empty
    file (after you successfully listed it with cat), there is
    something
    curious going on in communication of openoffice with the
    filesystem. In
    this case I really need the debug messages of davfs2. You
    should try to
    find them in your logfiles. If they are not there you will
    have to check
    the configuration file of syslog in Suse. If davfs2 is
    configured
    --with-debug it sends this messages to syslog on any other
    system.

    The log entries with /default_Documents_C/test_step4.odt/
    don't help at
    the moment, as they are from a newly created file. We first
    have to find
    out, why openoffice can't open the existing file, but cat
    can.

    Greetings
    Werner

     
  • Werner Baumann
    Werner Baumann
    2005-12-29

    Logged In: YES
    user_id=1260327

    Thanks to persistent testing by Juergen we could finally
    track down the bug.

    davfs2 did not handle multiple open requests correctly. Most
    time applications do just one open and then close the file,
    so this bug could survive. But OpenOffice.org 2 will do two
    successive open requests.

    The bug is fixed in the CVS repository. There will also be a
    new fixed release soon.

    There is also non RFC conforming behaviour of IIS that
    confused the matter:
    When there is a LOCK operation on a non existing file, IIS
    will create an empty file and serve this empty file on
    subsequent GET requests. Conforming to standards it should
    only lock the name and response to all GET requests on this
    non existing file with error 404.
    davfs2 now tries not to download this empty files that
    should not exist. But I am not sure whether this will work
    in all circumstances. Under certain circumstances there
    might remain such useless empty files permanently on the
    server. So IIS administrators should check for this from
    time to time.

    Werner

     
  • Werner Baumann
    Werner Baumann
    2006-02-14

    • status: open --> closed-fixed