not working with salt-cloud shows unknown locale error
Issue by AmitChotaliya
Wed Aug 5 15:03:57 2015
Originally opened as https://github.com/saltstack/salt-bootstrap/issues/645
I am using salt-cloud to create instances and passing a specific version for salt-minion as script argument.
staging2-frontline:
provider: aws
image: ami-408c7f28
size: m1.small
securitygroup:
- Staging-Global
- Staging-FrontLine
tag:
circle: staging2
type: frontline
script: bootstrap-salt
script_args: stable 2015.5
I am getting the following error.
* ERROR: salt-minion was not found running
* ERROR: Failed to run daemons_running()!!!
nohup: ignoring input
Traceback (most recent call last):
File "/usr/bin/salt-minion", line 6, in <module>
from salt.scripts import salt_minion
File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 68, in <module>
__define_global_system_encoding_variable__()
File "/usr/lib/python2.7/dist-packages/salt/__init__.py", line 42, in __define_global_system_encoding_variable__
encoding = locale.getdefaultlocale()[-1]
File "/usr/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
File "/usr/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
* DEBUG: Running salt-minion by hand outputs:
* DEBUG: DAEMON LOGS for minion:
* DEBUG: 2015-08-05 14:57:47,477 [salt.cli.daemons ][INFO ][4367] SeConnection to 10.170.64.36 closed.
tting up the Salt Minion "scrap2"
2015-08-05 14:57:48,624 [salt.minion ][ERROR ][4367] Invalid keyword 'str' for variable 'master_type'
2015-08-05 14:57:48,651 [salt.cli.daemons ][INFO ][4367] The salt minion is shut down
2015-08-05 14:58:00,985 [salt.cli.daemons ][INFO ][4414] Setting up the Salt Minion "scrap2"
2015-08-05 14:58:01,921 [salt.minion ][ERROR ][4414] Invalid keyword 'str' for variable 'master_type'
2015-08-05 14:58:01,922 [salt.cli.daemons ][INFO ][4414] The salt minion is shut down
Comment by AmitChotaliya
Thu Aug 6 04:57:15 2015
I even tried without passing any script args and it still does not work. I used it without passing any script args a month back It worked then.
I added the following in /usr/lib/python2.7/dist-packages/salt/cloud/deploy/bootstrap-salt.sh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
It worked
This system had a badly configured locale. I moved the issue to salt because salt needs to better handle these cases.
I don't know if that is the problem. It was working last month with same AWS ami and same salt configuration.
What version of salt were you trying to bootstrap then?
Without script_args so I guess default
Hmm, that's weird because about a month ago the stable salt release would be(and still is) from the 2015.5 branch which already has this code. Maybe something in the AMI changed?
I think this is another case of the master_type: str bug that exists on 2015.5.3 (which is the latest stable release right now). I saw this line if your original logs:
`2015-08-05 14:58:01,921 [salt.minion ][ERROR ][4414] Invalid keyword 'str' for variable 'master_type'
This bug was originally reported in #25335 and has been fixed at the HEAD of the 2015.5 branch with #25703. This regression will be fixed in the next release, 2015.5.4. However, that means that this bootstrapping a minion from salt-cloud like you're trying to do here won't work on 2015.5.3.
I should have said in my previous comment that apart from the locale issue that @s0undt3ch has address in the pull request above, the other issue in this thread is the master_type: str.
My PR regarding the locale was merged. @rallytime want to keep this one open because of the master_type: str?
@s0undt3ch I think it's fine to close. The bug has been fixed. We just need to release the code that has the fix (2015.5.4). Is ok with you @AmitChotaliya?
Yes, I already have a workaround.