ImranR98 / Obtainium

Get Android app updates straight from the source.
https://obtainium.imranr.dev
GNU General Public License v3.0
7.27k stars 161 forks source link

[Bug] installing multiple apps fails #634

Closed S7venLights closed 6 months ago

S7venLights commented 1 year ago

Hi again, been using the app stably for a while but experience this in the past few versions (not sure which exactly) If I select a number of apps to download updates, Obtanium will download as usual and show the install prompt the moment the first apk is ready. Even if others are still downloading. Then if I click install, the app installs successfully but the other downloads fail with a non specific error. I have to then download one at a time and they start downloading from 0% again.

1day of Logs from attempts this morning:

2023-06-27 07:43:59.474: info: Started BG update check task

2023-06-27 07:43:59.498: info: Bg update ignoreAfter is null

2023-06-27 07:43:59.930: info: Started actual BG update checking

2023-06-27 07:46:05.460: info: BG update checking found 0 updates - will notify user if needed

2023-06-27 07:46:05.460: info: Finished BG update check task

2023-06-27 10:43:17.519: info: Started BG update check task

2023-06-27 10:43:17.523: info: Bg update ignoreAfter is null

2023-06-27 10:43:17.650: info: Cleared 35 logs (before = 2023-06-20 10:43:17.518221, after = null)

2023-06-27 10:43:18.186: info: Started actual BG update checking

2023-06-27 13:18:07.948: info: Started BG update check task

2023-06-27 13:18:07.951: info: Bg update ignoreAfter is null

2023-06-27 13:18:08.047: info: Cleared 8 logs (before = 2023-06-20 13:18:07.948083, after = null)

2023-06-27 13:18:08.365: info: Started actual BG update checking

2023-06-27 13:40:25.993: info: BG update checking found 1 update - will notify user if needed

2023-06-27 13:40:25.995: info: Finished BG update check task

2023-06-27 16:18:30.171: info: Started BG update check task

2023-06-27 16:18:30.189: info: Bg update ignoreAfter is null

2023-06-27 16:18:30.203: info: Cleared 4 logs (before = 2023-06-20 16:18:30.164460, after = null)

2023-06-27 16:18:30.528: info: Started actual BG update checking

2023-06-27 16:35:48.934: info: BG update checking found 0 updates - will notify user if needed

2023-06-27 16:35:48.934: info: Finished BG update check task

2023-06-27 17:50:11.860: info: Cleared 2 logs (before = 2023-06-20 17:50:11.793037, after = null)

2023-06-27 20:56:36.128: info: Started BG update check task

2023-06-27 20:56:36.131: info: Bg update ignoreAfter is null

2023-06-27 20:56:36.188: info: Cleared 6 logs (before = 2023-06-20 20:56:36.127171, after = null)

2023-06-27 20:56:36.554: info: Started actual BG update checking

2023-06-27 21:04:24.560: info: BG update checking found 1 update - will notify user if needed

2023-06-27 21:04:24.561: info: Finished BG update check task

2023-06-28 07:28:48.199: info: Started BG update check task

2023-06-28 07:28:48.202: info: Bg update ignoreAfter is null

2023-06-28 07:28:48.339: info: Cleared 21 logs (before = 2023-06-21 07:28:48.198373, after = null)

2023-06-28 07:28:48.882: info: Started actual BG update checking

2023-06-28 07:29:11.666: info: Started BG update check task

2023-06-28 07:29:11.674: info: Bg update ignoreAfter is null

2023-06-28 07:29:12.157: info: Started actual BG update checking

2023-06-28 07:30:49.440: info: BG update checking found 1 update - will notify user if needed

2023-06-28 07:30:49.440: info: Finished BG update check task

2023-06-28 07:31:00.329: info: BG update checking found 0 updates - will notify user if needed

2023-06-28 07:31:00.329: info: Finished BG update check task

2023-06-28 07:32:27.130: error: Cannot install an older version of an App: [com.brave.browser]

Connection refused: [chat.delta.lite, dev.imranr.obtainium]

2023-06-28 07:32:58.622: error: Cannot install an older version of an App: [com.brave.browser]

Connection refused: [dev.imranr.obtainium]

2023-06-28 07:36:39.347: error: Cannot install an older version of an App: [com.brave.browser]

2023-06-28 07:36:59.333: error: Cannot install an older version of an App: [com.brave.browser]

2023-06-28 07:37:07.670: error: Cannot install an older version of an App: [com.brave.browser]

2023-06-28 07:37:24.070: info: Cleared 3 logs (before = 2023-06-21 07:37:24.021659, after = null)

2023-06-28 07:38:40.120: error: Cannot install an older version of an App: [com.brave.browser]

2023-06-28 07:41:35.692: error: Cannot install an older version of an App: [com.brav22nd e.browser]

2023-06-28 07:43:01.507: info: Cleared 3 logs (before = 2023-06-21 07:43:01.456443, after = null)

2023-06-28 07:43:11.153: error: Cannot install an older version of an App: [com.brave.browser]

ImranR98 commented 1 year ago

What non specific error do you get?

S7venLights commented 1 year ago

I don't remember but I'll look out for it again. But I think it's those connection refused ones in the logs above (starting from the 28th)

