salt icon indicating copy to clipboard operation
salt copied to clipboard

sentry_return does not work with raven>3.5 (current stable version: raven==5.5.0)

Open ksmitdevops opened this issue 11 years ago • 4 comments

From salt-users (https://groups.google.com/forum/#!topic/salt-users/OO1cTZSNXrE):

I have the following configuration for a sentry_handler:

--snip

sentry_handler:

  dsn:       https://[munged]:[munged]@app.getsentry.com/[munged]

  log_level: all

--snip

I have this in pillar:

--snip

raven:

  servers:

    - https://[munged]:[munged]@app.getsentry.com/[munged]

  public_key: [munged]

  secret_key: [munged]

  project:    salt

  tags:

    - os

    - master

    - saltversion

    - cpuarch

--snip

and I have raven==5.5.0 in the virtualenv for my salt master. My virtualenv pip pkgs are thus:

--snip

# pip freeze

backports.ssl-match-hostname==3.4.0.2

certifi==2015.4.28

cffi==1.1.2

CherryPy==3.7.0

cryptography==0.9.1

enum34==1.0.4

idna==2.0

ipaddress==1.0.7

Jinja2==2.7.3

libnacl==1.4.3

M2Crypto==0.22.3

MarkupSafe==0.23

msgpack-python==0.4.6

pyasn1==0.1.8

pycparser==2.14

pycrypto==2.6.1

pyOpenSSL==0.15.1

pysodium==0.6.6

PyYAML==3.11

pyzmq==14.6.0

raven==5.5.0

requests==2.7.0

salt==2015.5.3

six==1.9.0

tornado==4.2

wheel==0.24.0

--snip

salt-master --versions-report

           Salt: 2015.5.3

         Python: 2.7.3 (default, Mar 13 2014, 11:03:55)

         Jinja2: 2.7.3

       M2Crypto: 0.22

 msgpack-python: 0.4.6

   msgpack-pure: Not Installed

       pycrypto: 2.6.1

        libnacl: 1.4.3

         PyYAML: 3.11

          ioflo: Not Installed

          PyZMQ: 14.6.0

           RAET: Not Installed

            ZMQ: 4.0.5

           Mako: Not Installed

        Tornado: 4.2

When I start my master up, I get this error...

--snip

/etc/init.d/salt-master start

[....] Starting salt master control daemon: salt-master[ERROR   ] 'module' object has no attribute 'load'

Traceback (most recent call last):

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 167, in parse_args

    mixin_after_parsed_func(self)

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 713, in __setup_extended_logging

    log.setup_extended_logging(self.config)

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/log/setup.py", line 573, in setup_extended_logging

    handlers = get_handlers_func()

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/log/handlers/sentry_mod.py", line 109, in setup_handlers

    dsn_config = raven.load(dsn)

AttributeError: 'module' object has no attribute 'load'

Usage: salt-master

salt-master: error: Error while processing <bound method Master.__setup_extended_logging of <salt.cli.daemons.Master object at 0x7f65e8bf5590>>: Traceback (most recent call last):

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 167, in parse_args

    mixin_after_parsed_func(self)

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/utils/parsers.py", line 713, in __setup_extended_logging

    log.setup_extended_logging(self.config)

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/log/setup.py", line 573, in setup_extended_logging

    handlers = get_handlers_func()

  File "/var/src/salt/local/lib/python2.7/site-packages/salt/log/handlers/sentry_mod.py", line 109, in setup_handlers

    dsn_config = raven.load(dsn)

AttributeError: 'module' object has no attribute 'load'




 failed!

--snip

Found the suggestion to downgrade raven to 3.5.2 in this post: https://groups.google.com/forum/#!topic/salt-users/SnwyRABrxG4

My salt-master version:

salt-master --versions-report
           Salt: 2015.5.3
         Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
         Jinja2: 2.7.3
       M2Crypto: 0.22
 msgpack-python: 0.4.6
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: 1.4.3
         PyYAML: 3.11
          ioflo: Not Installed
          PyZMQ: 14.6.0
           RAET: Not Installed
            ZMQ: 4.0.5
           Mako: Not Installed
        Tornado: 4.2

ksmitdevops avatar Aug 12 '15 22:08 ksmitdevops

@schlagify, thanks for the report.

jfindlay avatar Aug 13 '15 19:08 jfindlay

I'm not sure if this is the same bug, but with the logger I'm getting

Unable to capture event: APIError(Missing required Origin or Referer header)
Unable to capture event: APIError(Missing required Origin or Referer header)
[snip]
Failed to submit message: u'You should upgrade pyOpenSSL to at least 0.14.1 to enable the use of X509 extensions'
Failed to submit message: u'You should upgrade pyOpenSSL to at least 0.14.1 to enable the use of X509 extensions'

on the sentry side I get

status=400 project_id=None user_id=None ip=<IP> agent=raven-python/5.2.0 Missing required Origin or Referer header

sticked to raven 5.2.0 but changed the config to get it working, will create a new issue for this.

arthurzenika avatar Oct 26 '15 15:10 arthurzenika

Afair, sentry_handler (for logging) should work fine with recent raven releases in develop. The returner however is still broken using and old way of passing parameters. Using dsn makes it work correctly.

EvaSDK avatar Jan 28 '16 11:01 EvaSDK

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Mar 16 '18 21:03 stale[bot]