Salt: "Failed to load function" errors on 2018.3.3 master

Created on 7 Dec 2018  Â·  15Comments  Â·  Source: saltstack/salt

Description of Issue/Question

I'm in the process of upgrading to 2018.3.3, and see these errors in the master log:

2018-12-06 18:31:33,825 [salt.loader      :1698][ERROR   ][21774] Failed to load function {'cmd': '_file_envs'}.envs because its module ({'cmd': '_file_envs'}) is not in the whitelist: [u'gitfs', u'roots']
2018-12-06 18:31:33,825 [salt.loader      :1698][ERROR   ][21774] Failed to load function {'cmd': '_file_envs.envs because its module ({'cmd': '_file_envs) is not in the whitelist: [u'gitfs', u'roots']

I am unsure if this is causing any actual problems, because everything seems to work.

Steps to Reproduce Issue

Any state.sls call will trigger the errors, even with a very simple SLS, such as:

Simple test:
  test.nop

Versions Report

Salt Version:
Salt: 2018.3.3

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.11
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.6.0
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15 (default, Dec 6 2018, 16:19:54)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 17.1.2
RAET: Not Installed
smmap: 2.0.5
timelib: Not Installed
Tornado: 5.1.1
ZMQ: 4.2.5

System Versions:
dist: redhat 7.5 Maipo
locale: UTF-8
machine: x86_64
release: 4.1.12-124.15.2.el7uek.x86_64
system: Linux
version: Red Hat Enterprise Linux Server 7.5 Maipo

Bug P1 severity-medium team-core

Most helpful comment

This issue appears to have been fixed after we branched for the 2018.3.3 release. @Ch3LL tested against the head of the 2018.3 branch (which will become 2018.3.4) and was unable to reproduce, but was able to reproduce on 2018.3.3. I hadn't tested against 2018.3.3, which is why I could not reproduce.

All 15 comments

looks like its coming from here: https://github.com/saltstack/salt/blob/v2018.3.3/salt/loader.py#L1695-L1699

are you using any sort of whitelisting?

I don't have any configured. Is there a way to look at the "effective" options at runtime?

From: Megan Wilhite notifications@github.com
Sent: Friday, December 7, 2018 10:02 AM
To: saltstack/salt salt@noreply.github.com
Cc: Clint Allen clint.allen@ni.com; Author author@noreply.github.com
Subject: Re: [saltstack/salt] "Failed to load function" errors on 2018.3.3 master (#50781)

looks like its coming from here: https://github.com/saltstack/salt/blob/v2018.3.3/salt/loader.py#L1695-L1699https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_saltstack_salt_blob_v2018.3.3_salt_loader.py-23L1695-2DL1699&d=DwMCaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wdgovh-Y8f0-a6HabHzaJq515BBHs_ByF2_wphBn7S0&m=UNwunU8n-QQvJuMyaHlOD_5qu6rf_GVLZ-vS4QBQelo&s=RZnAB2dVkE48Olr3JVboR1CUj-aQEiY26tH7OiFHYVA&e=

are you using any sort of whitelisting?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_saltstack_salt_issues_50781-23issuecomment-2D445277823&d=DwMCaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wdgovh-Y8f0-a6HabHzaJq515BBHs_ByF2_wphBn7S0&m=UNwunU8n-QQvJuMyaHlOD_5qu6rf_GVLZ-vS4QBQelo&s=XIhxXfOT-h8hxsPH5yLuIvVja4p6gfyJx1LFvwvdehU&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ARdgYYLgsA2MyW2Rb9NcgiNXcZeAXp3Qks5u2pDngaJpZM4ZHpMP&d=DwMCaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wdgovh-Y8f0-a6HabHzaJq515BBHs_ByF2_wphBn7S0&m=UNwunU8n-QQvJuMyaHlOD_5qu6rf_GVLZ-vS4QBQelo&s=xaxChZ7PwvEKbNtenCNVFgIkyOKIqJzj5Q4Ev8NwLZ0&e=.

you can get the opts from master by running: salt-run test.get_opts

but i went ahead and tried and i'm able to replicate the behavior. It looks like self.whitelist is [u'roots'] when run.

ping @terminalmage can you take a look here?

Thanks @Ch3LL !

I can't reproduce this. Please provide a reproducible test case, _including_ master/minion configuration.

In a small lab environment I created to test network automation with salt using docker containers, I can reproduce the issue in 2018.3 branch. In my case I see the error messages when the environment starts. Using 2017.7 no error messages appear in the master.
My repo is here:

https://github.com/kzorba/net-automation-lab

The master failed to build for me.

Can you just provide a set of configs and steps to reproduce?

Stupid mistake from my part, I had a typo error, fixed. Out of the box it builds salt 2017.7 branch containers (no issue there). Comment/uncomment the relevant parts in Dockerfile.master, Dockerfile.proxy and docker-compose.yml and build the 2018.3 where the problem appears when you issue "make start" (problem will appear in salt-master console). Let me know if you succeed or you have any other question.

I already commented out 2017.7 and used 2018.3 before I made my previous comment.

My typo was in docker-compose.yml, pull the small change. Did you comment/uncomment the relevant image lines there as well? You need to do it in the Dockerfiles and docker-compose.yml. I just build everything from scratch in my environment and it works. Can you tell me what is the error you get?

This issue appears to have been fixed after we branched for the 2018.3.3 release. @Ch3LL tested against the head of the 2018.3 branch (which will become 2018.3.4) and was unable to reproduce, but was able to reproduce on 2018.3.3. I hadn't tested against 2018.3.3, which is why I could not reproduce.

jep, currently facing the issue, what is the workaround for this ?

 [salt.loader      :1698][ERROR   ][4803] Failed to load function {'cmd': '_file_envs.envs because its module ({'cmd': '_file_envs) is not in the whitelist: [u'gitfs']

This isn't causing any actual problems, aside from adding noise to the log. It was fixed by https://github.com/saltstack/salt/pull/49526.

The only way to suppress these messages in 2018.3.3 is to set log_level_logfile to something more severe than error (for example, critical). However this means that you will lose all log messages logged at the error loglevel.

As this is known to be fixed, I'm closing this.

Was this page helpful?
0 / 5 - 0 ratings