Unable to download the app

I use Appium-Python-Client and Appium to run concurrent automated tests.
Tests sometimes fail due to app cannot be downloaded.
Ratio: 1/10

At first, it seemed like the reason is due to concurrent downloading.
However, I tested 6 concurrent curl commands downloading the same URL from the same machine and it was successful.

Can I see the reason in detail why Appium cannot download the file? Or is there something I am missing?

Here are my configurations:

Caps:
{
‘automationName’: ‘UIAutomator2’,
‘platformName’: ‘Android’,
‘appPackage’: ‘my.package.name’,
‘appActivity’: ‘.activity.SplashActivity’,
‘appWaitActivity’: ‘.MainActivity’,
‘noReset’: True,
‘fullReset’: False,
‘ignoreUnimportantViews’: True,
‘autoGrantPermissions’: True,
‘logcatFilterSpecs’: [’
:D’],
‘app’: ‘https://my-jenkins.domain.com/job/appdeploy-checker/3103/artifact/download/my-app-12_0_0-beta-releaseDebuggable-20211228001323.apk’,
‘udid’: ‘RF9N606ASQY’,
‘systemPort’: ‘8202’
}

Appium-Python-Client version:
2.1.0

appium-doctor result:
user@AD01675489-3 ~ % appium-doctor
info AppiumDoctor Appium Doctor v.1.16.0
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
info AppiumDoctor :heavy_check_mark: The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor :heavy_check_mark: Node version is 17.2.0
info AppiumDoctor :heavy_check_mark: Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor :heavy_check_mark: Xcode Command Line Tools are installed in: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor :heavy_check_mark: DevToolsSecurity is enabled.
info AppiumDoctor :heavy_check_mark: The Authorization DB is set up properly.
info AppiumDoctor :heavy_check_mark: Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.38.0
info AppiumDoctor :heavy_check_mark: HOME is set to: /Users/user
info AppiumDoctor :heavy_check_mark: ANDROID_HOME is set to: /Users/user/Library/Android/sdk
info AppiumDoctor :heavy_check_mark: JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home
info AppiumDoctor Checking adb, android, emulator
info AppiumDoctor ‘adb’ is in /Users/user/Library/Android/sdk/platform-tools/adb
info AppiumDoctor ‘android’ is in /Users/user/Library/Android/sdk/tools/android
info AppiumDoctor ‘emulator’ is in /Users/user/Library/Android/sdk/emulator/emulator
info AppiumDoctor :heavy_check_mark: adb, android, emulator exist: /Users/user/Library/Android/sdk
info AppiumDoctor :heavy_check_mark: ‘bin’ subfolder exists under ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home’
info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor ### Diagnostic for optional dependencies starting ###
info AppiumDoctor :heavy_check_mark: opencv4nodejs is installed at: /usr/local/lib. Installed version is: 5.6.0
info AppiumDoctor :heavy_check_mark: ffmpeg is installed at: /usr/local/bin/ffmpeg. ffmpeg version 4.4.1 Copyright © 2000-2021 the FFmpeg developers
info AppiumDoctor :heavy_check_mark: mjpeg-consumer is installed at: /usr/local/lib. Installed version is: 2.0.0
info AppiumDoctor :heavy_check_mark: set-simulator-location is installed
info AppiumDoctor :heavy_check_mark: idb and idb_companion are installed
info AppiumDoctor :heavy_check_mark: applesimutils is installed at: /usr/local/bin/applesimutils. Installed versions are: applesimutils 0.9.4
info AppiumDoctor :heavy_check_mark: ios-deploy is installed at: /usr/local/bin/ios-deploy. Installed version is: 1.11.4
info AppiumDoctor :heavy_check_mark: bundletool.jar is installed at: /Users/user/Library/Android/sdk/build-tools/bundletool.jar
info AppiumDoctor :heavy_check_mark: gst-launch-1.0 and gst-inspect-1.0 are installed at: /usr/local/bin/gst-launch-1.0 and /usr/local/bin/gst-inspect-1.0
info AppiumDoctor ### Diagnostic for optional dependencies completed, no fix possible. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor

Appium log:
mega_and_fail_down.txt (6.4 KB)

[debug] e[35m[W3C]e[39m Encountered internal error running command: Error: Unable to download the app: Cannot download the file from https://my-jenkins.domain.com/job/appdeploy-checker/3103/artifact/download/my-app-12_0_0-beta-releaseDebuggable-20211228001323.apk: aborted

axios client shows that the server simply aborts the request. Are there any detailed logs on the server side?

Thanks for replying.
So, I guess my file server, Jenkins, is unstable, and there is no logs in this case.
I think I can solve this by simply re-triggering the test.

I just wonder if there isn’t retrying logic in the Appium server if the first attempt of downloading was failed.

FYI, in the same case for a *.ipa file, error log looks like this:
E selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Bad app: https://my-jenkins.domain.com/job/appdeploy-checker/3108/artifact/download/MY_APP_12.0.0_2021.1228.609.ipa. App paths need to be absolute or an URL to a compressed app file: Unable to download the app: Cannot download the file from https://my-jenkins.domain.com/job/appdeploy-checker/3108/artifact/download/MY_APP_12.0.0_2021.1228.609.ipa: aborted

I guess *.apk and *.ipa generates different log and it made me a little bit confused at first until I found the log Cannot download the file.