Bug 1806303 - Cannot unset a default stream with an update
Summary: Cannot unset a default stream with an update
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: libmodulemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1807832
TreeView+ depends on / blocked
 
Reported: 2020-02-23 17:34 UTC by Igor Raits
Modified: 2023-11-23 08:20 UTC (History)
15 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-11-24 19:28:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Igor Raits 2020-02-23 17:34:45 UTC
Description of problem:
In https://pagure.io/releng/fedora-module-defaults/c/5ebe9aa22cdb63f2b7dddf74c613e5f9c76eff6e?branch=f31 we have removed defaults for all Rust modules, but DNF still thinks that they are default and tries to install content from them.

Version-Release number of selected component (if applicable):
libdnf-0.43.1-2.fc31.x86_64
dnf-4.2.18-1.fc31.noarch

How reproducible:
Always.

Steps to Reproduce:
1. Run fedora:31 container
2. Try to install ripgrep

Actual results:
Enables modular streams.

Expected results:
Installs non-modular content.

Additional info:
[root@4f733b2b8a33 yum.repos.d]# dnf install ripgrep
Last metadata expiration check: 0:02:20 ago on Sun Feb 23 17:28:01 2020.
Dependencies resolved.
===============================================================================
 Package   Arch     Version                             Repository        Size
===============================================================================
Installing:
 ripgrep   x86_64   11.0.2-1.module_f31+5277+6a997f58   fedora-modular   1.4 M
Enabling module streams:
 ripgrep            latest                                                    

Transaction Summary
===============================================================================
Install  1 Package

Total download size: 1.4 M
Installed size: 4.3 M
Is this ok [y/N]: n
Operation aborted.
[root@4f733b2b8a33 yum.repos.d]# dnf install tokei
Last metadata expiration check: 0:02:26 ago on Sun Feb 23 17:28:01 2020.
Dependencies resolved.
===============================================================================
 Package Arch     Version                               Repository        Size
===============================================================================
Installing:
 tokei   x86_64   10.0.1-2.module_f31+6559+88f5b3b0     fedora-modular   1.1 M
Enabling module streams:
 tokei            rolling                                                     

Transaction Summary
===============================================================================
Install  1 Package

Total download size: 1.1 M
Installed size: 3.4 M
Is this ok [y/N]: n
Operation aborted.

---

[root@4f733b2b8a33 yum.repos.d]# dnf install ffsend
Last metadata expiration check: 0:05:12 ago on Sun Feb 23 17:28:01 2020.
Dependencies resolved.
===============================================================================
 Package  Arch     Version                              Repository        Size
===============================================================================
Installing:
 ffsend   x86_64   0.2.49-1.module_f31+5376+bde064f8    fedora-modular   2.2 M
Installing weak dependencies:
 xsel     x86_64   1.2.0-25.fc31                        fedora            28 k
Enabling module streams:
 ffsend            latest                                                     

Transaction Summary
===============================================================================
Install  2 Packages

Total download size: 2.2 M
Installed size: 6.4 M
Is this ok [y/N]: n
Operation aborted.
[root@4f733b2b8a33 yum.repos.d]# dnf install --disablerepo=fedora-modular,home_ignatenkobrain_rust ffsend
Last metadata expiration check: 0:05:39 ago on Sun Feb 23 17:27:41 2020.
Dependencies resolved.
===============================================================================
 Package         Architecture    Version                Repository        Size
===============================================================================
Installing:
 ffsend          x86_64          0.2.57-1.fc31          updates          2.3 M
Installing weak dependencies:
 xsel            x86_64          1.2.0-25.fc31          fedora            28 k

Transaction Summary
===============================================================================
Install  2 Packages

Total download size: 2.3 M
Installed size: 6.8 M
Is this ok [y/N]: n
Operation aborted.

---

This is really important bug since nobody can get any fixes for the content which used to be in modules.

And no, this is supposed to happen during lifecycle of the release, not when people upgrade to next version of distribution

Comment 1 Daniel Mach 2020-02-24 13:05:36 UTC
This is expected behavior.

$ podman pull fedora:31
$ podman run -it fedora:31
$ dnf module list ripgrep
Fedora Modular 31 - x86_64
Name     Stream      Profiles    Summary                                             
ripgrep  latest [d]  default [d] Line oriented search tool using Rust's regex library

Fedora Modular 31 - x86_64 - Updates
Name     Stream      Profiles    Summary                                             
ripgrep  latest [d]  default [d] Line oriented search tool using Rust's regex library

^^^ it shows ripgrep:latest as the default stream

I believe the problem is that fedora-modular still has the default defined.
It must be removed also from this repo.
Module metadata incl. defaults work across repositories by definition.

Comment 3 Daniel Mach 2020-02-24 14:37:49 UTC
In that case, we need to put the defaults back to the updates, but with empty stream:

document: modulemd-defaults
version: 1
data:
    module: ripgrep
    stream:



Steps for testing the solution:

FROM fedora:31
# turn off zchunk so we can easily access yaml content from command line
RUN echo "zchunk=0" >> /etc/dnf/dnf.conf
RUN dnf -y makecache
RUN dnf -y install less createrepo_c
RUN mkdir -p /opt/ripgrep \
    && cd /opt/ripgrep \
    && echo -e "document: modulemd-defaults\nversion: 1\ndata:\n    module: ripgrep\n    stream:\n" > ripgrep-defaults.yaml \
    && createrepo_c . \
    && modifyrepo_c --mdtype=modules ripgrep-defaults.yaml repodata/ \
    && echo -e "[ripgrep-defaults-override]\nbaseurl=file:///opt/ripgrep/\nenabled=1\n" > /etc/yum.repos.d/ripgrep-defaults-override.repo
RUN dnf -y module list ripgrep

Comment 4 Daniel Mach 2020-02-24 14:42:27 UTC
One more thing: to be honest, I don't recall how modulemd priorities work when defaults merge.

I tested this with following names in case file name or repoid order matters:
ripgrep-defaults-override (> fedora-modular)
aaa-ripgrep-defaults-override (< fedora-modular)

Both cases seem to work fine.

Comment 5 Miro Hrončok 2020-02-26 15:05:30 UTC
> This is expected behavior.

Expected by who?

Comment 6 Miro Hrončok 2020-02-27 10:43:27 UTC
As shown in https://www.reddit.com/r/Fedora/comments/fa9yac/modular_repo_provides_older_package_than_updates/ this is most certainly not expected by our users.

Comment 7 Daniel Mach 2020-02-28 08:55:22 UTC
(In reply to Miro Hrončok from comment #5)
> > This is expected behavior.
> 
> Expected by who?

Expected by modularity specifications we were getting from the former Modularity team.
We should check if it's documented properly. If not, we need to fix it.

It doesn't matter from which repos modulemd and related yaml documents come.
They are merged and used globally.

This scenario is similar to:
* package foo is in the fedora repo
* package foo is *not* in the updates repo
* -> package foo is still available, because it wasn't obsoleted

Creating modulemd-defaults document with empty stream is such override/obsolete.

Comment 8 Ben Cotton 2020-11-03 17:25:58 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Ben Cotton 2020-11-24 19:28:20 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 10 Miro Hrončok 2020-11-24 19:41:25 UTC
This has slipped through, it still happens this way when defaults are in play.

Comment 11 Ben Cotton 2021-02-09 16:23:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 12 Petr Pisar 2022-02-08 09:02:57 UTC
I also find this behavior nonintuitive. Specification of modulemd-defaults reads:

  When merging, entries with a newer 'modified' value will override any earlier values.

I think it's not clear whether "entries" refer to whole modulemd-defaults documents, or to particular entries fields the documents. Now it behaves per fields. These two documents:

document: modulemd-defaults
version: 1
data:
    modified: 1
    module: ripgrep
    stream: latest
    profiles:
        latest: [more]

document: modulemd-defaults
version: 
data:
    modified: 2
    module: ripgrep
    profiles:
        else: [less]

merge into:

document: modulemd-defaults
version: 1
data:
    modified: 2
    module: ripgrep
    stream: latest
    profiles:
        latest: [more]
        else: [less]

The reasoning is that the "else" stream can be added by a third-party in a different repository without intention to change/define a default stream. It only wants to set a default profile for the new "else" stream. Technically, the third-party supplier could use "modified: 1", but what if he needs to release a new update through out his own updates repository? Then he needs to increase the modified value and will get it higher than what Fedora provides. Hence the modulemd-obsoletes are basically additive.

There three options:

(1) We can claim that distribution is not intended to change a default stream and close this report as NOTABUG. But that will prevent from fixing accidentally set default streams, and upgrading to a new Fedora where the maintainer decided for no default stream (e.g. he demodularized it; the case if a report).

(2) We can change the behavior and unset a default stream if there is none in a document of the highest modified. Then we will need to teach third-parties to copy the default stream from Fedora. I think this is terrible because the third-party will have to watch Fedora an carry that magical value he does not need for anything.

(3) We can introduce a new syntax for unsetting a default stream. Either with "stream:" or "stream: ''". The first undefined value looks like a typo and would be difficult to implement for libmodulemd (because how it uses libyaml). The other one with an empty string is more verbose and easy to handle in libmodulemd. Though with both approaches the unset value would be represented in libmodulemd's API to the applications as no default stream. It would be correctly handled when merging multiple documents but there would be no introspection way to distinguish never-set and unset cases. But that would not affect DNF. Theoretically I could add a new function into libmodulemd to deliver that distinction, if requested.

Comment 13 Miro Hrončok 2022-02-08 09:49:48 UTC
(3) sounds good. It could be an explicit null value.

Thanks for looking at this.

Comment 14 Petr Pisar 2022-02-08 11:27:50 UTC
Moving to libmodulemd component as this the place when the enhancement will be implemented. I guess that DNF does not want to add any special handling.

Comment 15 Ben Cotton 2022-02-08 20:06:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 16 Ben Cotton 2023-04-25 18:22:07 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 17 Aoife Moloney 2023-11-23 00:02:54 UTC
This message is a reminder that Fedora Linux 37 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '37'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 37 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.


Note You need to log in before you can comment on or make changes to this bug.