cloudberry icon indicating copy to clipboard operation
cloudberry copied to clipboard

[Bug] Errors thrown by gpinitsystem during locale checking

Open xanadu-dev opened this issue 1 year ago • 1 comments

Cloudberry Database version

1.5.3

What happened

When initialising a new database there are errors thrown during locale checking - the database is initialized correctly so these errors appear to be benign Error 1 /usr/local/cloudberrydb/bin/gpinitsystem: line 708: [1: command not found relates to line

 if [ `$LOCALE -a |$GREP -ic $(NORMALIZE_CODESET_IN_LOCALE $LOCALE_SETTING)` -eq 0 ] \
    && [`$LOCALE -a |$GREP -ic $LOCALE_SETTING` -eq 0];then

Error 2 /usr/local/cloudberrydb/bin/gpinitsystem: line 721: [1: command not found relates to line

if [ $( REMOTE_EXECUTE_AND_GET_OUTPUT $1 "$LOCALE -a|$GREP -ic '$(NORMALIZE_CODESET_IN_LOCALE $LOCALE_SETTING)'" ) -eq 0 ] \
    && [$( REMOTE_EXECUTE_AND_GET_OUTPUT $1 "$LOCALE -a|$GREP -ic '$LOCALE_SETTING'" ) -eq 0] ;then

What you think should happen instead

No response

How to reproduce

Comment used was

gpinitsystem -a -p $GPHOME/postgresql.conf -c $GPHOME/gpinitsystem_config -h $GPHOME/hostfile_gpinitsystem -l /gpadminlogs --mirror-mode=spread --su_password=$SUPERUSER_PASSWORD --locale=C.UTF-8

Operating System

Ubuntu 18.04

Anything else

Happens every time

Are you willing to submit PR?

  • [ ] Yes, I am willing to submit a PR!

Code of Conduct

xanadu-dev avatar Jun 27 '24 13:06 xanadu-dev

Hey, @xanadu-dev welcome!🎊 Thanks for taking the time to point this out.🙌

github-actions[bot] avatar Jun 27 '24 13:06 github-actions[bot]

Can you add system PATH to env : refer to https://github.com/greenplum-db/gpdb-archive/commit/9201a8bcd0b2519fcd8a73820742d3cadffdc73c

if work fine, I will cherry pick this.

yjhjstz avatar Dec 09 '24 08:12 yjhjstz

Can you add system PATH to env : refer to greenplum-db/gpdb-archive@9201a8b

if work fine, I will cherry pick this.

I should be able to try this in the next few days and will let you know

xanadu-dev avatar Dec 09 '24 11:12 xanadu-dev

Can you add system PATH to env : refer to greenplum-db/gpdb-archive@9201a8b

if work fine, I will cherry pick this.

I tried the change you suggested and it didn't remove the warnings I'll update my system to the latest cloudberry version and check again as I am using 1.5.4 at the moment

xanadu-dev avatar Dec 10 '24 14:12 xanadu-dev

I tried the change you suggested and it didn't remove the warnings I'll update my system to the latest cloudberry version and check again as I am using 1.5.4 at the moment

That suggested fix didn't work with version 1.6.0 either

xanadu-dev avatar Dec 12 '24 10:12 xanadu-dev

I tried the change you suggested and it didn't remove the warnings I'll update my system to the latest cloudberry version and check again as I am using 1.5.4 at the moment

That suggested fix didn't work with version 1.6.0 either

found another related pr: https://github.com/greenplum-db/gpdb-archive/commit/e449c8cbaebeb8a851657d4de4c198bc203bf0fe

yjhjstz avatar Dec 24 '24 06:12 yjhjstz

found another related pr: greenplum-db/gpdb-archive@e449c8c

That PR has already been included in the Cloudberry code

xanadu-dev avatar Jan 15 '25 10:01 xanadu-dev

It seems that the locale issue arises because the locale settings of your system do not match those during the initdb process.

Your locate setting:

--locale=C.UTF-8

You might need to check the supported locales on your system by running:

locale -a

Please note that locale names are case-sensitive.

Additionally, I noticed that your build is based on Ubuntu 18.04, which is outdated. This version, released on April 26, 2018, was officially supported until April 2023.

My daily builds are running on Ubuntu 22.04 and later versions. I recommend updating your build environment to an OS that is officially supported by Cloudberry. You can refer to the configuration examples in our CI script for guidance. If you need to configure something specific related to the OS, please ensure to consider the necessary details.

avamingli avatar Jan 16 '25 08:01 avamingli

Thanks I'll try those 2 suggestions and confirm if it solves the issue

xanadu-dev avatar Jan 16 '25 09:01 xanadu-dev

Additionally, I noticed that your build is based on Ubuntu 18.04, which is outdated. This version, released on April 26, 2018, was officially supported until April 2023.

My daily builds are running on Ubuntu 22.04 and later versions. I recommend updating your build environment to an OS that is officially supported by Cloudberry. You can refer to the configuration examples in our CI script for guidance. If you need to configure something specific related to the OS, please ensure to consider the necessary details.

I can confirm that rebuilding with Ubuntu 22.04 addresses the problem and the locale warnings are gone

Thanks again

xanadu-dev avatar Jan 16 '25 10:01 xanadu-dev