Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android pipeline build fails with unreachable mirror #5893

Closed
kralo opened this issue Jan 27, 2024 · 3 comments
Closed

android pipeline build fails with unreachable mirror #5893

kralo opened this issue Jan 27, 2024 · 3 comments

Comments

@kralo
Copy link
Sponsor Contributor

kralo commented Jan 27, 2024

so sometimes, the build fails with an error like

Running command: mkdir -vp ~/.cargo/bin; yes | pkg install rust binutils openssl tar -y; echo $? > /sdcard/pkg.probe
run_termux_command with timeout=3600 / retries=10 / sleep_interval=10
/sdcard/pkg.probe
/sdcard/pkg.log: 1 file pulled, 0 skipped. 0.6 MB/s (1165 bytes in 0.002s)
==================================== SUMMARY ===================================
Command: mkdir -vp ~/.cargo/bin; yes | pkg install rust binutils openssl tar -y; echo $? > /sdcard/pkg.probe
Finished in 11 seconds.
Output was:
+ mkdir -vp /data/data/com.termux/files/home/.cargo/bin
mkdir: created directory '/data/data/com.termux/files/home/.cargo'
mkdir: created directory '/data/data/com.termux/files/home/.cargo/bin'
+ pkg install rust binutils openssl tar -y
+ yes
Testing the available mirrors:
[*] https://packages-cf.termux.org/apt/termux-main: ok
[*] https://deb.kcubeterm.me/termux-main: ok
[*] https://termux.mentality.rip/termux-main: ok
[*] https://grimler.se/termux-packages-24: ok
[*] https://termux.librehat.com/apt/termux-main: ok
Picking mirror: https://deb.kcubeterm.me/termux-main

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 https://deb.kcubeterm.me/termux-main stable InRelease [512 B]
Err:1 https://deb.kcubeterm.me/termux-main stable InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Reading package lists...
E: Failed to fetch https://deb.kcubeterm.me/termux-main/dists/stable/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'https://deb.kcubeterm.me/termux-main stable InRelease' is not signed.
+ echo 100
Return code: 100

it looks like the pkg command picks the wrong mirror, one that should have been gone at least months ago.
However, the v0.118 still has this mirror and needs user interaction, see termux/termux-app#3690

termux-change-repo presents a TUI which needs manual selection.
One possible solution is to set the softlink .../com.termux/files/usr/etc/termux/chosen_mirror -> .../com.termux/files/usr/etc/termux/mirrors/default but this is not trivial from the build script

@kralo
Copy link
Sponsor Contributor Author

kralo commented Jan 27, 2024

it looks like the android image usage really old pkg

2024-01-27 21:45:55 URL:https://objects.githubusercontent.com/github-production-release-asset-2e65be/44804216/b0b426a7-2d6f-4d40-8e3c-ce498b29cf42?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240127%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240127T214555Z&X-Amz-Expires=300&X-Amz-Signature=d129c9a52515481a8858124a22fac6f7fd34b8edf8c4260a92ab3bf44d0d539b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=44804216&response-content-disposition=attachment%3B%20filename%3Dtermux-app_v0.118.0%2Bgithub-debug_x86.apk&response-content-type=application%2Fvnd.android.package-archive [30850605/30850605] -> "termux-app_v0.118.0+github-debug_x86.apk" [1]
Running snapshot
Performing Streamed Install
Success
Prepare and install system packages
launching termux
Starting: Intent { cmp=com.termux/.HomeActivity }
waiting for launch.probe
waiting for launch.probe
WARNING | /etc/localtime does not point to zoneinfo-compatible timezone name
waiting for launch.probe
/sdcard/launch.probe
found launch.probe
removed launch.probe
Running command: mkdir -vp ~/.cargo/bin; pkg help ; termux-info; yes | pkg --check-mirror install rust binutils openssl tar -y; echo $? > /sdcard/pkg.probe
run_termux_command with timeout=3600 / retries=10 / sleep_interval=10
/sdcard/pkg.probe
/sdcard/pkg.log: 1 file pulled, 0 skipped. 1.8 MB/s (5222 bytes in 0.003s)
==================================== SUMMARY ===================================
Command: mkdir -vp ~/.cargo/bin; pkg help ; termux-info; yes | pkg --check-mirror install rust binutils openssl tar -y; echo $? > /sdcard/pkg.probe
Finished in 15 seconds.
Output was:
+ mkdir -vp /data/data/com.termux/files/home/.cargo/bin
mkdir: created directory '/data/data/com.termux/files/home/.cargo'
mkdir: created directory '/data/data/com.termux/files/home/.cargo/bin'
+ pkg help
Usage: pkg command [arguments]

