Skip to content

Wishlist: silence SSHException traceback in run() #922

Open

Description

@jonasbardino

Just a simple wish: would you please consider changing the extremely noisy traceback log on SSHExceptions in the transport run() method from ERROR to DEBUG log?
https://github.com/paramiko/paramiko/blob/master/paramiko/transport.py#L1810

With the number of automated SSH scans out there our logs are brimming with irrelevant traceback errors (Error reading SSH protocol banner, Incompatible version, etc.) and it makes it increasingly hard to investigate actual errors.

Activity

  1. sethmlarson commented on Mar 23, 2017

    @sethmlarson

    Maybe this should be an option?

  2. bitprophet commented on Mar 23, 2017

    @bitprophet
    Member

    Side note: a lot of the exception handling is pretty mediocre; there need to be way more SSHException subclasses, for example, so certain specific errors can be caught. See #258 for example.

    Specific response: doing that makes me leery (at least until the above is fixed and we can relegate such a logging change more specifically) because SSHException could be many things, including errors that aren't specious. I might accept a PR that makes it an opt-in feature (e.g. a general "make logging less verbose overall" settings flag somewhere) as per Seth's comment.

  3. jonasbardino commented on Mar 24, 2017

    @jonasbardino
    Author

    Thanks for your responses. Making it configurable or more granular in exception handling would of course be the most flexible solution, but I realize that it is also far more work than just relegating the stack trace log to debug.

    I see your point that the SSHException is rather general, but I would still argue that the traceback log adds very little relevant information except in a non-production (debug) environment. One would still get the error log of the actual exception right before the traceback.
    Anyway, it's your decision of course and I just manually patch our production installations for now.

  4. added this to the 2.2 milestone on Mar 24, 2017
  5. bitprophet commented on Mar 24, 2017

    @bitprophet
    Member

    That's a fair point - thanks. I'll throw this in my (overweight, heh) next feature bucket so I have a chance to reconsider it when I go through that next.

  6. modified the milestones: 2.2, on Aug 16, 2017
  7. modified the milestones: , p2 on Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions