When using WebDav, open file fails with error msg 'Premature end of file.'



When using WebDav web server (IIS 8) with GanttProject, opening file gives error message ‘Premature end of file.’. Saving file to WebDav folder works ok. I have checked that .gan file which I try to open is not empty and looks ok. If I copy it to my local hard disk, it opens without error messages.

Any idea what could be wrong? GanttProject is version 2.8.8.

Rgds, Asko

(Dmitry Barashev) #2

Please post the contents of the log after file opening. Help > View log



Here is attached log file from WebDav file open process:
GanttProjet_WebDav_File-open.zip (2.3 KB)

For the reference, here is attached log file from WebDav file save process, which works ok:
GanttProjet_WebDav_File-save.zip (1.4 KB)

Best regards, Asko

(Dmitry Barashev) #4

I see authentication warnings, which may or may not be the issue. It probably depends on how your WebDAV server behaves in case of authentication errors. You may try downloading a build of GP 2.8.9 where we updated WebDAV library and enabled some additional logging.

Here is a Dropbox folder with packages: https://www.dropbox.com/sh/0gwuayq6vg0kyss/AAApogLPlvpg0lY9JltS-3sZa?dl=0

You need to open file logging.properties which sits at the top level of GP install folder and replace

io.milton.httpclient.level = INFO


io.milton.httpclient.level = FINEST


Tried with ver. 2.8.9 and result is the same (error msg premature end of file).

Attached log with log setting io.milton.httpclient.level = FINEST:
GanttProjet-2.8.9_WebDav_File-open.zip (2.7 KB)

BR Asko

(Dmitry Barashev) #6

So it looks like your server really returns empty file.


Any idea, what causes this behavior?

If I open WebDav folder with Windows File Explorer, copy file to local disk and then open local copy with GanttProject, it opens without errors and displays correct data.

Also, I can save .gan file with Ganttproject to WebDav folder without errors and saved file is what it should be.

BR Asko

(Dmitry Barashev) #8

You may want to examine your server logs to investigate the reasons. I don’t know how Windows Explorer communicates with WebDAV folder and not sure if it does so at all (Windows client and server may easily use other communication protocols)


I disabled windows authentication (basic authentication is enabled) from IIS WebDav and tested WebDav folder read&write with WinSCP client, both read&write works.

Tested again with same IIS WebDav settings with GanttProject, resulting same error ‘premature end of file’. Log file:
GanttProjet-2.8.9_WebDav_File-open.zip (2.5 KB)

As WinSCP works with WebDav server using basic authentication, I don’t think that there is anything wrong in the WebDav server & folder settings.

(Dmitry Barashev) #10

You will get the most precise answer from the server logs. WebDAV is a complex protocol, and can be misinterpreted by both server and client. If you want to troubleshoot particular GanttProject client, you need to know what exactly is returned to its requests.