Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_general_preconfigure: SAP Note 2369910 not correctly implemented #907

Open
rhmk opened this issue Nov 29, 2024 · 10 comments · May be fixed by #914
Open

sap_general_preconfigure: SAP Note 2369910 not correctly implemented #907

rhmk opened this issue Nov 29, 2024 · 10 comments · May be fixed by #914
Assignees
Labels
bug Something isn't working

Comments

@rhmk
Copy link
Member

rhmk commented Nov 29, 2024

According to SAP NOTE 2369910 step 3.1 the following is required:

System language
You must select English as the operating system language on all Linux hosts that are running SAP software.

For RHEL 9 this requires a check for

  • package glibc-langpack-en
  • /etc/locale.conf needs to contain LANG=en_US.UTF-8 or setting with localectl

A hardened customer baseline may have only C locale installed, which breaks e.g. installation of HANA2 SPS08

Hence this check needs to be implemented again. The whole requirements of this SAP NOTE are not checked any more in current sap_general_prconfigure, although the hostname setting is still in

@rhmk rhmk added the bug Something isn't working label Nov 29, 2024
@rhmk
Copy link
Member Author

rhmk commented Nov 29, 2024

Here is an old code snippet, but implemetaion should be similar:

- name: ensure locale is set to en_US.UTF-8
  lineinfile:
          path: /etc/locale.conf 
          regexp: '^LANG='
          line: 'LANG={{ sap_base_settings_locale }}'

### if the following throws an error SSH is configured to pass locale variables
### this is informational only, because SAP requires en_US system locale
- name: IF RED CHECK SSH CONNECTION
  shell: |
         if [ $(locale | grep "^LANG=") != "LANG={{ sap_base_settings_locale }}" ]; then
            echo "WARNING: your ssh/ansible configuration passes your locale setting which may cause trouble with SAP installation script"
            echo "         as a best practise begin all scripts with \"LANG={{ sap_base_settings_locale }}\""
         else
            echo "Language setting OK"
         fi
         . /etc/locale.conf
          if [ $(locale | grep "^LANG=") != "LANG={{ sap_base_settings_locale }}" ]; then
             echo "ERROR: Locale setup is not correct"
             exit
          else
             echo "Language setting OK"
             exit 0
          fi
  changed_when: false

@rhmk rhmk changed the title sap_general_preocnfigure: SAP NOTE 2369910 not correctly implemented sap_general_preconfigure: SAP NOTE 2369910 not correctly implemented (URGENT ISSUE) Nov 29, 2024
@berndfinger berndfinger self-assigned this Nov 29, 2024
@berndfinger berndfinger changed the title sap_general_preconfigure: SAP NOTE 2369910 not correctly implemented (URGENT ISSUE) sap_general_preconfigure: SAP note 2369910 not correctly implemented (URGENT ISSUE) Nov 29, 2024
@berndfinger
Copy link
Member

I just tested if the package glibc-langpack-en.x86_64 is installed after installing RHEL 9.4 from the RHEL 9.4 ISO image using the interactive installer (Anaconda) and selecting the Minimal install software environment. When confirming the English language as the default language, this package is installed.

But I agree that it is important to verify the presence of the required English locale and related setting in the sap_general_preconfigure role.

@rhmk rhmk changed the title sap_general_preconfigure: SAP note 2369910 not correctly implemented (URGENT ISSUE) sap_general_preconfigure: SAP NOTE 2369910 not correctly implemented Dec 2, 2024
@rhmk rhmk self-assigned this Dec 2, 2024
@rhmk rhmk changed the title sap_general_preconfigure: SAP NOTE 2369910 not correctly implemented sap_general_preconfigure: SAP Note 2369910 not correctly implemented Dec 2, 2024
@rhmk
Copy link
Member Author

rhmk commented Dec 2, 2024

I will put together a PR with the following changes:

The default system locale for SAP systems should be English. There is more than one English system locale, but en_US.utf8 is the most common. Hence I define the default variable, in case another:

  • sap_general_preconigure_default_locale: en_US.utf8

Checking Packages on RHEL which provide en_US.utf8
RHEL8 und 9:

  • glibc-langpack-en or glibc-all-langpacks
  • langpacks-en

Check for availability of locale:`locale -a | grep "{{  sap_general_preconigure_default_locale }}'
Setting locale on RHEL "localectl set-locale {{ sap_general_preconigure_default_locale }}'

@Klaas-
Copy link

Klaas- commented Dec 2, 2024

Hi,
I don't thiunk you should be using en_US.utf8 -- it uses AM/PM on RHEL9 (https://access.redhat.com/solutions/6981287) -- I am guessing you want to set LANG=C.UTF-8. https://me.sap.com/notes/2369910 does not say to use en_US.utf8

@rhmk
Copy link
Member Author

rhmk commented Dec 2, 2024

Thanks Klaas. The SAP Note says just Englisch and en_US.UTF-8 is typically used when selecting English. Interesting enough is, that localectl list-locales does not give en_US.UTF-8, but you are right it is a legal locale.
That is why we do not hardcode the locale, but check with a variable the "default locale", maybe it is ok to check if the systemlocale is starting with "en_*", but maybe not

@marcelmamula
Copy link
Contributor

marcelmamula commented Dec 2, 2024

@rhmk SUSE perspective:
This role is part of sap_install which mentions SLES 15 as minimum supported version so comment from 187864 - Linux: Locale Support on Linux can be used:

SLES15

Starting with SLES15, the sap-locale package isn't any longer shipped with the Linux distribution. Please upgrade your SAP system to Unicode.

Default value of /etc/locale.conf for SLES 15 and SLES 16 is same: LANG=en_US.UTF-8. It can be changed by changing /etc/locale.conf as well (it is not present on openSUSE OS, only on SLES).

I would suggest these step to leave freedom, while keeping default OS settings untouched.

  • Create new variable sap_general_preconfigure_locale and comment it out or default as empty string ''
  • Add steps you want to run only if sap_general_preconfigure_locale is defined | length > 0
  • Cut up example you provided into ansible blocks and tasks for better readability

@Klaas-
Copy link

Klaas- commented Dec 2, 2024

I think you need to clarify this with SAP, what You must select English as the operating system language on all Linux hosts that are running SAP software. actually means :) if they actually mean set locale to en_* then that's what you should do/check, but I would still advocate for locale that uses a 24h clock instead of a 12h clock for being the default

berndfinger added a commit to mk-ansible-roles/community.sap_install that referenced this issue Dec 3, 2024
@sean-freeman
Copy link
Member

sean-freeman commented Dec 5, 2024

Appears related to crash on SAP HANA 2.0 SPS08

TASK [community.sap_install.sap_hana_install : Install SAP HANA - Verify if hdblcm process finished successfully] *********
fatal: [hdb-test1]: FAILED! => changed=true
  stderr: |-
    Installation of SAP HANA Database System failed.
      Cannot detect command line options dynamically.
        Cannot parse external program configuration:
    syntax error at line 1, column 0, byte 0 at SDB/Install/Configuration/ExternalProgramConfiguration.pm line 80.
14:29:59.658 - INFO: Getting external program configuration
14:30:00.517 - ERR : Cannot parse external program configuration:
syntax error at line 1, column 0, byte 0 at SDB/Install/Configuration/ExternalProgramConfiguration.pm line 80.

14:30:00.517 - INFO: perl: warning: Setting locale failed.
14:30:00.517 - INFO: perl: warning: Please check that your locale settings:
14:30:00.517 - INFO: 	LANGUAGE = (unset),
14:30:00.517 - INFO: 	LC_ALL = "en_US.UTF-8",
14:30:00.517 - INFO: 	LANG = "en_US.UTF-8"
14:30:00.517 - INFO:     are supported and installed on your system.
14:30:00.517 - INFO: perl: warning: Falling back to the standard locale ("C").
14:30:00.517 - INFO: <?xml version="1.0" encoding="UTF-8"?>
14:30:00.517 - INFO: <install_configuration class="LssConfiguration" installer_version="2.8.44" component_version="2.080.00.00">

EDIT: Resolved by installing glibc-langpack-en and no other RPM.

EDIT 2: Confirmed it is not because of older OS on Bastion host propagating AcceptEnv LANG LC_* to the target/managed host.

@rhmk
Copy link
Member Author

rhmk commented Dec 5, 2024

Indeed glibc-langpack-en fixes the systems. It seems the SAP install script sets the right locale when running no matter what locale is set as default system locale. Even set to C works with the locale package installed

@Klaas-
Copy link

Klaas- commented Dec 16, 2024

Crosslinking #914 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants