Bug 1178233 - zypper up does not report any updates in WSL after longer pause
Summary: zypper up does not report any updates in WSL after longer pause
Status: RESOLVED WORKSFORME
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: libzypp (show other bugs)
Version: Current
Hardware: Other Other
: P3 - Medium : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-28 16:44 UTC by Lubos Kocman
Modified: 2023-05-05 08:30 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
broken.tar.xzaa (split file) (9.54 MB, application/octet-stream)
2022-11-23 18:15 UTC, Andreas Stieger
Details
broken.tar.xzab (split file) (9.54 MB, application/octet-stream)
2022-11-23 18:15 UTC, Andreas Stieger
Details
broken.tar.xzac (split file) (9.54 MB, application/octet-stream)
2022-11-23 18:16 UTC, Andreas Stieger
Details
broken.tar.xzad (split file) (9.54 MB, application/octet-stream)
2022-11-23 18:16 UTC, Andreas Stieger
Details
broken.tar.xzae (split file) (5.69 MB, application/octet-stream)
2022-11-23 18:19 UTC, Andreas Stieger
Details
zypper.log from zypper dup on a stale cache, showing the issue (46.61 KB, text/plain)
2022-11-23 18:32 UTC, Andreas Stieger
Details
zypper.log on a cleaned cache directory (85.76 KB, text/plain)
2022-11-23 18:33 UTC, Andreas Stieger
Details
zypper.log on a cleaned cache directory (fixed logging) (680.24 KB, application/octet-stream)
2022-11-26 06:30 UTC, Andreas Stieger
Details
zypper.log from zypper dup on a stale cache (fixed logging) (681.55 KB, application/octet-stream)
2022-11-26 06:33 UTC, Andreas Stieger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lubos Kocman 2020-10-28 16:44:33 UTC
I do have WSL images with Leap 15.2 and it seems that zypper doesn't register outdated repodata cache.

Let's say that I'd  start WSL image (bash session) once per two weeks, and if I simply run "zypper up" after these two weeks zypper reports no update, until I clean repodata 

I didn't call refresh simply up && clean --all && up

and that worked fine. However I'd like to avoid situation when zypper simply reports no update with sporadically WSL use and user gets to believe it.

My initial thought it's that this is caused by not having any services running inside the "container", however Ludwig things something might be wrong with the date/time inside the image.
Comment 1 Andreas Stieger 2022-11-23 17:35:42 UTC
I have been having this issue on TW WSL. It is now reproducible. Moving to libzypp maintainers, adding a tar with a broken cache.

zypper ref (and all other refresh options) always attempts to refresh but never does. zypper ref -f does not fix the situation. rm does.
Comment 2 Michael Andres 2022-11-23 17:48:18 UTC
Andreas, please also add the zypper.log showing your issue.
Comment 3 Andreas Stieger 2022-11-23 18:15:14 UTC
Created attachment 863075 [details]
broken.tar.xzaa (split file)
Comment 4 Andreas Stieger 2022-11-23 18:15:41 UTC
Created attachment 863076 [details]
broken.tar.xzab (split file)
Comment 5 Andreas Stieger 2022-11-23 18:16:08 UTC
Created attachment 863077 [details]
broken.tar.xzac (split file)
Comment 6 Andreas Stieger 2022-11-23 18:16:26 UTC
Created attachment 863078 [details]
broken.tar.xzad (split file)
Comment 7 Andreas Stieger 2022-11-23 18:19:31 UTC
Created attachment 863079 [details]
broken.tar.xzae (split file)

join broken.tar.xzaa ... broken.tar.xzae
assumes a non-up to date WSL TW.

rm -rf /var/cache/zypp/*
pushd /var/cache/zypp/
tar -xf ~/broken.tar.xz --strip=3 -p
zypper dup
:: no action
rm -rf /var/cache/zypp/*
zypper dup

has updates.
Comment 8 Andreas Stieger 2022-11-23 18:21:12 UTC
Corresponding repository configuration:

# | Alias        | Name                        | Enabled | GPG Check | Refresh | Type   | URI
--+--------------+-----------------------------+---------+-----------+---------+--------+---------------------------------------------------------
1 | repo-debug   | openSUSE-Tumbleweed-Debug   | No      | ----      | ----    | NONE   | http://download.opensuse.org/debug/tumbleweed/repo/oss/
2 | repo-non-oss | openSUSE-Tumbleweed-Non-Oss | No      | ----      | ----    | NONE   | http://download.opensuse.org/tumbleweed/repo/non-oss/
3 | repo-oss     | openSUSE-Tumbleweed-Oss     | Yes     | (r ) Yes  | Yes     | rpm-md | http://download.opensuse.org/tumbleweed/repo/oss/
4 | repo-source  | openSUSE-Tumbleweed-Source  | No      | ----      | ----    | NONE   | http://download.opensuse.org/source/tumbleweed/repo/oss/
5 | repo-update  | openSUSE-Tumbleweed-Update  | Yes     | (r ) Yes  | Yes     | rpm-md | http://download.opensuse.org/update/tumbleweed/
Comment 9 Andreas Stieger 2022-11-23 18:32:20 UTC
Created attachment 863080 [details]
zypper.log from zypper dup on a stale cache, showing the issue

2022-11-23 19:27:38 <1> HOSTNAME(4871) [zypp-core++] socket.cc(fromSocket):550 {T:Zypp-Log} Error querying socket domain:

Not sure if this is expected, I also see this message on a working run with a cleared cache.
Comment 10 Andreas Stieger 2022-11-23 18:33:00 UTC
Created attachment 863081 [details]
zypper.log on a cleaned cache directory

zypper.log on a cleaned cache directory - for comparison
Comment 11 Andreas Stieger 2022-11-23 18:38:16 UTC
"long pause", without strong data, is roughly one week.
Comment 12 Michael Andres 2022-11-23 19:08:12 UTC
Looks like even logging is broken on WSL. Without this being fixed it's hard to tell anything.
Comment 13 Michael Andres 2022-11-23 19:19:51 UTC
The cache itself seems to be fine.
Comment 14 Andreas Stieger 2022-11-23 19:29:47 UTC
Correct. The old cache applied to an updated system naturally prompts for downgrades. Issue may be in cache invalidation.
Comment 15 Michael Andres 2022-11-23 20:13:40 UTC
The cache you attached appears to be up-to-date. The tarball contains 
 3376 Nov 14 14:25 054c8835...0eba2413-primary.xml.gz
  992 Nov 14 14:25 bb54085f...f050a90c-updateinfo.xml.gz
which is what I also see at 
 https://download.opensuse.org/update/tumbleweed/repodata/
Comment 16 Michael Andres 2022-11-23 20:29:11 UTC
(In reply to Andreas Stieger from comment #7)
> tar -xf ~/broken.tar.xz --strip=3 -p
> zypper dup
> :: no action
> rm -rf /var/cache/zypp/*
> zypper dup
> 
> has updates.

- Can you remove just /var/cache/zypp/solv/@System. 'Ref' processes the repos, not the rpmdb cache. It might be the cache claims to be newer than the rpmdb.

- Or the rpmdb is broken. Revert to the 'broken' cache. Do `rpm --rebuilddb` befor the 'dup'.
Comment 17 Andreas Stieger 2022-11-23 22:18:21 UTC
(In reply to Michael Andres from comment #15)
> The cache you attached appears to be up-to-date. 

The update repo is not affected (now). Only the main OSS repo.

/var/cache/zypp # tar -xf ~/broken.tar.xz --strip=3 -p
/var/cache/zypp # zypper search -t package -s --match-exact openSUSE-release
Retrieving repository 'openSUSE-Tumbleweed-Oss' metadata ......................................................[done]
Loading repository data...
Reading installed packages...

S  | Name             | Type    | Version         | Arch   | Repository
---+------------------+---------+-----------------+--------+------------------------
i+ | openSUSE-release | package | 20221122-1949.1 | x86_64 | (System Packages)
v  | openSUSE-release | package | 20221119-1944.1 | x86_64 | openSUSE-Tumbleweed-Oss
v  | openSUSE-release | package | 20221119-1944.1 | i586   | openSUSE-Tumbleweed-Oss


(In reply to Michael Andres from comment #16)
> - Can you remove just /var/cache/zypp/solv/@System. 'Ref' processes the
> repos, not the rpmdb cache. It might be the cache claims to be newer than
> the rpmdb.

Same.

> - Or the rpmdb is broken. Revert to the 'broken' cache. Do `rpm --rebuilddb`
> befor the 'dup'.

$ rpm --rebuilddb
error: failed to replace old database with new database!
error: replace files in /usr/lib/sysimage/rpm with files from /usr/lib/sysimage/rpmrebuilddb.399 to recover

$ ls -l /usr/lib/sysimage/rpm/
total 50300
-rw-r--r-- 1 root root        0 Sep  7 13:54 .rpm.lock
-rw-r--r-- 1 root root 12931072 Nov 23 19:56 Index.db
-rw-r--r-- 1 root root 38574944 Nov 23 20:20 Packages.db

Doing that does not remove the problem. Additionally, issue can be seen via search alone, without looking at the @System source.
Comment 18 Michael Andres 2022-11-25 13:39:15 UTC
@Andreas, we included a fix for the broken logging in WSL in libzypp-17.31.6 and  will submit the version to TW today. Please add a zypper.log created by 17.31.6 and showing your issue.

(May appear earlier in zypp:Head; https://download.opensuse.org/repositories/zypp:/Head/openSUSE_Tumbleweed/)
Comment 19 Andreas Stieger 2022-11-26 06:30:46 UTC
Created attachment 863128 [details]
zypper.log on a cleaned cache directory (fixed logging)

  840  2022-11-26 07:23:20 rm -rf /var/cache/zypp/*
  841  2022-11-26 07:23:31 ZYPP_FULLLOG=1 zypper -vv dup
  842  2022-11-26 07:25:13 cp /var/log/zypper.log zypper.log-zypper-dup-on-deleted-cache.txt

Correctly refreshes and offers newer packages.
Comment 20 Andreas Stieger 2022-11-26 06:33:52 UTC
Created attachment 863129 [details]
zypper.log from zypper dup on a stale cache (fixed logging)

  829  2022-11-26 07:20:15 cd /var/cache/zypp/
[..]
  832  2022-11-26 07:20:21 tar -xf ~/broken.tar.xz --strip=3 -p
  833  2022-11-26 07:20:30 rm /var/log/zypper.log
  834  2022-11-26 07:20:41 ZYPP_FULLLOG=1 zypper -vv dup
  838  2022-11-26 07:23:06 cp /var/log/zypper.log zypper.log-zypper-dup-on-broken-cache.txt

zypper dup on the broken cache. Offers downgrades of packages to the state of the cache, indicating that the current repository state is not used.
Comment 23 Michael Andres 2023-01-12 13:57:25 UTC
Thanks for being patient and sorry for the long delay. 

The logs are fine now. What I can see so far is the raw metadata refresh being ok in both cases. The downloaded data are identical. It's 'just' a matter of building the solve cache. 

For whatever reason, the broken case omits rebuilding the solv cache for repo-oss although the repo has changed and new metadata were downloaded. 

I have to dig a bit deeper into the code to check how this could happen. The case is quite common, so I don't see by now why this happens here on WSL only. Ludwig's suspect, that something might be wrong with the date/time inside the image, could explain the behavior. But so far I don't see any hint for this.

Timestamps in the log are 2022-11-26 and the build times of the solve caches are
 1668955401    Sun Nov 20 14:43:21 2022 GMT
 1668955330    Sun Nov 20 14:42:10 2022 GMT
 1668432347    Mon Nov 14 13:25:47 2022 GMT
This looks reasonable.
Comment 24 Andreas Stieger 2023-02-27 14:06:10 UTC
Just reporting that this is no longer reproducible with these versions (and obviously all other updates to the underlying WSL...)

libzypp-17.31.8-1.1.x86_64
zypper-1.14.59-1.3.x86_64

Want to keep it open for further investigation or call it done?
Comment 26 Maintenance Automation 2023-03-16 20:30:23 UTC
SUSE-RU-2023:0788-1: An update that has nine recommended fixes can now be installed.

Category: recommended (important)
Bug References: 1178233, 1203248, 1203249, 1203715, 1204548, 1204956, 1205570, 1205636, 1206949
Sources used:
openSUSE Leap Micro 5.3 (src): libsolv-0.7.23-150400.3.3.1, libzypp-17.31.8-150400.3.14.1, zypper-1.14.59-150400.3.12.2
openSUSE Leap 15.4 (src): libsolv-0.7.23-150400.3.3.1, libzypp-17.31.8-150400.3.14.1, zypper-1.14.59-150400.3.12.2
SUSE Linux Enterprise Micro for Rancher 5.3 (src): libsolv-0.7.23-150400.3.3.1, libzypp-17.31.8-150400.3.14.1, zypper-1.14.59-150400.3.12.2
SUSE Linux Enterprise Micro 5.3 (src): libsolv-0.7.23-150400.3.3.1, libzypp-17.31.8-150400.3.14.1, zypper-1.14.59-150400.3.12.2
Basesystem Module 15-SP4 (src): libsolv-0.7.23-150400.3.3.1, libzypp-17.31.8-150400.3.14.1, zypper-1.14.59-150400.3.12.2
Development Tools Module 15-SP4 (src): libsolv-0.7.23-150400.3.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 27 Maintenance Automation 2023-03-16 20:30:30 UTC
SUSE-RU-2023:0787-1: An update that has nine recommended fixes can now be installed.

Category: recommended (important)
Bug References: 1178233, 1203248, 1203249, 1203715, 1204548, 1204956, 1205570, 1205636, 1206949
Sources used:
SUSE Linux Enterprise Server 15 SP1 (src): libsolv-0.7.23-150100.4.9.1, libzypp-17.31.8-150100.3.92.1
SUSE Linux Enterprise High Performance Computing 15 SP1 LTSS 15-SP1 (src): libsolv-0.7.23-150100.4.9.1, libzypp-17.31.8-150100.3.92.1, zypper-1.14.59-150100.3.67.2
SUSE Linux Enterprise Server 15 SP1 LTSS 15-SP1 (src): libsolv-0.7.23-150100.4.9.1, libzypp-17.31.8-150100.3.92.1, zypper-1.14.59-150100.3.67.2
SUSE Linux Enterprise Server for SAP Applications 15 SP1 (src): libsolv-0.7.23-150100.4.9.1, libzypp-17.31.8-150100.3.92.1, zypper-1.14.59-150100.3.67.2
SUSE CaaS Platform 4.0 (src): libsolv-0.7.23-150100.4.9.1, libzypp-17.31.8-150100.3.92.1, zypper-1.14.59-150100.3.67.2

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 28 Maintenance Automation 2023-03-16 20:30:38 UTC
SUSE-RU-2023:0786-1: An update that has nine recommended fixes can now be installed.

Category: recommended (important)
Bug References: 1178233, 1203248, 1203249, 1203715, 1204548, 1204956, 1205570, 1205636, 1206949
Sources used:
SUSE Linux Enterprise Server 15 SP2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1
SUSE Linux Enterprise High Performance Computing 15 SP2 LTSS 15-SP2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise High Performance Computing ESPOS 15 SP3 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise High Performance Computing LTSS 15 SP3 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Real Time 15 SP3 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Server 15 SP2 LTSS 15-SP2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Server 15 SP3 LTSS 15-SP3 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Server for SAP Applications 15 SP2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Server for SAP Applications 15 SP3 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Manager Proxy 4.2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Manager Retail Branch Server 4.2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Manager Server 4.2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Enterprise Storage 7.1 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Enterprise Storage 7 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Micro 5.1 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Micro 5.2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2
SUSE Linux Enterprise Micro for Rancher 5.2 (src): libzypp-17.31.8-150200.50.1, libsolv-0.7.23-150200.15.1, zypper-1.14.59-150200.42.2

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 29 Michael Andres 2023-03-24 17:21:35 UTC
(In reply to Andreas Stieger from comment #24)
> Just reporting that this is no longer reproducible with these versions (and
> obviously all other updates to the underlying WSL...)
> 
> libzypp-17.31.8-1.1.x86_64
> zypper-1.14.59-1.3.x86_64
> 
> Want to keep it open for further investigation or call it done?

Closing it. Please reopen if it happens again.