SALT ERROR: local: Data failed to compile: ---------- Pillar failed to render with the following messages:

370 views
Skip to first unread message

Bellary Rajesh

unread,
Jan 4, 2021, 10:39:27 AM1/4/21
to Salt-users
Trying to fix this error from a week please help me to fix this error  

 Pillar failed to render with the following messages:
----------
    Rendering SLS 'common.ec2' failed. Please see master log for details.
----------
    Rendering SLS 'common.utils' failed. Please see master log for details

Please find the below master.log error 
2021-01-03 16:13:05,335 [salt.pillar      :888 ][CRITICAL][6284] Rendering SLS 'common.ec2' failed, render error:
invalid syntax (init.sls, line 51)
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/salt/pillar/__init__.py", line 884, in render_pstate
    **defaults
  File "/usr/lib/python3.7/site-packages/salt/template.py", line 101, in compile_template
    ret = render(input_data, saltenv, sls, **render_kwargs)
  File "/usr/lib/python3.7/site-packages/salt/renderers/py.py", line 149, in render
    **kws
  File "/usr/lib/python3.7/site-packages/salt/utils/templates.py", line 679, in py
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 724, in exec_module
  File "<frozen importlib._bootstrap_external>", line 860, in get_code
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/srv/pillar/common/ec2/init.sls", line 51
    except Exception, e:
                    ^
SyntaxError: invalid syntax
2021-01-03 16:13:05,353 [salt.pillar      :888 ][CRITICAL][6284] Rendering SLS 'common.utils' failed, render error:
No module named 'boto'
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/salt/pillar/__init__.py", line 884, in render_pstate
    **defaults
  File "/usr/lib/python3.7/site-packages/salt/template.py", line 101, in compile_template
    ret = render(input_data, saltenv, sls, **render_kwargs)
  File "/usr/lib/python3.7/site-packages/salt/renderers/py.py", line 149, in render
    **kws
  File "/usr/lib/python3.7/site-packages/salt/utils/templates.py", line 679, in py
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/srv/pillar/common/utils/init.sls", line 15, in <module>
    import boto.ec2
ModuleNotFoundError: No module named 'boto'
2021-01-03 16:13:05,399 [salt.pillar      :888 ][CRITICAL][6284] Rendering SLS 'ops' failed, render error:
invalid syntax (init.sls, line 47)
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/salt/pillar/__init__.py", line 884, in render_pstate
    **defaults
  File "/usr/lib/python3.7/site-packages/salt/template.py", line 101, in compile_template
    ret = render(input_data, saltenv, sls, **render_kwargs)
  File "/usr/lib/python3.7/site-packages/salt/renderers/py.py", line 149, in render
    **kws
  File "/usr/lib/python3.7/site-packages/salt/utils/templates.py", line 679, in py
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 724, in exec_module
  File "<frozen importlib._bootstrap_external>", line 860, in get_code
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/srv/pillar/ops/init.sls", line 47
    except Exception, e:


Thanks
Rajesh

Raf Czlonka

unread,
Jan 5, 2021, 5:00:51 AM1/5/21
to Bellary Rajesh, salt-...@googlegroups.com
On Sun, Jan 03, 2021 at 05:24:21PM GMT, Bellary Rajesh wrote:
> Trying to fix this error from a week please help me to fix this error
> [...]
> File "/srv/pillar/common/ec2/init.sls", line 51
> except Exception, e:
> ^
> [...]
> File "/srv/pillar/common/utils/init.sls", line 15, in <module>
> import boto.ec2
> ModuleNotFoundError: No module named 'boto'
> [...]
> File "/srv/pillar/ops/init.sls", line 47
> except Exception, e:

Hi Rajesh,

The error messages are pretty clear about where the issues lie :^)

P.S. Please try not to wrap long lines next time.

Regards,

Raf

Bellary Rajesh

unread,
Jan 11, 2021, 12:33:08 PM1/11/21
to Salt-users
Thank you for your Help I resolved the Boto error But still, it is not working for me getting the same error  
 Data failed to compile:
----------
    Pillar failed to render with the following messages:
----------
    Rendering SLS 'common.ec2' failed. Please see master log for details.

Master Log : 
2021-01-11 17:30:47,007 [salt.pillar      :888 ][CRITICAL][74219] Rendering SLS 'common.ec2' failed, render error:
did not find expected <document start>
  in "<unicode string>", line 3, column 3
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/salt/renderers/yaml.py", line 68, in render
    data = yamlloader.load(yaml_data, Loader=get_yaml_loader(argline))
  File "/usr/lib/python3.7/site-packages/salt/utils/yamlloader.py", line 178, in load
    return yaml.load(stream, Loader=Loader)
  File "/usr/lib64/python3.7/site-packages/yaml/__init__.py", line 72, in load
    return loader.get_single_data()
  File "/usr/lib64/python3.7/site-packages/yaml/constructor.py", line 35, in get_single_data
    node = self.get_single_node()
  File "ext/_yaml.pyx", line 708, in _yaml.CParser.get_single_node
  File "ext/_yaml.pyx", line 905, in _yaml.CParser._parse_next_event
yaml.parser.ParserError: did not find expected <document start>
  in "<unicode string>", line 3, column 3

Thanks in advance 


