UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0'

123 views
Skip to first unread message

Aidan Wong

unread,
Jul 25, 2014, 4:28:16 PM7/25/14
to salt-...@googlegroups.com
Hi,

This block is causing the error below.  If I remove that block of code, the state runs.  Any ideas?
 
/etc/sysconfig/lwes-journaller-java:
  file.managed:
    - source: salt://lwes-journaller-java/etc/sysconfig/lwes-journaller-java
    - user: t
    - group: roleusers
    - mode: 755


Error:
    The minion function caused an exception: Traceback (most recent call last):
      File "/usr/lib/python2.6/site-packages/salt/minion.py", line 796, in _thread_return
        return_data = func(*args, **kwargs)
      File "/usr/lib/python2.6/site-packages/salt/modules/state.py", line 275, in highstate
        force=kwargs.get('force', False)
      File "/usr/lib/python2.6/site-packages/salt/state.py", line 2502, in call_highstate
        high, errors = self.render_highstate(matches)
      File "/usr/lib/python2.6/site-packages/salt/state.py", line 2394, in render_highstate
        sls, saltenv, mods, matches)
      File "/usr/lib/python2.6/site-packages/salt/state.py", line 2140, in render_state
        self._handle_state_decls(state, sls, saltenv, errors)
      File "/usr/lib/python2.6/site-packages/salt/state.py", line 2288, in _handle_state_decls
        'Name {0} in sls {1} is not a dictionary'.format(name, sls)
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 0: ordinal not in range(128)

Etienne Pouliot

unread,
Jul 27, 2014, 11:11:20 AM7/27/14
to salt-...@googlegroups.com
My guess would that you have unsupported characters in you file salt://lwes-journaller-java/etc/sysconfig/lwes-journaller-java.

Try looking at it looking and removing all non english characters.

Sam Lai

unread,
Jul 27, 2014, 12:06:29 PM7/27/14
to salt-...@googlegroups.com
Somewhere in that block of code there is an invisible unicode
non-breaking space (U+00A0 is http://graphemica.com/00A0). Try using
an editor that can show whitespace characters to find out where, or
just type it all out again. Don't copy because you could unwittingly
copy the non-breaking space character.
> --
> You received this message because you are subscribed to the Google Groups
> "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to salt-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Aidan Wong

unread,
Jul 28, 2014, 3:39:02 PM7/28/14
to salt-...@googlegroups.com
Thanks guys.  I re-typed the block and it's working now.  I think it might be a space somewhere.


-/etc/sysconfig/lwes-journaller-java:
-  file.managed:
-    - source: salt://{{ APP_NAME }}/etc/sysconfig/lwes-journaller-java
-    - user: t
-    - group: roleusers
-    - mode: 755
-
+/etc/sysconfig/{{ APP_NAME }}:
+  file.managed:
+    - source: salt://{{ APP_NAME }}/etc/sysconfig/{{ APP_NAME }}
+    - user: t
+    - group: roleusers
+    - mode: 755



You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/T1-CTE_7wmw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages