haiwen / seadroid

Android client for Seafile
Other
541 stars 277 forks source link

Can view folders, but can't view files #818

Open xobs opened 5 years ago

xobs commented 5 years ago

I'm using Seadroid 2.2.15, and I'm able to browse the heirarchy of my seafile server, and can even decrypt encrypted stores, but I am unable to download any files, including images or text files.

Every time I tap on a file, I am presented with an endless stream of:

Failed to download file "[filename]

(Note the missing close-quote)

I don't see anything relevant in the logs, though occasionally see the following occurring every 50ms for about a minute, which I suspect is it trying to upload photos:

05-23 23:07:23.254  4994  6637 D TransferManager: do next!
05-23 23:07:23.278  4994  5103 D SeafConnection: 1Unknown Error
05-23 23:07:23.278  4994  5103 E UploadTask: Upload exception 1 Unknown Error
05-23 23:07:23.279  4994  5103 W System.err: SeafException{code=1, msg=Unknown Error}
05-23 23:07:23.279  4994  5103 W System.err:    at com.seafile.seadroid2.ui.fragment.ReposFragment$LoadTask.onPostExecute(ReposFragment.java:831)
05-23 23:07:23.279  4994  5103 W System.err:    at com.seafile.seadroid2.ui.fragment.ReposFragment$LoadTask.onPostExecute(ReposFragment.java:756)
05-23 23:07:23.279  4994  5103 W System.err:    at android.os.AsyncTask.finish(AsyncTask.java:695)
05-23 23:07:23.279  4994  5103 W System.err:    at android.os.AsyncTask.-wrap1(Unknown Source:0)
05-23 23:07:23.279  4994  5103 W System.err:    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
05-23 23:07:23.279  4994  5103 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:105)
05-23 23:07:23.279  4994  5103 W System.err:    at android.os.Looper.loop(Looper.java:176)
05-23 23:07:23.279  4994  5103 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:6701)
05-23 23:07:23.279  4994  5103 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
05-23 23:07:23.279  4994  5103 W System.err:    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:246)
05-23 23:07:23.279  4994  5103 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
05-23 23:07:23.295  4994  6637 D TransferManager: do next!
05-23 23:07:23.319  4994  5014 D SeafConnection: 1Unknown Error
05-23 23:07:23.319  4994  5014 E UploadTask: Upload exception 1 Unknown Error
05-23 23:07:23.319  4994  5014 W System.err: SeafException{code=1, msg=Unknown Error}
05-23 23:07:23.319  4994  5014 W System.err:    at com.seafile.seadroid2.ui.fragment.ReposFragment$LoadTask.onPostExecute(ReposFragment.java:831)
05-23 23:07:23.319  4994  5014 W System.err:    at com.seafile.seadroid2.ui.fragment.ReposFragment$LoadTask.onPostExecute(ReposFragment.java:756)
05-23 23:07:23.319  4994  5014 W System.err:    at android.os.AsyncTask.finish(AsyncTask.java:695)
05-23 23:07:23.319  4994  5014 W System.err:    at android.os.AsyncTask.-wrap1(Unknown Source:0)
05-23 23:07:23.319  4994  5014 W System.err:    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
05-23 23:07:23.319  4994  5014 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:105)
05-23 23:07:23.319  4994  5014 W System.err:    at android.os.Looper.loop(Looper.java:176)
05-23 23:07:23.319  4994  5014 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:6701)
05-23 23:07:23.319  4994  5014 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
05-23 23:07:23.319  4994  5014 W System.err:    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:246)
05-23 23:07:23.319  4994  5014 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
05-23 23:07:23.346  4994  6637 D TransferManager: do next!

I don't see any logs on the server, either.

The server is behind a Traefik proxy that is adding https. I have no problems with the desktop client, web client, or Syncthing.

How can I debug errors that Seadroid is throwing?

audioscavenger commented 5 years ago

uniq log line in nginx:

GET /api2/repos/353827dd-b804-4a9c-befc-2def8ae6dbe3/file/?p=%2Ffile.txt&op=download HTTP/1.1" 200 84 321 0.016 0.016 "-" "Dalvik/2.1.0 (Linux; U; Android 9; SM-N960U Build/PPR1.180610.011)" "-"
lauhub commented 2 years ago

Hello, I have exactly the same problem. Did anyone solved it ?

Or any chance a patch could be made one day ?

I tried with version 2.2.39 and 2.2.44 on a Max Lumix tablet

Log line in Nginx access.log:

- 31.37.74.157 [15/Apr/2022:14:16:58 +0200] "GET /api2/repos/403553dc-9078-4e21-adac-ba0f2d1423df/dir/?p=%2F&oid=3278e2c8dfbc4fb81b5e01949f3c512ffbf57bf0 HTTP/1.1" 200 10 "-" "Dalvik/2.1.0 (Linux; U; Android 10; MaxLumi Build/2021-11-30_16-20_3.2_5bccd60)" 0.059

When I try to use this URL, I get this JSON content (which is not the actual file content):

"uptodate"
lauhub commented 2 years ago

I have a possible lead to correct this issue.

When clicking on a text file, I get the error and get a log entry:

- 131.132.133.134 [20/Apr/2022:17:23:27 +0200] "GET /api2/repos/403553dc-9078-4e21-adac-ba0f2d1423df/file/?p=%2Fblabla.txt&op=download HTTP/1.1" 200 82 "-" "Dalvik/2.1.0 (Linux; U; Android 10; MaxLumi Build/2021-11-30_16-20_3.2_5bccd60)" 0.420

If I use this request and use it in my browser (logged in to my seafile server), I get the actual URL of the file:

Request:

https://seafile.server.fr/api2/repos/403553dc-9078-4e21-adac-ba0f2d1423df/file/?p=%2Fblabla.txt&op=download

Answer:

"http://seafile.server.fr/seafhttp/files/0ccf36d1-c2ce-4cf0-a72b-99b6b7d6ef61/blabla.txt"

The download is not done from this point. So it seems that for some reasons, the answer is not taken into account and calls the method onFileDownloadFailed(DownloadTaskInfo info) at line 222 in app/src/main/java/com/seafile/seadroid2/ui/activity/FileActivity.java

Hope it helps

lauhub commented 2 years ago

I managed to reproduce the bug using Android Studio 2021.1.1 with a Nexus 9 API 29 emulator (x86_64)

However, I would like to know where in the code each item displayed in browser is initialized

Any lead ?