Bug 1220499 - After migration HPC-15-SP5 to SLES-15-SP6: SUSEConnect error: Unable to detect base product
Summary: After migration HPC-15-SP5 to SLES-15-SP6: SUSEConnect error: Unable to dete...
Status: VERIFIED FIXED
Alias: None
Product: PUBLIC SUSE Linux Enterprise Server 15 SP6
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: Other Other
: P1 - Urgent : Normal
Target Milestone: ---
Assignee: Eugenio Paolantonio
QA Contact:
URL: https://openqa.suse.de/tests/13626112...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-28 05:46 UTC by Chenzi Cao
Modified: 2024-03-06 06:28 UTC (History)
3 users (show)

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


Attachments
y2log_during_upgrading (4.11 MB, application/x-bzip)
2024-02-28 05:46 UTC, Chenzi Cao
Details
Fix (1.11 KB, patch)
2024-02-28 11:10 UTC, Egbert Eich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chenzi Cao 2024-02-28 05:46:06 UTC
Created attachment 873068 [details]
y2log_during_upgrading

Steps:
- Boot HPC-15-SP5 image, register the system and its default modules + LTSS
- Fully patch the packages, de-register LTSS
- Reboot the system and perform offline migration to SLES-15-SP6 build58.1 via ProxySCC
- After migration, check the registration status

Results:
- Check the registration status by "SUSEConnect -s", the system name is not updated, see the cut of output as below:

{"name":"SUSE High Performance Computing (x86-64) test subscription","identifier":"SLES","version":"15.6","arch":"x86_64","status":"Registered","regcode":"XXXXXXXXXXXXXXX","starts_at":"2018-04-05 09:58:16 UTC","expires_at":"2100-01-01 00:00:00 UTC","subscription_status":"ACTIVE","type":"test"}

- And an error when checking "SUSEConnect --list-extensions":
SUSEConnect error: Unable to detect base product

Please see the openqa test result's screenshot as below and the attached y2log during upgrading. If more info needed here, please feel free to contact me, thanks.

## Observation