Raf Czlonka

unread,
Jan 11, 2021, 6:42:10 PM1/11/21
to Bellary Rajesh, salt-...@googlegroups.com
On Mon, Jan 11, 2021 at 05:33:08PM GMT, Bellary Rajesh wrote:
> Thank you for your Help I resolved the Boto error But still, it is not
> working for me getting the same error
> Data failed to compile:
> ----------
> Pillar failed to render with the following messages:
> ----------
> Rendering SLS 'common.ec2' failed. Please see master log for details.
>
> Master Log :
> 2021-01-11 17:30:47,007 [salt.pillar :888 ][CRITICAL][74219] Rendering
> SLS 'common.ec2' failed, render error:
> did not find expected <document start>
> in "<unicode string>", line 3, column 3
^^^^^^^^^^^^^^^^
Again, it's clear where the issue is.

Regards,

Raf

rajfintrade

unread,
Jan 12, 2021, 6:33:06 AM1/12/21
to Raf Czlonka, salt-...@googlegroups.com
This is the common.ec2 file i did not found any unusual in this line3 column 3 

image.png
--
Urs:-Razesh

Raf Czlonka

unread,
Jan 12, 2021, 7:06:44 AM1/12/21
to rajfintrade, salt-...@googlegroups.com
On Tue, Jan 12, 2021 at 11:32:48AM GMT, rajfintrade wrote:
> This is the common.ec2 file i did not found any unusual in this line3
> column 3

Given the nature of config and log files, the only way to unpick
it is to have them included verbatim in the body of a plain text
email, or as attachments if your mailer mangles plain text.

Please don't attached cropped screenshots.

Regards,

Raf

rajfintrade

unread,
Jan 12, 2021, 7:31:49 AM1/12/21
to Raf Czlonka, salt-...@googlegroups.com
Got it. 

Please find below text 

#!/usr/bin/python3

"""
Gather some ec2 information that requires AWS API access so the minions
don't need that level of API access

Author: Shawn Butts

"""

import logging
import salt
import salt.log
import salt.pillar
#import boto.ec2
#import boto.util
--
Urs:-Razesh

rajfintrade

unread,
Jan 12, 2021, 7:40:21 AM1/12/21
to Raf Czlonka, salt-...@googlegroups.com
Please give me some suggestions how to fix this.

Thanks
Rajesh
--
Urs:-Razesh

Dennis Payne

unread,
Jan 12, 2021, 10:20:58 AM1/12/21
to salt-...@googlegroups.com, Raf Czlonka
I'm not that knowledgeable on yaml. But since the line number it is complaining about is your comment. Have you tried removing it or changing it to use # at the beginning of each line?

Raf Czlonka

unread,
Jan 12, 2021, 11:34:47 AM1/12/21
to rajfintrade, salt-...@googlegroups.com
On Tue, Jan 12, 2021 at 12:40:03PM GMT, rajfintrade wrote:
> Please give me some suggestions how to fix this.
> >
> > #!/usr/bin/python3
^^^^^^^^^^^^^^^^^^

Not sure what this is supposed to be as it does not appear to be a
Python renderer:

#!py

> > """
> > Gather some ec2 information that requires AWS API access so the minions
> > don't need that level of API access
> >
> > Author: Shawn Butts
> >
> > """

So probably best to keep it as plain YAML and either convert the
above Python docstring to a comment, or remove it altogether.

Regards,

Raf

rajfintrade

unread,
Jan 12, 2021, 4:26:55 PM1/12/21
to Raf Czlonka, salt-...@googlegroups.com
Thanks, I'll check it out. And update you

jeremy....@gmail.com

unread,
Jan 13, 2021, 7:17:27 PM1/13/21
to Salt-users
The first line is called a "shebang"

In Unix OS variants, a text file may be executable if its first line is a comment starting with "#!" followed by the name of another executable which will interpret the text file like a script when called appending the text file as a command line argument.

In this case, it is an assertion that the following text is a Python 3 program, interpreted and executed by /usr/bin/python3

Raf Czlonka

unread,
Jan 13, 2021, 7:27:38 PM1/13/21
to jeremy....@gmail.com, Salt-users
On Thu, Jan 14, 2021 at 12:17:27AM GMT, jeremy....@gmail.com wrote:
> The first line is called a "shebang"
>
> In Unix OS variants, a text file may be executable if its first line is a
> comment starting with "#!" followed by the name of another executable which
> will interpret the text file like a script when called appending the text
> file as a command line argument.
>
> In this case, it is an assertion that the following text is a Python 3
> program, interpreted and executed by /usr/bin/python3
>
> https://en.wikipedia.org/wiki/Shebang_(Unix)

Hi Jeremy,

I know what a shebang is, thanks.

I just don't know what it is doing there in the Pillar.

Regards,

Raf

Phipps, Thomas

unread,
Jan 13, 2021, 7:33:20 PM1/13/21
to salt-...@googlegroups.com
what is this supposed to do from a salt perspective. it looks to be a python file. NOT an sls file. yet you have it set to be called by the state system. from what i can see NONE of this file is supposed to actually do anything in salt.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/CAF1F%3D6MMUR4W3fQu%3DAWELptdXTibfbFFaTugh9exCADnx0vWeQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages