Bug 1194851 - autoyast replaces $releasever in add-on repos with the version number (e.g. 15.3) in /etc/zypp/repos.d files
autoyast replaces $releasever in add-on repos with the version number (e.g. 1...
Status: CONFIRMED
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: AutoYaST
Leap 15.3
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: YaST Team
E-mail List
https://trello.com/c/ewZfX6lV
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-18 23:01 UTC by Andrew Daugherity
Modified: 2022-02-18 14:47 UTC (History)
3 users (show)

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


Attachments
AutoYaST add-on profile (1.71 KB, text/xml)
2022-01-18 23:01 UTC, Andrew Daugherity
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Daugherity 2022-01-18 23:01:34 UTC
Created attachment 855378 [details]
AutoYaST add-on profile

Summary: basically #1172477, but for AutoYaST

I have the update repos added to my autoyast profile so that the latest packages are installed from the start, rather than having to do the install and then run updates.  See the attached file for details.  (It uses my internal mirror for most repos, but this issue applies equally to download.opensuse.org.)

I've started using $releasever in the AY profile so I don't have to modify it for every new release.  This works, but the generated /etc/zypp/repos.d/*.repo files contain the specific version (e.g. 15.3) rather than $releasever, so when it comes time to upgrade to the next release, the documented upgrade procedure of 'zypper --releasever ...' will not work.

Example: <media_url>http://download.opensuse.org/update/leap/$releasever/sle/</media_url> in the AY profile gets turned into
baseurl=http://download.opensuse.org/update/leap/15.3/sle in the repo file.

Note that this only applies to the URL -- $releasever in the name is left unmodified.

It looks like this issue was originally fixed in AutoYaST in #972046; more details on GitHub: https://github.com/yast/yast-add-on/pull/28#issuecomment-291116098 .  However, the code has been refactored since then and it seems the bug has reappeared.
Comment 1 Andrew Daugherity 2022-01-18 23:06:37 UTC
A couple quick notes on things I've tried that did not fix the issue:

1) add_on_products vs. add_on_others: I've long used add-on/add_on_products for these repos and only became aware of add_on_others when I reread this section of the AutoYaST documentation just now.  (Apparently add_on_others is new for SLE/Leap 15?)  However, this bug happens the same whether I use add_on_products or add_on_others.

2) I tried wrapping one repo's URL in a CDATA block just in case there were some escaping issues, but that also did not affect anything.
Comment 2 David Diaz 2022-01-19 12:21:48 UTC
Hi Andrew,

Thanks a lot for the so detailed bug report. Much appreciated :)

Look like I broke it (ouch!) 4 years ago when refactoring the client. Basically, looks like I miss to perform a Pkg.SourceChangeUrl call around [1]. At least, it's what the previous code did [2]

@Lada, can you confirm if I'm right? I do not want to make a false assumption here (again) ;)

Thanks in advance.

[1] https://github.com/yast/yast-add-on/blob/c533e90c032bcc74d65d2a3230d0a32d3188a3fc/src/lib/add-on/clients/add-on_auto.rb#L231

[2] https://github.com/yast/yast-add-on/pull/28/files#diff-f7478c1b35d96ecd633976f16a1a4d5e76b1de9305fdc09fb95d099c8065525fR184-R187
Comment 5 David Diaz 2022-01-21 07:56:08 UTC
I have fixed it and the problem should be gone once the updates arrives to the installer

* SLE-15-SP1 / yast2-add-on 4.1.16
  - PR: https://github.com/yast/yast-add-on/pull/120
  - IBS MR: https://build.suse.de/request/show/262759

* SLE-15-SP2 / yast2-add-on 4.2.19
  - PR: https://github.com/yast/yast-add-on/pull/121
  - IBS MR: https://build.suse.de/request/show/262762

* SLE-15-SP3 / yast2-add-on 4.3.10
  - PR: https://github.com/yast/yast-add-on/pull/123
  - IBS MR: https://build.suse.de/request/show/262780

* SLE-15-SP4 / yast2-add-on 4.4.7
  - PR: https://github.com/yast/yast-add-on/pull/125
  - IBS SR: https://build.suse.de/request/show/262797
  - OBS SR: https://build.opensuse.org/request/show/947779

@maint-coord, could you please release them in the installer update channels?

Thanks!
Comment 6 Swamp Workflow Management 2022-02-04 14:22:49 UTC
SUSE-RU-2022:0336-1: An update that has two recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1194851,972046
CVE References: 
JIRA References: 
Sources used:
SUSE Linux Enterprise Module for Basesystem 15-SP3 (src):    yast2-add-on-4.3.10-150300.3.8.1
SUSE Linux Enterprise Installer 15-SP3 (src):    yast2-add-on-4.3.10-150300.3.8.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 7 Swamp Workflow Management 2022-02-04 14:28:56 UTC
openSUSE-RU-2022:0336-1: An update that has two recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1194851,972046
CVE References: 
JIRA References: 
Sources used:
openSUSE Leap 15.3 (src):    yast2-add-on-4.3.10-150300.3.8.1
Comment 8 Sergio Rafael Lemke 2022-02-10 09:12:19 UTC
For the installer change on 15.4:

We don't do channel changes to 15-SP4 yet, not until the product is gold.
The reason being is we will have to refresh the channels and will overwrite any manual change.

For yast2-add-on on SLE-15-SP1/SP2/SP3 it is part of the installer channels as requested.

thanks!
Comment 9 Andrew Daugherity 2022-02-10 21:39:02 UTC
Now that it's hit the 15.3 update channel, I've added the package to my installer self-update repo and confirmed that the repo files are now written correctly.  Thanks!

While running the test installation, I noticed another minor, potentially unrelated bug:  the repo names displayed on the installation progress screen show a blank space instead of the parsed variable.  For example, the attachment from my original report has a repo with "<name>openSUSE Leap $releasever OSS</name>", but the installer just displays "openSUSE Leap  OSS" rather than "openSUSE Leap 15.3 OSS".  'zypper lr' and the YaST repository manager do display it correctly.

Not a big deal, at least the installed system is now correct! :-)
Comment 10 David Diaz 2022-02-15 10:05:49 UTC
(In reply to Sergio Rafael Lemke from comment #8)
> For the installer change on 15.4:
> 
> We don't do channel changes to 15-SP4 yet, not until the product is gold.
> The reason being is we will have to refresh the channels and will overwrite
> any manual change.
> 
> For yast2-add-on on SLE-15-SP1/SP2/SP3 it is part of the installer channels
> as requested.
> 
> thanks!

Thank you, Sergio! Of course, I meant installer channels for SP1, SP2, and SP3.
Comment 11 David Diaz 2022-02-15 12:20:56 UTC
(In reply to Andrew Daugherity from comment #9)
> Now that it's hit the 15.3 update channel, I've added the package to my
> installer self-update repo and confirmed that the repo files are now written
> correctly.  Thanks!

Great!


> 
> While running the test installation, I noticed another minor, potentially
> unrelated bug:  the repo names displayed on the installation progress screen
> show a blank space instead of the parsed variable.  For example, the
> attachment from my original report has a repo with "<name>openSUSE Leap
> $releasever OSS</name>", but the installer just displays "openSUSE Leap 
> OSS" rather than "openSUSE Leap 15.3 OSS".  'zypper lr' and the YaST
> repository manager do display it correctly.
> 
> Not a big deal, at least the installed system is now correct! :-)

I did a test installation right now, but I was not able to spot it. However, after looking at the logs looks like something comming from Package.cc[1]. Not completely sure. Asking @Ladislav to see if he can help here.

> ➜ grep "Pkg::PkgMediaNames result:" y2log*
> y2log:2022-02-15 06:37:34 <1> install(2744) [Pkg] Package.cc(PkgMediaNames):278 Pkg::PkgMediaNames result: [..., ["Testing AutoYaST - openSUSE Leap 15.3 Non-OSS", 2]]
> y2log-1:2022-02-15 06:24:06 <1> install(12161) [Pkg] Package.cc(PkgMediaNames):278 Pkg::PkgMediaNames result: [..., ["Testing AutoYaST - openSUSE Leap  Non-OSS", 5]]
> y2log-1:2022-02-15 06:29:28 <1> install(12161) [Pkg] Package.cc(PkgMediaNames):278 Pkg::PkgMediaNames result: [..., ["Testing AutoYaST - openSUSE Leap  Non-OSS", 5]]
> y2log-1:2022-02-15 06:29:33 <1> install(12161) [Pkg] Package.cc(PkgMediaNames):278 Pkg::PkgMediaNames result: [..., ["Testing AutoYaST - openSUSE Leap  Non-OSS", 5]]
> y2log-1:2022-02-15 06:29:34 <1> install(12161) [Pkg] Package.cc(PkgMediaNames):278 Pkg::PkgMediaNames result: [..., ["Testing AutoYaST - openSUSE Leap  Non-OSS", 5]]


[1] https://github.com/yast/yast-pkg-bindings/blob/master/src/Package.cc
Comment 12 Ladislav Slezák 2022-02-15 12:24:54 UTC
My guess is that the $releasever value is not set during installation yet...
Comment 13 David Diaz 2022-02-15 14:07:56 UTC
(In reply to Ladislav Slezák from comment #12)
> My guess is that the $releasever value is not set during installation yet...

Ok, thank you!

Tracked to be addressed when time and priorities permit it.
Comment 14 Swamp Workflow Management 2022-02-18 14:44:50 UTC
SUSE-RU-2022:0512-1: An update that has two recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1194851,972046
CVE References: 
JIRA References: 
Sources used:
SUSE Manager Server 4.1 (src):    yast2-add-on-4.2.19-3.9.1
SUSE Manager Retail Branch Server 4.1 (src):    yast2-add-on-4.2.19-3.9.1
SUSE Manager Proxy 4.1 (src):    yast2-add-on-4.2.19-3.9.1
SUSE Linux Enterprise Server for SAP 15-SP2 (src):    yast2-add-on-4.2.19-3.9.1
SUSE Linux Enterprise Server 15-SP2-LTSS (src):    yast2-add-on-4.2.19-3.9.1
SUSE Linux Enterprise Server 15-SP2-BCL (src):    yast2-add-on-4.2.19-3.9.1
SUSE Linux Enterprise Realtime Extension 15-SP2 (src):    yast2-add-on-4.2.19-3.9.1
SUSE Linux Enterprise Installer 15-SP2 (src):    yast2-add-on-4.2.19-3.9.1
SUSE Linux Enterprise High Performance Computing 15-SP2-LTSS (src):    yast2-add-on-4.2.19-3.9.1
SUSE Linux Enterprise High Performance Computing 15-SP2-ESPOS (src):    yast2-add-on-4.2.19-3.9.1
SUSE Enterprise Storage 7 (src):    yast2-add-on-4.2.19-3.9.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 15 Swamp Workflow Management 2022-02-18 14:47:24 UTC
SUSE-RU-2022:0515-1: An update that has two recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1194851,972046
CVE References: 
JIRA References: 
Sources used:
SUSE Linux Enterprise Server for SAP 15-SP1 (src):    yast2-add-on-4.1.16-3.16.1
SUSE Linux Enterprise Server 15-SP1-LTSS (src):    yast2-add-on-4.1.16-3.16.1
SUSE Linux Enterprise Server 15-SP1-BCL (src):    yast2-add-on-4.1.16-3.16.1
SUSE Linux Enterprise Installer 15-SP1 (src):    yast2-add-on-4.1.16-3.16.1
SUSE Linux Enterprise High Performance Computing 15-SP1-LTSS (src):    yast2-add-on-4.1.16-3.16.1
SUSE Linux Enterprise High Performance Computing 15-SP1-ESPOS (src):    yast2-add-on-4.1.16-3.16.1
SUSE Enterprise Storage 6 (src):    yast2-add-on-4.1.16-3.16.1
SUSE CaaS Platform 4.0 (src):    yast2-add-on-4.1.16-3.16.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.