be.re.io.IOException

Help
ppgaz
2013-06-03
2015-01-02
  • ppgaz

    ppgaz - 2013-06-03

    Hi everybody,

    When I try to make my backup :
    java -jar webdav_sync1_1_2.jar -up -u https://username:password@URL/ -d /mylocalFolder/

    I have this :

    Done.
    be.re.io.IOException
    at be.re.webdav.cmd.Sync$ListenerAdapter.exception(Sync.java:4261)
    at be.re.webdav.cmd.Sync.getTree(Sync.java:1562)
    at be.re.webdav.cmd.Sync.run(Sync.java:3009)
    at be.re.webdav.cmd.Sync.main(Sync.java:2131)
    Caused by: be.re.net.ProtocolException: Bad Request.
    at be.re.webdav.Util.throwPrecondition(Util.java:2544)
    at be.re.webdav.Util.throwException(Util.java:2480)
    at be.re.webdav.cmd.Sync$ListenerAdapter.error(Sync.java:4245)
    at be.re.webdav.cmd.Sync.getTree(Sync.java:1493)
    ... 2 more

    What does it mean ? And what is the problem with my backup ?
    Many thanks

     
    • TAKI, Yasushi

      TAKI, Yasushi - 2014-10-05

      Hello.

      Probably, there is special character,ex % in your last file.

      I met same bugs.
      I run webdav-sync on netbeans debuggers.
      Then I found same IOException in same function.

      Thanks.

       
  • Werner Donné

    Werner Donné - 2013-06-03

    Hello,

    Probable your server doesn't support HTTP-compression and doesn't report this correctly. Can you add the following:

    java -Dbe.re.http.no-compress -jar ...

    Best regards,

    Werner.

     
  • tim baum

    tim baum - 2014-06-26

    Are there any other settings that may cause this error?

    I'm getting the same error on upload (download works fine), but adding the "-Dbe.re.http.no-compress " didnt help.

    I'm able to upload files using the built-in linux natulis webdav support. And several android webdav clients work too.

     
    • Werner Donné

      Werner Donné - 2014-06-26

      I see you are using version 1.1.2. Can you try it with 1.1.4? You can also add "-Dbe.re.http.trace" and redirect the output a file, which you may send to support@pincette.biz.

       
      • Jan

        Jan - 2014-09-30

        Hello Werner,

        I am experiencing a similar exception with 1.1.4 after I swicthed the cload provider to open exchange (OX).

        With my old apache this is working fine, but OK seems to be a bit different.

        I tried disabling HTTP compression, but with no difference.

        I created two traces. One for up and one for down. I don't know if there is much of a difference as both trace files seem to be identical + the exception is the same. But I attach them anyways.

        Command
        java -Dbe.re.http.trace -jar webdav_sync1_1_4.jar -u "https://[username:password]@office.mailbox.org/servlet/webdav.infostore/Userstore/Jan Sawade/" -down -d ~/data/web.de/ | tee webdav_sync.trace.broken.down.txt

        be.re.io.IOException
        at be.re.webdav.cmd.Sync$ListenerAdapter.exception(Sync.java:4807)
        at be.re.webdav.cmd.Sync.getTree(Sync.java:1806)
        at be.re.webdav.cmd.Sync.run(Sync.java:3378)
        at be.re.webdav.cmd.Sync.main(Sync.java:2380)
        Caused by: be.re.io.IOException
        at be.re.webdav.Util.readPropertyList(Util.java:2044)
        at be.re.webdav.Util.readPropertyList(Util.java:1973)
        at be.re.webdav.cmd.Sync.getTree(Sync.java:1745)
        ... 2 more
        Caused by: java.lang.NullPointerException
        at java.text.Normalizer.isNormalized(Normalizer.java:181)
        at be.re.webdav.cmd.Sync.normalize(Sync.java:2675)
        at be.re.webdav.cmd.Sync.getRecord(Sync.java:1445)
        at be.re.webdav.cmd.Sync.access$1800(Sync.java:72)
        at be.re.webdav.cmd.Sync$1.handle(Sync.java:1767)
        at be.re.webdav.Util.readPropertyList(Util.java:2110)
        at be.re.webdav.Util.readPropertyList(Util.java:2034)
        ... 4 more

        Thanks for your support.

         
  • Werner Donné

    Werner Donné - 2014-10-05

    Hello Jan,

    The server seems to return a record from which no path could be derived. I can't verify it however, because the response of the server is compressed in the trace. When the http.no-compress property is set I should not include "gzip" in the Accept-Encoding header, because that is why the server has responded that way. I should also ignore records that have no path.

    Best regards,

    Werner.

     
    • Jan

      Jan - 2014-10-07

      Hello Werner,

      thanks for your reply. You hinted that the data had been still compressesed by GZIP. I was able to get this fixed by my provider and now got a long XML respone in the trace.

      Sadly my webdav knowledge is not that good and I would need another hint of yours on how to get your webdav-sync to work with my current provider.

      Thanks
      Jan

       
  • Werner Donné

    Werner Donné - 2014-10-07

    Hello Jan,

    I have looked at the trace, but it is much too large to find anything. Can you narrow down the space by trying to synchronise subfolders and drill down this way until it happens with a small folder tree?

    Best regards,

    Werner.

     
    • Jan

      Jan - 2014-10-07

      Hello Werner,

      I played a bit with the folders and attached logs.

      First I deleted all Subfolders and Files from the server, then I craeted a new - empty - folder on my local drive.

      I tried to upload a single file to the server and tried to download a single file from the server (Test 3/5).

      Strangely it is not possible to add a file to the empty webdav folder (timeout).
      But syncing the empty folder with the local driver works, all local files get deleted.

      Syncing a single file on the server with an empty folder on the local drive fails again.

      I hope this + the traces make sense.

      Thanks
      Jan

       
  • Werner Donné

    Werner Donné - 2014-10-08

    Hello Jan,

    The timeout during the upload I can't explain.

    The down test 3 reproduces your initial problem. I have now spotted what goes wrong. In your command-line the URL contains a space character, which is not allowed in a URL. It should be encoded with %20. This is why WebDAV-Sync doesn't find any valid paths in the tree that returns from the server. They are not descendants of the given URL.

    The local deletion occurs because after the previous sync cycle there is nothing on the server, which looks like the file has been removed from the server.

    I also see that the "getlastmodified" property the server returns is not formatted correctly. It should be a HTTP-date instead of an ISO-timestamp. This is supported by WebDAV-Sync, however, because there are other servers such as Box that also violate that rule.

    Best regards,

    Werner.

     
    • Jan

      Jan - 2014-10-09

      Hello Werner,

      thanks for your continous support.
      I think this %20 was the break through.

      It is now syncing files back and forth.

      There seems to be a problem with files created by touch. But as soon as there is soem date in it it's working.

      It looks as if changes made on the server are not being synced down again.
      This might be an issue with the ISO time as this time is only accurate to teh minute. I will check this with some slow changes over the day and report back.

      Thanks
      Jan

       
  • Werner Donné

    Werner Donné - 2014-10-09

    Hello Jan,

    The synchronisation is indeed based on the time and hence it is important the clocks are equal.

    What happens exactly when you create an empty file with touch?

    Best regards,

    Werner.

     
    • Jan

      Jan - 2014-10-10

      Hello Werner,

      I made some tests and attached a sync log including the directory listings to show that files get not synced, despite that their dates differ by 1 day.

      Could it be that webdav-sync looks for the change date of teh folder first and does not check all the file individual? The XML from teh servers shows the newer date of the testfile.txt.

      I also attached a log for a file which just have been touched which then creates an exception if synced.

      Regards
      Jan

       
  • Werner Donné

    Werner Donné - 2014-10-10

    Hello Jan,

    The empty file problem seems to be a server problem. In the following excerpt of your trace you can see this:

    PUT /servlet/webdav.infostore/Userstore/Jan%20Sawade/emtyfile.txt HTTP/1.1
    Host:office.mailbox.org
    Content-Type:text/plain
    Authorization:Basic anNhd2FkZUBtYWlsYm94Lm9yZzpURSMzSCZGUTVyZG0=
    User-Agent:be.re.net.HTTPClient (Linux)
    Expect:100-continue
    Transfer-Encoding:chunked
    TE:trailers

    HTTP/1.1 100 Continue

    0

    HTTP/1.1 100 Continue

    The server replies twice with 100 Continue, which is not normal.

    The times of the two sides are only compared at the first synchronisation. After that it compares the changes on either side using the respective times. So then it doesn't matter anymore if the clocks are not synchronous. Folder times are not used.

    Best regards,

    Werner.

     
  • TAKI, Yasushi

    TAKI, Yasushi - 2015-01-02

    It happen IOException when putting file includes special character.
    This patch works skipping file.

    --- a/src/be/re/webdav/cmd/Sync.java    Fri Jan 02 17:50:31 2015 +0900
    +++ b/src/be/re/webdav/cmd/Sync.java    Fri Jan 02 18:03:33 2015 +0900
    @@ -665,6 +665,14 @@
           return true;
         }
    
    +    catch (ProtocolException e){
    +        if(e.getCode() == 404 ){
    +            System.err.println("Warning: URL \""+ e.getUrl().getFile()+"\" is not found.");
    +            return true;
    +        } else {
    +            return false;
    +        }
    +    }
        catch (Throwable e)
         {
           for (Listener listener: listeners)
    

    When putting the file because of forbidden, this patch works.

    @@ -1936,7 +1953,10 @@
               writeFilename(member, context);
               writeUrl(url, time[0], context);
             }
    
    +        catch (IOException e) {
    +            System.err.println(e.getCause().toString()+" : "+url.getFile());
    +            result = false;
    +        }
             catch (Throwable e)
             {
               for (Listener listener: listeners)
    
    
     
    Last edit: TAKI, Yasushi 2015-01-02
  • TAKI, Yasushi

    TAKI, Yasushi - 2015-01-02

    When doing MKCOL, It seems this patch works..., but...

    @@ -1922,6 +1936,9 @@
               writeUrl(url, context);
             }
    
    +        catch (IOException e) {
    +          System.err.println("Warning:"+e.getMessage());
    +          return false;
    +        }
             catch (Throwable e)
             {
               for (Listener listener: listeners)
    

    BUT, I don't know this function should return false.....

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks