void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.59k stars 2.15k forks source link

tz-data won't update on armv6 armv7 #40357

Open beginner3456789 opened 2 years ago

beginner3456789 commented 2 years ago

Is this a new report?

Yes

System Info

Void 5.15.72_1 armv7l Unknown uptodate hold rFFFF

Package(s) Affected

tz-data-2022f_2

Does a report exist for this bug with the project's home (upstream) and/or another distro?

unknown

Expected behaviour

The tz-data failed and would not allow the update to continue. This happened when updating both my raspberry pi zero (armv6) and raspberry pi 2 (armv7) for the first time since almost a year ago. That happened after first updating xbps and then downloading about a hundred packages. I put the old tz-data on hold to allow the update for the rest of the packages and then tried again with the same failure as shown below. I can't find the reason with the Canada problem shown below.

Actual behaviour

-bash-5.1# xbps-pkgdb -m unhold tzdata-2021c_1 -bash-5.1# xbps-install -Su [*] Updating repository `https://repo-default.voidlinux.org/current/armv7l-repodata' ...

Name Action Version New version Download size tzdata update 2021c_1 2022f_2 -

Size required on disk: 1161KB Space available on disk: 56GB

Do you want to continue? [Y/n]

[*] Verifying package integrity tzdata-2022f_2: verifying RSA signature...

[*] Collecting package files tzdata-2022f_2: collecting files... tzdata-2021c_1: collecting files... ERROR: tzdata-2022f_2: directory `./usr/share/zoneinfo/posix/Canada' can not be deleted. Transaction failed! see above for errors. -bash-5.1#

Steps to reproduce

Problem happens when updating from 2021c_1 to 2022f_2 on both the raspberry pi zero and raspberry pi 2.

beginner3456789 commented 2 years ago

I just noted the leading dot at ./usr/share/zoneinfo/posix/Canada so maybe the relative path is the problem. Just guessing.

Duncaen commented 2 years ago

I just noted the leading dot at ./usr/share/zoneinfo/posix/Canada so maybe the relative path is the problem. Just guessing.

Thats not an issue, all files are like that.

The issue is that there is a file in that directory that is not tracked by the package manager and the directory is going to be replaced by a symlink. Since the file is untracked its considered "userdata" and xbps won't delete it, resulting it saying it can't delete the directory.

beginner3456789 commented 2 years ago

Sorry for the wild guess about the path. There must be another reason for the ERROR when trying to delete the files. The tz-data is totally stock for both the raspberry pi zero and the raspberry pi 2 so everybody who tries to update the tz-data package should also have a show-stopper while updating.

I looked inside the xbps INSTALL file and found this in zoneinfo/right/Canada/: -rw-r--r-- 1 root root 1534 May 3 2018 East-Saskatchewan and in zoneinfo/posix/Canada/: -rw-r--r-- 1 root root 994 May 3 2018 East-Saskatchewan

So taking the hint from the xbps INSTALL file I manually deleted the zoneinfo/right and zoneinfo/posix directories. Now the xbps complained about the missing files yet continued to completion without blocking:

...many similar lines not shown and finally... ERROR: tzdata-2022f_2: failed to remove obsolete entry ./usr/share/zoneinfo/right/Chile': No such file or directory ERROR: tzdata-2022f_2: failed to remove obsolete entry./usr/share/zoneinfo/posix/Asia': No such file or directory tzdata-2022f_2: removed obsolete entry: ./usr/share/zoneinfo/posixrules ERROR: tzdata-2022f_2: failed to remove obsolete entry ./usr/share/zoneinfo/right/Asia': No such file or directory ERROR: tzdata-2022f_2: failed to remove obsolete entry./usr/share/zoneinfo/posix/Etc': No such file or directory ERROR: tzdata-2022f_2: failed to remove obsolete entry ./usr/share/zoneinfo/right/Etc': No such file or directory ERROR: tzdata-2022f_2: failed to remove obsolete entry./usr/share/zoneinfo/posix/US': No such file or directory ERROR: tzdata-2022f_2: failed to remove obsolete entry `./usr/share/zoneinfo/right/US': No such file or directory

[*] Configuring unpacked packages tzdata-2022f_2: configuring ... tzdata-2022f_2: updated successfully.

0 downloaded, 0 installed, 1 updated, 1 configured, 0 removed. Press any key to continue...

This might only be a problem for other Raspberry Pi's with tz-data containing the old East-Saskatchewan entries. This fixes my Raspberries so I hope others can use this fix for this same issue.