A tool for managing packages. Commands:

  autoclean            - Remove all outdated packages from .deb package
                         cache.

  clean                - Remove all packages from .deb package cache.

  files <packages>     - Show all files installed by packages.

  install <packages>   - Install specified packages.

  list-all             - List all packages available in repositories.

  list-installed       - List installed packages.

  reinstall <packages> - Reinstall specified installed packages at the
                         latest version.

  search <query>       - Search package by query, for example by name or
                         description part.

  show <packages>      - Show basic metadata, such as dependencies.

  uninstall <packages> - Uninstall specified packages. Configuration files
                         will be left intact.

  upgrade              - Upgrade all installed packages to the latest
                         version.

+ termux-info
Application version:
0.118.0
Packages CPU architecture:
i686
Subscribed repositories:
# sources.list
deb https://packages.termux.org/apt/termux-main/ stable main
Updatable packages:
apt/stable 2.7.10 i686 [upgradable from: 2.3.13-3]
bash/stable 5.2.15-1 i686 [upgradable from: 5.1.12-2]
ca-certificates/stable 1:2023.08.22 all [upgradable from: 1:2021-10-26-0]
command-not-found/stable 2.4.0-8 i686 [upgradable from: 1.71]
termux-am/stable 0.8.0 all [upgradable from: 0.4]
termux-exec/stable 1:1.0 i686 [upgradable from: 1:0.9]
termux-keyring/stable 3.11 all [upgradable from: 2.4]
termux-licenses/stable 2.0-3 all [upgradable from: 2.0-1]
termux-tools/stable 1.40.5-1 all [upgradable from: 0.155]
unbound/stable 1.19.0 i686 [upgradable from: 1.13.2-1]
unzip/stable 6.0-9 i686 [upgradable from: 6.0-7]
util-linux/stable 2.39.3-3 i686 [upgradable from: 2.37.2-1]
xxhash/stable 0.8.2 i686 [upgradable from: 0.8.1]
xz-utils/stable 5.4.6 i686 [upgradable from: 5.2.5-1]
zlib/stable 1.3-3 i686 [upgradable from: 1.2.11-5]
Android version:
9
Kernel build information:
Linux localhost 4.4.124+ #1 SMP PREEMPT Mon Jun 18 17:10:07 UTC 2018 i686 Android
Device manufacturer:
unknown
Device model:
Android SDK built for x86
+ pkg --check-mirror install rust binutils openssl tar -y
+ yes
Unknown command: '--check-mirror' (run 'pkg help' for usage information)
+ echo 1
Return code: 1
================================================================================
Error: The process '/bin/sh' failed with exit code 1

@kralo
Copy link
Sponsor Contributor Author

kralo commented Jan 27, 2024

It looks like the pkg version the image is running from is
https://github.com/termux/termux-tools/blob/5b30fbf3b0306c9f3dcd67b68755d990e83f1263/packages/termux-tools/pkg

and one of those mirrors is detected as working, but is not really.

We have thus two options:
sed -i /kcubeterm/d \$(which pkg);which is really ugly,

or set

TERMUX_PKG_NO_MIRROR_SELECT which uses no mirror selection at all. Going for the first

@kralo
Copy link
Sponsor Contributor Author

kralo commented Jan 28, 2024

done in #5894

@kralo kralo closed this as completed Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant