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

[BUG] Jake crashes on ddt scan "AttributeError: 'OssIndexComponent' object has no attribute 'has_known_vulnerabilities'" #112

Closed
angushenderson opened this issue Feb 14, 2022 · 3 comments · Fixed by #113
Assignees
Labels
bug Something isn't working

Comments

@angushenderson
Copy link

Describe the bug
When running a jake scan an AttributeError is raised when checking for vulnerabilities (AttributeError: 'OssIndexComponent' object has no attribute 'has_known_vulnerabilities'), full stack trace is shown in screenshot below. For context, all python modules are installed via pipenv. I've tried running this command in 3 places, and this error is thrown in each of them: locally in command line, locally using pre-commit hooks, and on Gitlab ci.

To Reproduce
Steps to reproduce the behavior:

  1. Enter virtual environment and run pipenv install --dev to install all dependencies (see Pipfile below).
  2. Run pipenv run jake ddt --clear-cache (--clear-cache flag is used as per issue [BUG] Jake crashes on ddt scan "TypeError: 'int' object is not callable" #100)
  3. See error

Expected behavior
Normal, error free, execution of Jake OSS Index-backed scan

Screenshots
image

Additional Context
Here is the 'Pipfile':

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
flake8 = "*"
pytest = "*"
coverage = "*"
pre-commit = "*"
flake8-docstrings = "*"
pep8-naming = "*"
black = "*"
moto = {extras = ["all"], version = "*"}
uvicorn = "*"
boto3 = "*"
pylint = "*"
pytest-env = "*"
diagrams = "*"
handsdown = "*"
isort = "*"
doit = "*"
factory-boy = "*"
interrogate = "*"
pytest-mock = "*"
bandit = "*"
jake = "~=1.4.4"

[packages]
fastapi = {extras = ["ujson", "requests", "orjson"], version = "*"}
mangum = "*"
watchtower = "*"
jwcrypto = "*"
sqlalchemy = "*"
mysqlclient = "*"
pycryptodome = "*"
pymysql = "*"
sqlalchemy-utils = "*"

[requires]
python_version = "3.8"
[pipenv]
allow_prereleases = true

Pre-commit hook in '.pre-commit-config.yaml':

repos:
  - repo: local
    hooks:
      - id: jake
        name: jake
        entry: pipenv run jake ddt
        language: python
        types_or: [python, pyi]
        pass_filenames: false
        # To circumvent issue stated here: https://github.com/sonatype-nexus-community/jake/issues/100
        args: [--clear-cache]

And the command getting run on the ci is:
pipenv run jake ddt --clear-cache

Desktop (please complete the following information):

  • OS: Ubuntu 20.04.3 LTS
  • Python Version: 3.8.10
  • Version 1.4.4
@angushenderson angushenderson added the bug Something isn't working label Feb 14, 2022
@madpah
Copy link
Collaborator

madpah commented Feb 15, 2022

Hi @angushenderson,

Thanks for raising this issue. It looks like jake is unexpectedly pulling in a much newer version of one of its upstream dependencies (where that method has been removed).

The upstream dependency is still only a RC, so this is not expected.

We'll see if we can quickly adjust our dependency definitions to prevent this in the immediate term.

@madpah madpah self-assigned this Feb 15, 2022
madpah added a commit that referenced this issue Feb 15, 2022
Signed-off-by: Paul Horton <phorton@sonatype.com>
madpah added a commit that referenced this issue Feb 15, 2022
Signed-off-by: Paul Horton <phorton@sonatype.com>
@madpah
Copy link
Collaborator

madpah commented Feb 15, 2022

jake 1.4.5 has been released which should resolve this issue @angushenderson.

Can you let us know if that is not the case please?

Thanks again!

madpah added a commit that referenced this issue Feb 15, 2022
Signed-off-by: Paul Horton <phorton@sonatype.com>
@angushenderson
Copy link
Author

Thank you so much @madpah, that's all working now!

madpah added a commit that referenced this issue Feb 21, 2022
* feat: typing of `jake` WIP

Signed-off-by: Paul Horton <phorton@sonatype.com>

* port of fix for #112

Signed-off-by: Paul Horton <phorton@sonatype.com>

* resolved a bunch of typing issues

Signed-off-by: Paul Horton <phorton@sonatype.com>

* ci: fixed parameter references

Signed-off-by: Paul Horton <phorton@sonatype.com>

* ci: fixed parameter references

Signed-off-by: Paul Horton <phorton@sonatype.com>

* ci: fixed mypy

Signed-off-by: Paul Horton <phorton@sonatype.com>

* fix: updated `ossindex-lib` to latest RC which now appears to properly resolve caching issues #100

Signed-off-by: Paul Horton <phorton@sonatype.com>

* defined lowest dependencies and aligned

Signed-off-by: Paul Horton <phorton@sonatype.com>

* defined lowest dependencies and aligned

Signed-off-by: Paul Horton <phorton@sonatype.com>

* defined lowest dependencies and aligned

Signed-off-by: Paul Horton <phorton@sonatype.com>

* defined lowest dependencies and aligned

Signed-off-by: Paul Horton <phorton@sonatype.com>

* WIP: JSON output updated to use JSON serialisation
- All tests passing locally

Signed-off-by: Paul Horton <phorton@sonatype.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants