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

PySafetyBear fails with an exception due to changes in upstream data format #2085

Closed
underyx opened this issue Oct 27, 2017 · 5 comments

Comments

@underyx
Copy link
Member

commented Oct 27, 2017

The format of https://raw.githubusercontent.com/pyupio/safety-db/master/data/insecure_full.json has been changed, which triggers this exception:

      Traceback (most recent call last):
        File "/coala/coalib/bears/Bear.py", line 282, in execute
          return [] if result is None else list(result)
        File "/coala-bears/bears/python/requirements/PySafetyBear.py", line 80, in run
          additional_info=vulnerability.description,
        File "/usr/lib/python3.6/site-packages/safety/safety.py", line 31, in description
          return self.data["description"] if self.is_cve else self.data["changelog"]
      KeyError: 'description'
@RaiVaibhav

This comment has been minimized.

Copy link
Member

commented Oct 27, 2017

I would like to give it a try. Need to how did you generated the error log

@RaiVaibhav

This comment has been minimized.

Copy link
Member

commented Oct 28, 2017

@underyx Need information how did you gets the error log??, I run the PySafetyBear on my requirement.txt file its running fine

@underyx

This comment has been minimized.

Copy link
Member Author

commented Oct 28, 2017

@RaiVaibhav you need to add a vulnerable package version to your requirements as the error is triggered while creating a result. I think bottle==0.10.0 should work.

@RaiVaibhav

This comment has been minimized.

Copy link
Member

commented Oct 30, 2017

I think there are two ways to solve the problem either by change in their development of safety.py file or either solve in our Bear File

Both will works but I think The first method is far better as we it will catch the keyError or any error at early stage so we  don't have to catch  a problem later i.e for example in our Bear file   
@jayvdb

This comment has been minimized.

Copy link
Member

commented Oct 31, 2017

These database files were updated 29 days ago https://github.com/pyupio/safety-db/tree/master/data

And safety 1.6.1 was released 11 days ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.