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

salt-call --local sys.doc none gives error/traceback in raspberry pi #42312

Closed
frogunder opened this issue Jul 14, 2017 · 2 comments
Closed

salt-call --local sys.doc none gives error/traceback in raspberry pi #42312

frogunder opened this issue Jul 14, 2017 · 2 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 severity-low 4th level, cosemtic problems, work around exists
Milestone

Comments

@frogunder
Copy link
Contributor

Description of Issue/Question

On 2017.7.0 when running salt-call --local sys.doc none or salt-call --local sys.doc aliases.list_aliases on raspberry pi I get errors/warnings. Commands seems to run fine. Other salt-call --local commands runs fine without the warning/error.
I see this:

[ERROR   ] Failed to import module sensehat, 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 1411, in _load_module
    mod = imp.load_module(mod_namespace, fn_, fpath, desc)
  File "/usr/lib/python2.7/dist-packages/salt/modules/sensehat.py", line 26, in <module>
    _sensehat = SenseHat()
  File "/usr/lib/python2.7/dist-packages/sense_hat/sense_hat.py", line 36, in __init__
    raise OSError('Cannot detect %s device' % self.SENSE_HAT_FB_NAME)
OSError: Cannot detect RPi-Sense FB device

Setup

Raspberry pi machine with salt 2017.7.0

Steps to Reproduce Issue

root@raspberrypi:/home/pi# salt-call --local sys.doc none
[ERROR   ] Failed to import module sensehat, 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 1411, in _load_module
    mod = imp.load_module(mod_namespace, fn_, fpath, desc)
  File "/usr/lib/python2.7/dist-packages/salt/modules/sensehat.py", line 26, in <module>
    _sensehat = SenseHat()
  File "/usr/lib/python2.7/dist-packages/sense_hat/sense_hat.py", line 36, in __init__
    raise OSError('Cannot detect %s device' % self.SENSE_HAT_FB_NAME)
OSError: Cannot detect RPi-Sense FB device
local:
    ----------
root@raspberrypi:/home/pi# salt-call --local sys.doc aliases.list_aliases
[ERROR   ] Failed to import module sensehat, 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 1411, in _load_module
    mod = imp.load_module(mod_namespace, fn_, fpath, desc)
  File "/usr/lib/python2.7/dist-packages/salt/modules/sensehat.py", line 26, in <module>
    _sensehat = SenseHat()
  File "/usr/lib/python2.7/dist-packages/sense_hat/sense_hat.py", line 36, in __init__
    raise OSError('Cannot detect %s device' % self.SENSE_HAT_FB_NAME)
OSError: Cannot detect RPi-Sense FB device
local:
    ----------
    aliases.list_aliases:
        
            Return the aliases found in the aliases file in this format::
        
                {'alias': 'target'}
        
            CLI Example:
        
                salt '*' aliases.list_aliases
            
root@raspberrypi:/home/pi# 

Other salt-call commands don't give it:

root@raspberrypi:/home/pi# salt-call --local test.version
local:
    2017.7.0
root@raspberrypi:/home/pi# salt-call --local grains.item os
local:
    ----------
    os:
        Raspbian
root@raspberrypi:/home/pi# salt-call --local state.sls test
local:
----------
          ID: echo
    Function: cmd.run
        Name: echo 'This is a test!'
      Result: True
     Comment: Command "echo 'This is a test!'" run
     Started: 16:37:04.567196
    Duration: 43.092 ms
     Changes:   
              ----------
              pid:
                  22104
              retcode:
                  0
              stderr:
              stdout:
                  This is a test!

Summary for local
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time:  43.092 ms
root@raspberrypi:/home/pi# 

Versions Report

Salt Version:
           Salt: 2017.7.0
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: 3.5.0
       dateutil: 2.2
      docker-py: Not Installed
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.3
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.2
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.9 (default, Mar  8 2015, 00:52:26)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
 
System Versions:
           dist: debian 8.0 
         locale: UTF-8
        machine: armv7l
        release: 4.1.19-v7+
         system: Linux
        version: debian 8.0 
@gtmanfred gtmanfred added Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt severity-low 4th level, cosemtic problems, work around exists P1 Priority 1 Execution-Module labels Jul 17, 2017
@gtmanfred gtmanfred added this to the Approved milestone Jul 17, 2017
@frogunder
Copy link
Contributor Author

See this on a py3 setup on Raspberry 9:

root@raspberrypi:/home/pi# salt-call --local grains.item saltversion
local:
    ----------
    saltversion:
        2018.3.0
root@raspberrypi:/home/pi# salt-call --local grains.item pythonversion
local:
    ----------
    pythonversion:
        - 3
        - 5
        - 3
        - final
        - 0
root@raspberrypi:/home/pi# salt-call --local sys.doc none
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
OSError: Cannot detect RPi-Sense FB device
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python3/dist-packages/salt/scripts.py", line 400, in salt_call
    client.run()
  File "/usr/lib/python3/dist-packages/salt/cli/call.py", line 57, in run
    caller.run()
  File "/usr/lib/python3/dist-packages/salt/cli/caller.py", line 134, in run
    ret = self.call()
  File "/usr/lib/python3/dist-packages/salt/cli/caller.py", line 212, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/modules/sysmod.py", line 88, in doc
    for fun in __salt__:
  File "/usr/lib/python3/dist-packages/salt/utils/lazy.py", line 116, in __iter__
    self._load_all()
  File "/usr/lib/python3/dist-packages/salt/loader.py", line 1666, in _load_all
    self._load_module(name)
  File "/usr/lib/python3/dist-packages/salt/loader.py", line 1452, in _load_module
    mod = spec.loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 396, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 817, in load_module
  File "<frozen importlib._bootstrap_external>", line 676, in load_module
  File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/salt/modules/sensehat.py", line 28, in <module>
    _sensehat = SenseHat()
  File "/usr/lib/python3/dist-packages/sense_hat/sense_hat.py", line 39, in __init__
    raise OSError('Cannot detect %s device' % self.SENSE_HAT_FB_NAME)
OSError: Cannot detect RPi-Sense FB device
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/python3/dist-packages/salt/scripts.py", line 400, in salt_call
    client.run()
  File "/usr/lib/python3/dist-packages/salt/cli/call.py", line 57, in run
    caller.run()
  File "/usr/lib/python3/dist-packages/salt/cli/caller.py", line 134, in run
    ret = self.call()
  File "/usr/lib/python3/dist-packages/salt/cli/caller.py", line 212, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/modules/sysmod.py", line 88, in doc
    for fun in __salt__:
  File "/usr/lib/python3/dist-packages/salt/utils/lazy.py", line 116, in __iter__
    self._load_all()
  File "/usr/lib/python3/dist-packages/salt/loader.py", line 1666, in _load_all
    self._load_module(name)
  File "/usr/lib/python3/dist-packages/salt/loader.py", line 1452, in _load_module
    mod = spec.loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 396, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 817, in load_module
  File "<frozen importlib._bootstrap_external>", line 676, in load_module
  File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/salt/modules/sensehat.py", line 28, in <module>
    _sensehat = SenseHat()
  File "/usr/lib/python3/dist-packages/sense_hat/sense_hat.py", line 39, in __init__
    raise OSError('Cannot detect %s device' % self.SENSE_HAT_FB_NAME)
OSError: Cannot detect RPi-Sense FB device
root@raspberrypi:/home/pi# 

@rallytime
Copy link
Contributor

This should be fixed with #46823

@rallytime rallytime self-assigned this Apr 2, 2018
@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

No branches or pull requests

3 participants