Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem running mine runner #136

Closed
cmclaughlin opened this issue Apr 10, 2018 · 6 comments
Closed

Problem running mine runner #136

cmclaughlin opened this issue Apr 10, 2018 · 6 comments

Comments

@cmclaughlin
Copy link

Not sure what's going on here... perhaps a bug?

# pepper -vvv --client=runner mine.get tgt='myhosts*' fun='network.interface_ip'
Error with request
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pepper/libpepper.py", line 181, in req
    f = urlopen(req)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 500: Internal Server Error
DEBUG 2018-04-10 05:17:58,609 libpepper: Error with request
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pepper/libpepper.py", line 181, in req
    f = urlopen(req)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 500: Internal Server Error
Pepper error: Server error.

Works fine from my saltmaster:

# salt-run mine.get 'myhosts*' network.interface_ip
myhost1:
    172.X.X.X
myhost2:
    172.X.X.X

Tried running rest_cherrypy in debug mode, but there's nothing in the logs.

We're using pepper with other runners, so it seems to be limited to mine.get or perhaps the arguments.

# pepper --client=runner test.sleep 1
{
    "return": [
        true
    ]
}
@cmclaughlin
Copy link
Author

This might be a duplicate of issue #57...? Seems like the fix was merged a long time ago though.

In case this helps...

# salt --versions
Salt Version:
           Salt: 2017.7.2

Dependency Versions:
           cffi: Not Installed
       cherrypy: 3.2.2
       dateutil: 2.6.1
      docker-py: 1.7.2
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.6 (default, Oct 26 2016, 20:30:19)
   python-gnupg: 0.3.6
         PyYAML: 3.12
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: Ubuntu 14.04 trusty
         locale: UTF-8
        machine: x86_64
        release: 3.13.0-125-generic
         system: Linux
        version: Ubuntu 14.04 trusty

@gtmanfred
Copy link
Contributor

What does your mine_functions look like so that I can try and replicate this?

Thanks,
Daniel

@gtmanfred gtmanfred added this to the Blocked milestone Jun 13, 2018
@cmclaughlin
Copy link
Author

Thanks...

mine_functions:
  network.interface_ip: ['eth0']

@gtmanfred
Copy link
Contributor

This is a problem with salt-api.

It is overloading the fun function, so you have to pass it to the kwarg argument.

pepper -vvv --client runner mine.get tgt='*' kwarg='{"fun": "network.interface_ip"}'

Unfortunately, pepper does not convert the json to a python dictionary, so it doesn't get passed to the salt-api correctly.

I am fixing it with this PR #149

@gtmanfred
Copy link
Contributor

I am working on moving all the tests over to pytest and then adding more tests, once I have done that I will do a release.

@gtmanfred
Copy link
Contributor

Should be released now with 0.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants