termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
35.55k stars 3.73k forks source link

[Bug]: Unable to truncate to 9232379236109516800 Problem hashing file - read (22: Invalid argument) #2712

Open wiwwo opened 2 years ago

wiwwo commented 2 years ago

Problem description

In a fresh new installation on LineageOs 17, getting errors in pkg upgrade

Steps to reproduce the behavior.

~ $ pkg upgrade
Checking availability of current mirror: ok
Get:1 https://grimler.se/termux-packages-24 stable InRelease [16.8 kB]
Ign:2 https://grimler.se/termux-packages-24 stable/main arm Packages
Ign:3 https://grimler.se/termux-packages-24 stable/main all Packages
Ign:2 https://grimler.se/termux-packages-24 stable/main arm Packages
Ign:3 https://grimler.se/termux-packages-24 stable/main all Packages
Err:2 https://grimler.se/termux-packages-24 stable/main arm Packages
Unable to truncate to 9232379236109516800 Problem hashing file - read (22: Invalid argument) [IP: 185.224.83.107 443]
Ign:3 https://grimler.se/termux-packages-24 stable/main all Packages
Fetched 16.8 kB in 3s (4864 B/s)
Reading package lists... Done
E: Failed to fetch https://grimler.se/termux-packages-24/dists/stable/main/binary-arm/Packages[](https://grimler.se/termux-packages-24) Unable to truncate to 9232379236109516800 Problem hashing file - read (22: Invalid argument) [IP: 185.224.83.107 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.

What is the expected behavior?

No response

System information

~ $ termux-info
Application version:
0.118.0
Packages CPU architecture:
arm
Subscribed repositories:

sources.list
deb https://grimler.se/termux-packages-24 stable main
Updatable packages:
All packages up to date
Android version:
10
Kernel build information:
Linux localhost 3.19.0-rc3-lineageos-g93a031103-dirty #0 SMP PREEMPT Mon Jul 6 22:37:57 PDT 2020 armv8l Android
Device manufacturer:
amzn
Device model:
Fire
renjieliu commented 2 years ago

Same issue on Amazon Fire HD 8 2018 (Karnak), with LineageOS 16, Android 9

$ termux-info
Application version:
0.118.0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.org/apt/termux-main/ stable main
Updatable packages:
All packages up to date
Android version:
9
Kernel build information:
Linux localhost 3.18.20-lineageos-g239986d4d55f #0 SMP PREEMPT Sat May 2 17:36:14 PDT 2020 armv8l Android
Device manufacturer:
amzn
Device model:
Fire
agnostic-apollo commented 2 years ago

Unable to truncate to 9232379236109516800

All you need is 8200petabytes of disk storage, is that so much to ask?

The error seems to be from

https://github.com/Debian/apt/blob/2d87af57ea52cb37c60103abb6468e0ad44864ff/methods/http.cc#L1017

https://github.com/Debian/apt/blob/2d87af57ea52cb37c60103abb6468e0ad44864ff/methods/basehttp.cc#L474

https://github.com/Debian/apt/blob/2d87af57ea52cb37c60103abb6468e0ad44864ff/methods/basehttp.cc#L296

https://github.com/Debian/apt/blob/2d87af57ea52cb37c60103abb6468e0ad44864ff/apt-pkg/contrib/fileutl.cc#L2375

There is likely some issue while calculating/getting TotalFileSize from request or downloading file. Passing debug options to apt should reveal more details, like running apt update -o Debug::Acquire::https=true.

Do all mirrors have same issue, after changing them with termux-change-repo (@renjieliu has different repo in sources.list)? You both have amazon fire device, so likely some device issue.

https://manpages.debian.org/unstable/apt/apt.conf.5.en.html#DEBUG_OPTIONS

androidtamer commented 2 years ago

I am just a newbie and I also have an Amazon Fire HD 8 2018 (Karnak), with LineageOS 16, Android 9. Please try the old version of termux from the Google play store, I have no idea why, but it works. Type in termux-change-repo and select both the Game repository and Science repository. For the mirror, please select A1batross. You should be able to get 50 packages that's upgradable. RUN apt upgrade, make sure you keep the default during the upgrade. Make sure you do not run termux-change-repo the second time. I would very much appreciate if the developer can fix the issue for the latest version of termux. I also want to try out the Aidlux project which is based on Termux and unfortunately it doesn't work on my Fire 8. Thanks.

wiwwo commented 2 years ago

Well, that did the trick!!! Thanks Androidtamer, you tamed it! :-D