deepu2 commented 1 year ago

Screenshot_2023-07-03-14-23-54-506_dev.imranr.obtainium.jpg

I get this error too, I'm facing this since maybe 2 days. I've reinstalled and checked too.

Logs from fresh install:

2023-07-03 14:28:54.613: info: firstRun

2023-07-03 14:29:23.297: error: ClientException: Connection closed while receiving data, uri=https://objects.githubusercontent.com/github-production-release-asset-2e65be/655339559/585f6639-474a-4251-88d5-0bf7c5745a63?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230703%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230703T085921Z&X-Amz-Expires=300&X-Amz-Signature=030e928f3d5a9c5e083797aee60dd9b4cfac95ceb20a53d624059577742b4e4d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=655339559&response-content-disposition=attachment%3B%20filename%3Dliftoff-v0.10.4-arm64-v8a-android.apk&response-content-type=application%2Fvnd.android.package-archive: [com.liftoffapp.liftoff]
S7venLights commented 1 year ago

Mine is a different error, tested again and it is a "Connection Refused" error Reproduce steps:

2023-07-02 14:50:32.126: info: Finished BG update check task then I open app and select by long press, 3 apps I want to update. First app downloads and prompts for install (I install) then: 2023-07-02 15:28:25.805: error: Connection refused: [com.androidapp.it] I now have to re-download the other two apps. This time i minimize obtainium while it downloads. get notification for opening obtainium to install. install 1 app fine, then: 2023-07-02 15:32:03.699: error: Connection refused: [dev.imranr.obtainium]

Basically I can't bulk download and install. On Pixel3 with graphene OS

1xFF commented 1 year ago

I was unable to replicate this with 3 apps from simplemobiletools on a pixel 7 with GrapheneOS. Could you give me the name of the app that was installed first, the second app that failed, and their sources? Obtainium itself cannot be included as I can't update a debug build. Also does this happen every single time you bulk update?

S7venLights commented 1 year ago

It happens every time with every >2 app updates. Other factors: I'm using a VPN (Invizible Pro) but Obtainium is excluded from going through the VPN. I'm using a Github Personal Access Token

ImranR98 commented 1 year ago

Still no idea what causes this error, but the latest version now automatically retries failed downloads 3 times: https://github.com/ImranR98/Obtainium/releases/tag/v0.13.21-beta Hopefully whatever issue you're facing is transient, and retrying will help.

deepu2 commented 1 year ago

I just checked the latest update and it doesn't help, every time it will just retry from the beginning and never completes the download. Continuing from the failed byte would mitigate this issue.

https://github.com/ImranR98/Obtainium/assets/30926681/e15a0712-e3bf-42c3-845b-6d76f48e69af

S7venLights commented 1 year ago

"never completes the download"? @deepu2 sounds like your issue is different to mine. Your error popup is also different to mine.

My downloads complete I just can't queue multiple downloads.

My error is more like: error: Connection refused: [dev.imranr.obtainium]

and I think it also says: socket errror

1xFF commented 1 year ago

I tried using a github access token and older versions of android as iirc the pixel 3 is EOL, still no luck. Does this happen with non-github sources? @deepu2 Are you also using a github access token?

deepu2 commented 1 year ago

I tried using a github access token and older versions of android as iirc the pixel 3 is EOL, still no luck. Does this happen with non-github sources? @deepu2 Are you also using a github access token?

Yes, I am.

S7venLights commented 1 year ago

This is the error I get every time with every source

ClientException with SocketExceptiorn:

Connection refused (OS Error: Connection refused, errno = 111), address = github.com, port = 37066, uri=https://github.com/tw-hx/Signal- Android/releases/download/v6.26.4.0- FOSS/Signal-Android-play-foss-prod- universal-release-signed-6.26.4.apk: [org.thoughtcrime,securesms]

ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = github.com, port = 37074, uri=https://github.com/Gedsh/ InviZible/releases/download/v1.9.2- beta/Invizible_Pro__beta_ver.1.9.2_ar m64.apk: [pan.alexander.tordnscrypt]

S7venLights commented 1 year ago

Issue seems to be resolved, will report back here if it happens again

ImranR98 commented 1 year ago

I added a 5 second wait between retries, that might be the "fix" (more of a workaround). Good enough i guess since it looks like not everyone was having this issue. Leaving the issue open for a while in case you see it again.

deepu2 commented 1 year ago

I added a 5 second wait between retries, that might be the "fix" (more of a workaround). Good enough i guess since it looks like not everyone was having this issue. Leaving the issue open for a while in case you see it again.

This still doesn't solve the issue for me, should I open a new issue? My issue is not related to this one.

The issue is every 3 or 4 seconds the connection drops while downloading and when it retries it is done from 0% and the connection would drop again and this will loop for 5 times.

Eg (current implementation):

So instead of retrying from 0% I want to retry from the last downloaded size, that way in 5 retries my download will be completed.

Sometimes the first retry might happen at around 58% and during the second retry if it starts from 58% the download would be finished in 1 retries.

ImranR98 commented 1 year ago

We can keep using this issue

ImranR98 commented 6 months ago

Failed downloads will now automatically resume if the source supports the range header: https://github.com/ImranR98/Obtainium/releases/tag/v1.0.6