superiums commented 2 years ago

Thanks for the solution. succeeded on my termux on android.

paper42 commented 1 year ago

related to / duplicate? of #38363

beginner3456789 commented 1 year ago

Yes, this does seem to be a duplicate of #38363. The comment where sgn commented Jul 31, 2022 about East Saskatchewan seem about the same. I ran a search for tz-data issues and failed to see these previous issues.

I rarely update my Raspberry Pis so probably failed to install the update when those East Saskatchewan entries were being removed. They were still there when the most recent update threw an ERROR for failing to remove a non-empty directory and halted. I probably could have just deleted the East Saskatchewan entries and the update would have worked?

So this issue could be joined with #38363 for convenience.

dataCobra commented 1 year ago

Hey @beginner3456789, can you confirm that the problem is fixed?

If so, please close the issue, otherwise close this issue and open #38363 please.

beginner3456789 commented 1 year ago

The issue is not fixed yet as the tzdata-2022f_2 package has not been changed from when the problem first happened and continues to refuse to upgrade normally. I feel a package blocking updates is a serious issue. I can work around the problem except there might be others who could not besides the problem being a nuisance.

This issue is similar to #38363 except that references the package tzdata-2022a_2 so that is different. The #38363 has been closed while this issue is not yet fixed:

-bash-5.1# xbps-query -s tzdata [*] tzdata-2021c_1 Time zone and daylight-saving time data -bash-5.1# xbps-install tzdata

Name Action Version New version Download size tzdata update 2021c_1 2022f_2 -

Size required on disk: 1161KB Space available on disk: 56GB

Do you want to continue? [Y/n]

[*] Verifying package integrity tzdata-2022f_2: verifying RSA signature...

[*] Collecting package files tzdata-2022f_2: collecting files... tzdata-2021c_1: collecting files... ERROR: tzdata-2022f_2: directory `./usr/share/zoneinfo/posix/Canada' can not be deleted. Transaction failed! see above for errors. -bash-5.1# date Sun Nov 27 06:49:59 AM PST 2022 -bash-5.1#

beginner3456789 commented 1 year ago

Still the same problem with the newer tzdata:

-bash-5.1# xbps-install tzdata

Name Action Version New version Download size tzdata update 2021c_1 2022g_1 225KB

Size to download: 226KB Size required on disk: 1162KB Space available on disk: 56GB

Do you want to continue? [Y/n]

[*] Downloading packages tzdata-2022g_1.armv7l.xbps.sig: 512B [avg rate: 6494KB/s] tzdata-2022g_1.armv7l.xbps: 225KB [avg rate: 51MB/s] tzdata-2022g_1: verifying RSA signature...

[*] Collecting package files tzdata-2022g_1: collecting files... tzdata-2021c_1: collecting files... ERROR: tzdata-2022g_1: directory `./usr/share/zoneinfo/posix/Canada' can not be deleted. Transaction failed! see above for errors. -bash-5.1# -bash-5.1# ls -al /usr/share/zoneinfo/posix/Canada total 34 drwxr-xr-x 2 root root 3488 Dec 22 2020 . drwxr-xr-x 18 root root 3488 Nov 7 2021 .. -rw-r--r-- 2 root root 3424 Oct 3 2021 Atlantic -rw-r--r-- 2 root root 2868 Oct 3 2021 Central -rw-r--r-- 1 root root 994 May 3 2018 East-Saskatchewan -rw-r--r-- 4 root root 3494 Oct 3 2021 Eastern -rw-r--r-- 2 root root 2332 Oct 3 2021 Mountain -rw-r--r-- 2 root root 3655 Oct 3 2021 Newfoundland -rw-r--r-- 2 root root 2892 Oct 3 2021 Pacific -rw-r--r-- 2 root root 980 Oct 3 2021 Saskatchewan -rw-r--r-- 2 root root 1614 Oct 3 2021 Yukon -bash-5.1# -bash-5.1# ls -al /usr/share/zoneinfo/right/Canada total 41 drwxr-xr-x 2 root root 3488 Nov 7 2021 . drwxr-xr-x 18 root root 3488 Nov 7 2021 .. -rw-r--r-- 2 root root 3964 Oct 3 2021 Atlantic -rw-r--r-- 2 root root 3408 Oct 3 2021 Central -rw-r--r-- 1 root root 1534 May 3 2018 East-Saskatchewan -rw-r--r-- 4 root root 4034 Oct 3 2021 Eastern -rw-r--r-- 2 root root 2872 Oct 3 2021 Mountain -rw-r--r-- 2 root root 4195 Oct 3 2021 Newfoundland -rw-r--r-- 2 root root 3432 Oct 3 2021 Pacific -rw-r--r-- 2 root root 1520 Oct 3 2021 Saskatchewan -rw-r--r-- 2 root root 2154 Oct 3 2021 Yukon -bash-5.1# uname -a Linux rp3void.lan 5.15.72_1 #1 SMP Sun Oct 16 14:46:40 UTC 2022 armv7l GNU/Linux -bash-5.1#

