salt icon indicating copy to clipboard operation
salt copied to clipboard

test.ping is not available

Open syedaali opened this issue 11 years ago • 4 comments

When I run test.ping from the master, I get the below error on the master:

$ salt '*' test.ping -t 10
salt-master:
    True
minion1:
    'test.ping' is not available.

Basically test.ping works for the master from the master, but does not work on any minion from the master. This may be related to #28761 .

When I check /var/log/salt/minion on the minion I see the below error:

2015-11-12 04:42:52,823 [salt.minion      ][INFO    ][9341] User sudo_syed.ali Executing command test.ping with jid 20151112044254450116
2015-11-12 04:42:52,830 [salt.minion      ][INFO    ][22237] Starting a new job with PID 22237
2015-11-12 04:42:52,850 [salt.loader      ][ERROR   ][22237] Failed to import module test, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1110, in _load_module
    ), fn_, fpath, desc)
  File "/usr/lib/python2.7/dist-packages/salt/modules/test.py", line 31, in <module>
    @depends('non_existantmodulename')
  File "/usr/lib/python2.7/dist-packages/salt/utils/decorators/__init__.py", line 64, in __call__
    frame = inspect.stack()[1][0]
  File "/usr/lib/python2.7/inspect.py", line 1055, in stack
    return getouterframes(sys._getframe(1), context)
  File "/usr/lib/python2.7/inspect.py", line 1033, in getouterframes
    framelist.append((frame,) + getframeinfo(frame, context))
  File "/usr/lib/python2.7/inspect.py", line 1008, in getframeinfo
    lines, lnum = findsource(frame)
  File "/usr/lib/python2.7/inspect.py", line 580, in findsource
    if pat.match(lines[lnum]): break
IndexError: list index out of range

2015-11-12 04:42:53,002 [gnupg            ][INFO    ][22237] Log opened: Thu Nov 12 04:42:53 2015 UTC
2015-11-12 04:42:53,014 [salt.loaded.int.module.tls][ERROR   ][22237] You should upgrade pyOpenSSL to at least 0.14.1 to enable the use of X509 extensions
2015-11-12 04:42:53,067 [salt.loader      ][ERROR   ][22237] Failed to import module archive, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1110, in _load_module
    ), fn_, fpath, desc)
  File "/usr/lib/python2.7/dist-packages/salt/modules/archive.py", line 252, in <module>
    def zip_(zip_file, sources, template=None, cwd=None, runas=None):
  File "/usr/lib/python2.7/dist-packages/salt/utils/decorators/__init__.py", line 64, in __call__
    frame = inspect.stack()[1][0]
  File "/usr/lib/python2.7/inspect.py", line 1055, in stack
    return getouterframes(sys._getframe(1), context)
  File "/usr/lib/python2.7/inspect.py", line 1033, in getouterframes
    framelist.append((frame,) + getframeinfo(frame, context))
  File "/usr/lib/python2.7/inspect.py", line 1008, in getframeinfo
    lines, lnum = findsource(frame)
  File "/usr/lib/python2.7/inspect.py", line 580, in findsource
    if pat.match(lines[lnum]): break
IndexError: list index out of range
2015-11-12 04:42:53,082 [salt.loader      ][ERROR   ][22237] Failed to import module oracle, this is due most likely to a syntax error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1110, in _load_module
    ), fn_, fpath, desc)
  File "/usr/lib/python2.7/dist-packages/salt/modules/oracle.py", line 111, in <module>
    @depends('cx_Oracle', fallback_function=_cx_oracle_req)
  File "/usr/lib/python2.7/dist-packages/salt/utils/decorators/__init__.py", line 64, in __call__
    frame = inspect.stack()[1][0]
  File "/usr/lib/python2.7/inspect.py", line 1055, in stack
    return getouterframes(sys._getframe(1), context)
  File "/usr/lib/python2.7/inspect.py", line 1033, in getouterframes
    framelist.append((frame,) + getframeinfo(frame, context))
  File "/usr/lib/python2.7/inspect.py", line 1008, in getframeinfo
    lines, lnum = findsource(frame)
  File "/usr/lib/python2.7/inspect.py", line 580, in findsource
    if pat.match(lines[lnum]): break
IndexError: list index out of range
2015-11-12 04:42:53,094 [salt.minion      ][INFO    ][22237] Returning information for job: 20151112044254450116

I installed salt-minion on the minion using salt-cloud. My providers file has:

  script: bootstrap-salt
  script_args: -P git v2015.8.1
minion> # salt --versions
Salt Version:
           Salt: 2015.8.1

Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
           Mako: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
           RAET: Not Installed
        Tornado: 3.2
            ZMQ: 4.0.4
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: 2.0.2
          smmap: Not Installed
        timelib: Not Installed

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-66-generic
         system: Ubuntu 14.04 trusty
master>  salt --versions
Salt Version:
           Salt: 2015.8.1

Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: Not Installed
           Mako: 0.9.1
         PyYAML: 3.10
          PyZMQ: 14.4.0
         Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
           RAET: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.4
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: Not Installed
          smmap: 0.8.2
        timelib: Not Installed

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-48-generic
         system: Ubuntu 14.04 trusty

syedaali avatar Nov 12 '15 04:11 syedaali

@syedaali, thanks for the report.

jfindlay avatar Nov 14 '15 01:11 jfindlay

I pushed a possible fix for this in #29065. Please have a look there.

cachedout avatar Nov 19 '15 23:11 cachedout

Since we have a fix in for this and I have not heard back, I am going to go ahead and close this. If this pops up again, please let me know and we'll get this re-opened. Thanks.

cachedout avatar Nov 23 '15 20:11 cachedout

Even the issue were closed but I want to share my experience. Every thing was working and I start learning how to write module for salt. At first I created a module that name was same as module in salt (test.py) so when I write salt '*' test.ping It return not available and because master spread it to all minions even I delete test.py from master It doesn't work at least I had to delete all minion /usr/lib/python2.7/site-packages/salt/modules/test.py and now every thing is working like a charm

niloralab avatar Oct 23 '18 11:10 niloralab