OSS-DocumentScanner icon indicating copy to clipboard operation
OSS-DocumentScanner copied to clipboard

[BUG] webdav - undefined issue

Open reinzi opened this issue 9 months ago • 27 comments

Which app is your issue for

Document Scanner

Version

Android > 1.14.3 Build 119 IOS > 1.12.3 Build 60

What platform are you using?

Android

OS Version

Android 14 IOS 18.3

What happened?

  1. Webdav server windows server 2016 with iis and tryed with webdav strato hidrive
  2. try to sync pics or doc
  3. Issue undefinied

Image

Relevant log output

Log IIS Windows Server 2016

2025-02-08 21:08:31 XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX.55 okhttp/4.12.0 - 207 0 0 0
2025-02-08 21:08:31 XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX.55 okhttp/4.12.0 - 207 0 0 53
2025-02-08 21:08:31 XXX.XXX.XXX.16 PUT /webdav/Belege/ti26e59tam26p_CR.pdf - 80 -XXX.XXX.XXX.55 okhttp/4.12.0 - 401 0 5 13
2025-02-08 21:10:43 XXX.XXX.XXX.16 PROPFIND /webdav - 80 - XXX.XXX.XXX0.55 okhttp/4.12.0 - 207 0 0 6
2025-02-08 21:11:03 XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX.55 okhttp/4.12.0 - 207 0 0 15

from windows client
2025-02-08 21:07:14 1XXX.XXX.XXX.16 PUT /webdav/Belege/Neues+Textdokument.txt - 80 ***\administrator XXX.XXX.XXX.79 Microsoft-WebDAV-MiniRedir/10.0.19045 - 204 0 0 0

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

reinzi avatar Feb 08 '25 21:02 reinzi

@reinzi thanks for the report! Is that a new error from latest release? I did a few webdav fixes, might be a regression. I have some reports from this. Do you have a SM-S901B ? I will need to add a few more logs in next release to understand this error. Once it is release i could need you to reproduce it again

farfromrefug avatar Feb 09 '25 15:02 farfromrefug

@farfromrefug Tanks for und response Indeed i have the s22 Phone but we tryed with an Apple as well with the same result... If u see the logs ... in the put command the User is missing.... maybe??? And Sure i will try to help, if i can...

reinzi avatar Feb 09 '25 21:02 reinzi

@reinzi thanks! i just released a new version. Dont think it will fix it but i should get more logs in the report. If you can reproduce the bug and let me know i can check the report

farfromrefug avatar Feb 10 '25 16:02 farfromrefug

@farfromrefug yes the bug is still there unfortunately the message has not changed either 1.14.4 Build 120

reinzi avatar Feb 10 '25 17:02 reinzi

@reinzi i got your report but some logs are missing :s i am having a hard time understanding what s going on. THere is one way to get more info. if you agree you can use https://httptoolkit.com/ (free and open source). Install on your computer and on your device. Connect the 2 . When connected trigger the error again. On your computer you will see the failing request. Please share with me the result from as request as shown in this image https://httptoolkit.com/images/product/http-toolkit-assets/explore-light-opt-1920.WEBP You can do it privately using my mail in app support in here https://play.google.com/store/apps/details?id=com.akylas.weather

farfromrefug avatar Feb 10 '25 20:02 farfromrefug

@reinzi could you check, if you have a / behind your server address in your config in oss?

cd-FileX avatar Feb 11 '25 02:02 cd-FileX

@farfromrefug

Image

reinzi avatar Feb 11 '25 08:02 reinzi

@reinzi great can you share with me the response of that request? i need to see the "text" response it returns. This is what the app is trying to "parse" and fails.

farfromrefug avatar Feb 11 '25 12:02 farfromrefug

If it would help, my guesses are:

  • You have configured the authentication in OSS wrong (not matching? you got an 401 error there)
  • you have a / behind your address which ends up in // which is a not found place which you are thus unauthorized to access (which was the case for me)

So it is just an error not correctly displayed in OSS but a 'miss' in the configuration.

cd-FileX avatar Feb 11 '25 13:02 cd-FileX

@cd-FileX it is actually almost certainly a bug. Only the put request is failing all others are passing which suggest his configuration is good

farfromrefug avatar Feb 11 '25 15:02 farfromrefug

Ah, yeah... Overthinking that, we are at your conclusion

cd-FileX avatar Feb 13 '25 13:02 cd-FileX

again, sorry... windows 10 client to windows 2016 server (webdav) with AD

path: http://XXX.XXX.XXX.16/webdav user: i tryed: domain\user, just user pw: shoud be the password dir: Belege

2025-02-13 15:27:22 XXX.XXX.XXX.16 PROPFIND /webdav - 80 DOMAIN\USER XXX.XXX.XXX.79 Microsoft-WebDAV-MiniRedir/10.0.19045 - 207 0 0 0 2025-02-13 15:27:22 XXX.XXX.XXX.16 DELETE /webdav/Belege/Neues+Textdokument.txt - 80 DOMAIN\USER XXX.XXX.XXX.79 Microsoft-WebDAV-MiniRedir/10.0.19045 - 200 0 0 46

this work bretty fine... same user other divice > Android with OSS 2025-02-13 15:29:05 XXX.XXX.XXX.16 PROPFIND /webdav/ - 80 - XXX.XXX.XXX. okhttp/4.12.0 - 401 2 5 0 ^^^there is no DAOMAIN\USER !!!

401 > The HTTP 401 Unauthorized client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. <<< or maybe none?

fromtoolkit

