Description of problem: #satellite-change-hostname -u admin -p redhat satellite.jp.test fails with Failed 'hammer -u admin -p redhat capsule update --id --url https://satellite.jp.test:9090 --new-name satellite.jp.test 2> /dev/null' with exit code 64 if locale is set to LANG=ja_JP.UTF-8 Version-Release number of selected component (if applicable): 6.5 How reproducible: 100% Steps to Reproduce: 1. set system locale to LANG=ja_JP.UTF-8 2. try to change hostname Actual results: Failed 'hammer -u admin -p redhat capsule update --id --url https://satellite.jp.test:9090 --new-name satellite.jp.test 2> /dev/null' with exit code 64 Expected results: hostname changed Additional info: setting locale to LANG=zh_CN or possible any with special characters will make command fails. I have not tested all locales.
Hi, This doesn't seem to be a hammer bug. I've checked the script > satellite-change-hostname which uses hammer and it seems to be that the hammer is wrongly used. I run your command > satellite-change-hostname -u admin -p redhat satellite.jp.test and it printed the same error: > Failed 'hammer -u admin -p changeme capsule update --id --url https://satellite.jp.test:9090 --new-name satellite.jp.test 2> /dev/null' with exit code 64 Notice that the value for --id option is missing. I guess it is nil because the id wasn't fetch within the script, so it causes mentioned error. Also, if you run the hammer command by hand, it works. Moving to sattelite-change-hostname component.
Per discussion with the reporter, the missing id is caused by the fact the previous hammer command prints values in different language thanks to locale, so the id can't be detected in hammer output. So the sattelite-change-hostname script should make sure it uses hammer with english locale only or uses json (which I'm not sure whether it also tries to translate keys)
Created attachment 1612028 [details] hostname_change patch. executing hammer commands always under LANG=en_US.utf-8
created upstream issue https://projects.theforeman.org/issues/27811
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27811 has been resolved.
Verified on Sat 6.7 snap 7
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:1454