openQA test in scenario sle-15-SP6-Migration-from-SLE15-SPx-x86_64-offline_slehpc15sp5_pscc_recommended_ld@64bit fails in
[system_prepare](https://openqa.suse.de/tests/13626112/modules/system_prepare/steps/28)

## Reproducible

Fails since (at least) Build [58.1](https://openqa.suse.de/tests/13584017)


## Expected result

Last good: (unknown) (or more recent)


## Further details

Always latest result in this scenario: [latest](https://openqa.suse.de/tests/latest?arch=x86_64&distri=sle&flavor=Migration-from-SLE15-SPx&machine=64bit&test=offline_slehpc15sp5_pscc_recommended_ld&version=15-SP6)
Comment 1 Egbert Eich 2024-02-28 07:15:02 UTC
@Chenzi
Since I don't have access to the test system, could you check what's in /etc/os-release and who's file it is (rpm -qf /etc/os-release), please?
Comment 2 Egbert Eich 2024-02-28 09:54:21 UTC
Ok, I've looked into this.
The cause is that although the package sles-release-15.6 contains the link:
/etc/products.d/baseproduct
it does not get updated:
# ls -l /etc/products.d/baseproduct
lrwxrwxrwx 1 root root 12 Jun 16  2023 /etc/products.d/baseproduct -> SLE_HPC.prod

This link is definitely owned by package sles-release-15.6:
# rpm -qf /etc/products.d/baseproduct
sles-release-15.6-150600.23.8.x86_64

The reason for this is the postinstall scriptlet:
if [ -L /etc/products.d/baseproduct ] ; then
    PRODLINK=`readlink -f /etc/products.d/baseproduct`
    PRODLINK=`basename $PRODLINK`
    # bsc#1091952
    if [ $PRODLINK  == "SUSE_SLES.prod" -o $PRODLINK == "openSUSE.prod" ]; then
      ln -sf SLES.prod /etc/products.d/baseproduct
    fi
    # bsc#1057321
elif [ ! -e /etc/products.d/baseproduct ]; then
    ln -sf SLES.prod /etc/products.d/baseproduct
fi

The test `[ $PRODLINK  == "S$PRODLINK  == "USE_SLES.prod" -o $PRODLINK == "openSUSE.prod" ]` needs an `-o $PRODLINK  == SLE_HPC.prod` added.
Comment 3 Egbert Eich 2024-02-28 09:57:53 UTC
After fixing the link manually, `SUSEConnect -l` works as expected.
Comment 4 Chenzi Cao 2024-02-28 11:01:10 UTC
(In reply to Egbert Eich from comment #1)
> @Chenzi
> Since I don't have access to the test system, could you check what's in
> /etc/os-release and who's file it is (rpm -qf /etc/os-release), please?

# cat /etc/os-release
NAME="SLES"
VERSION="15-SP6"
VERSION_ID="15.6"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP6"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp6"
DOCUMENTATION_URL="https://documentation.suse.com/"

# rpm -qf /etc/os-release
sles-release-15.6-150600.24.7.x86_64
Comment 5 Chenzi Cao 2024-02-28 11:06:46 UTC
(In reply to Egbert Eich from comment #3)
> After fixing the link manually, `SUSEConnect -l` works as expected.

Thank you, then I reassign it to you now, and please feel free to reassign whenever necessary, thanks.
Comment 6 Egbert Eich 2024-02-28 11:10:44 UTC
Created attachment 873078 [details]
Fix

Attached patch adds the missing test for SLE_HPC.prod to the sles-release post-install scriptlet.
Comment 7 Egbert Eich 2024-02-28 11:18:05 UTC
@Eugenio, would you merge above patch to SUSE:SLE-15-SP6:GA/000package-groups, please? 

I'm not going to submit as there is still SR#320609 pending.
Comment 8 Eugenio Paolantonio 2024-02-28 11:32:25 UTC
Thank you very much Egbert, will apply on my local branch.

Apologies for missing SR#320609... I did the change by myself but sorted apptainer-sle15_6 rather than apptainer-sle15. Will amend that as well.
Comment 9 Egbert Eich 2024-02-28 12:15:07 UTC
apptainer-sle15_6 is actually correct. 
Did I have this wrong in SR#320609? I cannot check any more ...
Comment 10 Egbert Eich 2024-02-28 13:51:31 UTC
@Chenzi - FYI:
1. Online migration (from SLE HPC 15 SP5) using `zypper migration` suffers from  
   the same problem with the same root cause and fix. Any ticket regarding this  
   would be a duplicate of this one.
2. Online migration (from SLE HPC 15 SP5) using `yast migration` suffers from a 
   more fundamental problem (bsc#1220567). This likely requires fixes to yast 
   components in 15SP5 and earlier.
Comment 12 Egbert Eich 2024-02-29 17:45:17 UTC
Fix has been integrated.
Comment 13 Chenzi Cao 2024-03-01 06:57:27 UTC
The issue is still reproducible on build59.2 result:
https://openqa.suse.de/tests/13644282#step/system_prepare/25

I'll keep eyes on the testing and will verify the bug report when the case pass, thank you!
Comment 14 Chenzi Cao 2024-03-05 07:11:22 UTC
@Egbert, This is the latest test result, there's no errors now.

Just a minor question that is it design that keep the original product name after name here? Please see the output of SUSEConnect --status-text after migration:

Installed Products:
------------------------------------------

  SUSE Linux Enterprise Server 15 SP6
  (SLES/15.6/x86_64)

  Registered
  
    Subscription:

    Name: SUSE High Performance Computing (x86-64) test subscription
    Regcode: XXXXXXXXXXXXXXXX
    Starts at: 2018-04-05 09:58:16 UTC
    Expires at: 2100-01-01 00:00:00 UTC
    Status: ACTIVE
    Type: test
  

------------------------------------------

Openqa job:
https://openqa.suse.de/tests/13715255#step/system_prepare/19

Same with SUSEConnect -s:
https://openqa.suse.de/tests/13715255#step/system_prepare/20

The name is still HPC, but no problem with detect base product now.
Comment 15 Egbert Eich 2024-03-05 12:57:38 UTC
(In reply to Chenzi Cao from comment #14)
> @Egbert, This is the latest test result, there's no errors now.
> 
> Just a minor question that is it design that keep the original product name
> after name here? Please see the output of SUSEConnect --status-text after
> migration:

That's the subscription, not the product name. I have no idea where this comes from - @Tom?
Comment 16 Thomas Schmidt 2024-03-05 13:09:01 UTC
It's the name of the used subscription, this comes from SCC. 
That's fine, I don't think we are going to rename existing subscriptions.
Comment 17 Egbert Eich 2024-03-05 13:43:51 UTC
Thanks Tom!
NOTE: There is still a subscription for the HPC SKU - which is sold with different T&Cs and prices compared to SLES.
Comment 18 Chenzi Cao 2024-03-06 06:28:52 UTC
Thanks, then I verify here.
https://openqa.suse.de/tests/13715255#step/system_prepare/22