401 - Nicht autorisiert: Zugriff aufgrund ung�ltiger Anmeldeinformationen verweigert.

401 - Nicht autorisiert: Zugriff aufgrund ung�ltiger Anmeldeinformationen verweigert.

Die angegebenen Anmeldeinformationen berechtigen Sie nicht, dieses Verzeichnis oder diese Seite anzuzeigen.

^^^this just the response from the server if there is no valid usercredential....

reinzi avatar Feb 13 '25 15:02 reinzi

@reinzi OK indeed the error is that you did not add /Belege at the end of the remote url. Please do. I will inverstigate if all webdav impl work the same way and if i can add it for you

farfromrefug avatar Feb 13 '25 20:02 farfromrefug

@farfromrefug thats wrong... nothing change.... here with Belege

#Software: Microsoft Internet Information Services 10.0 #Version: 1.0 #Date: 2025-02-14 07:39:57 #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken 2025-02-14 07:39:24 XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX.55 okhttp/4.12.0 - 401 2 5 78 2025-02-14 07:39:33 XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX.55 okhttp/4.12.0 - 401 2 5 15 2025-02-14 07:39:36 XXX.XXX.XXX..16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX.55 okhttp/4.12.0 - 401 2 5 0 2025-02-14 07:39:36 XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX..55 okhttp/4.12.0 - 401 2 5 0 2025-02-14 07:39:43 XXX.XXX.XXX..16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX.55 okhttp/4.12.0 - 401 2 5 0 2025-02-14 07:39:43 XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 - XXX.XXX.XXX..55 okhttp/4.12.0 - 401 2 5 15

^^^no USER

it shoud be like: DATE TIME XXX.XXX.XXX.16 PROPFIND /webdav/Belege - 80 DOMAIN\USER XXX.XXX.XXX.55 ....

reinzi avatar Feb 14 '25 07:02 reinzi

@reinzi not sure about how your webdav server works and thus how you need to set it up. But it should work. What you can try is setup your webdav server with https://github.com/zhanghai/MaterialFiles. If you get it to work try to apply the same config to my app. If it then does not work with the same config then it is a bug! Then i ll have to find a way to reproduce it (though i donnt have any windows machine around)

farfromrefug avatar Feb 14 '25 08:02 farfromrefug

@reinzi might have found something else. Just realized some people are using (not sure if it is your case) remote sync folders which already contain folders which are not "documents". The app, right now, would assume that the remote sync folder used is ONLY for OSS-DocumentScanner, and thus would trigger an error. In the next version, those folders will be ignored. It will also contains more fixes. Hope this will be better for you

farfromrefug avatar Feb 17 '25 11:02 farfromrefug

Hi there, ran into the same error - I can confirm my Webdav server works in other apps (Solid Explorer, Davx, even S3Drive via rclone).

arichiardi avatar Aug 20 '25 16:08 arichiardi

@arichiardi i think this is a server error that i dont parse and shows correctly. In the next version the return "content" when a error appears will be shown directly. This should help investigate those. In sentry i see some with 401 or 523

farfromrefug avatar Sep 05 '25 10:09 farfromrefug

Thanks @farfromrefug I don't have the time now to download and compile the app but if you have a pre-release you want me to try please send it over and I'll do it!

arichiardi avatar Sep 05 '25 17:09 arichiardi

I have the same issue. I use oss scanner on an old qnap ts-220 using the webdav protocol. The password of the sync setup is not saved. If I try to check the sync setup I need to re-enter the password. I also use joplin notes with webdav on the same server without issues. My 2c Tony

sweetman-zz avatar Sep 07 '25 15:09 sweetman-zz

@arichiardi @sweetman-zz @reinzi @cd-FileX here is a test build https://github.com/Akylas/OSS-DocumentScanner/releases/tag/webdav_test. In this one when there is the undefined error it should now report the actual error returned by webdav. So you know it is a build with sentry enabled so that i can get more feedback. It is a build signed with the same key as fdroid/github. You cant install it over playstore install.

farfromrefug avatar Sep 12 '25 12:09 farfromrefug

Tried right away and I still see the issue, 1.14.5 121.

I still see the Undefined issue. Am I on the right build?

Image

arichiardi avatar Sep 12 '25 13:09 arichiardi

@arichiardi thats weird. Could you try after 9:30pm today (in one hour)? My sentry server starts at 9pm. With the sentry issue i should be able to see what s going on.

farfromrefug avatar Sep 13 '25 06:09 farfromrefug

Thanks! Trying again now.

arichiardi avatar Sep 13 '25 15:09 arichiardi

@arichiardi i see the report but sadly it does not help much. By any chance could any of you create an account for me on your webdav so that i could test? Or maybe better. Can any of you share a way to install a webdav server with the same config as yours ? Best would be on ubuntu. I am thinking i dont connect correctly on those webdav servers. It works fine here on nextcloud, but might be different on different servers

farfromrefug avatar Sep 13 '25 17:09 farfromrefug

@farfromrefug I am using caddy and its webdav modules for that.

I think the easiest is for me to create an account for you. How do I contact you in private 😄 My email is here on github and I have an associated gpg key to it.

arichiardi avatar Sep 13 '25 19:09 arichiardi

@farfromrefug today I played a bit more with it. Basically when I go to Sync and set things up and I have "Auto Sync" enabled it is always asking me for a password. No matter how many times I put it in.

The other odd thing I noticed is that if I disable "Auto Sync" I actually see the files in my Webdev server!

The error still shows up on start but at list files are there 😅

arichiardi avatar Oct 27 '25 02:10 arichiardi