sgn commented 1 year ago

Please remove /usr/share/zoneinfo/posix/ and /usr/share/zoneinfo/right manually.

beginner3456789 commented 1 year ago

Yes, that would fix my computer except the Void tzdata package would still be broken.

Someplace along the way the Void tzdata package appears to have lost track of the East-Saskatchewan files so the directory is not empty when the tzdata is getting ready to change to a symbolic link causing the error. I doubt I am the only one with this problem so a quick fix on my computer just leaves the same problem for everybody else to solve.

Duncaen commented 1 year ago

There is nothing we can do about that, there are untracked files in the directory for some unknown reason, xbps does not delete untracked files (user data).

beginner3456789 commented 1 year ago

Does anything look wrong with this tzdata INSTALL file pre(remove) action? I haven't looked at these before so don't see why this doesn't work. Maybe just removing the East-Saskatchewan entries would be better during pre-remove and then the regular package update would complete the planned changes.

case "${ACTION}" in pre)

Due to some reasons, some old timezone was kept

    # The latest one would be Canada/East-Saskatchewan in 2017c
    # Don't force remove on everyone since it will spit error on update
    if [ -f usr/share/zoneinfo/right/Canada/East-Saskatchewan ]; then
            rm -rf usr/share/zoneinfo/posix
            rm -rf usr/share/zoneinfo/right
    fi
    ;;

esac

Duncaen commented 1 year ago

The scripts don't run at the stage where your update aborts, this is the file conflict/obsolete files detection where its still safe to abort the update since nothing is actually changed (or deleted in this case, xbps in this case just counts files it tracks and deletes in that directory that is supposed to be replaced with a symlink and sees that there are too many files and then aborts since it won't be able to delete that file without deleting userdata).

When the scripts run they change the system, so can't really run safely before this stage without changing the system when an actual conflict is detected and the update is aborted after running the scripts.

beginner3456789 commented 1 year ago

Thanks for the explanation Duncaen. So I have been looking into the files.plist info since that is probably where the update is halted. I found an old xbps file from my saved /var/cache/xbps backup:

tzdata-2017c_1.noarch.xbps

This doesn't have the East-Saskatchewan entries at all and they are not listed in the files.plist. Maybe that is where the tracking was dropped. I haven't yet found an older tzdata xbps except might have one on an older machine that hasn't been started for a couple of years.

I wonder if the East-Saskatchewan could be added to the files.plist and then removed in the script? Otherwise this looks like it might be one of those "won't fix" problems.

EDIT: This is strange. I found the tzdata-2018e_1.noarch.xbps dated 3 May 2018 and there is no entry anywhere for East-Saskatchewan yet my raspberry pi still has the East-Saskatchewan files dated 3 May 2018.

beginner3456789 commented 1 year ago

I found a lot of old xbps files showing where the East-Saskatchewan entry was dropped:

tzdata-2016e_1.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2016f_2.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2016g_1.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2016g_2.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2016h_1.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2016i_1.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2016j_1.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2017a_1.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2017b_1.noarch.xbps ./usr/share/zoneinfo/Canada/East-Saskatchewan

tzdata-2017c_1.noarch.xbps tar: ./usr/share/zoneinfo/Canada/East-Saskatchewan: Not found in archive

tzdata-2018c_1.noarch.xbps tar: ./usr/share/zoneinfo/Canada/East-Saskatchewan: Not found in archive

tzdata-2018d_1.noarch.xbps tar: ./usr/share/zoneinfo/Canada/East-Saskatchewan: Not found in archive

tzdata-2018e_1.noarch.xbps tar: ./usr/share/zoneinfo/Canada/East-Saskatchewan: Not found in archive

I used this script:

#!/bin/sh
for archive in tzdata-*.xbps
 do
 echo "$archive"
 tar --list ./usr/share/zoneinfo/Canada/East-Saskatchewan -f "$archive"
 echo
done