DavisPL / cargo-sherlock

Cargo Sherlock 🕵️ is an automated reasoning tool for modeling and understanding trust in the Rust supply chain ecosystem.
MIT License
14 stars 1 forks source link

Crash in retrieving crate data #7

Closed abasu2 closed 1 month ago

abasu2 commented 1 month ago

The code seems to crash when trying to fetch the number of stars and forks for crate bigint v4.4.3 and some others. Here's my traceback:

Traceback (most recent call last):
  File "/home/abasu/reu/cargo-sherlock/solver.py", line 182, in <module>
    main()
  File "/home/abasu/reu/cargo-sherlock/solver.py", line 179, in main
    complete_analysis(crate)
  File "/home/abasu/reu/cargo-sherlock/solver.py", line 160, in complete_analysis
    summary = memoized_crate_analysis(crate)
  File "/home/abasu/reu/cargo-sherlock/solver.py", line 76, in memoized_crate_analysis
    metadata = crate_data.get_crate_metadata(crate)
  File "/home/abasu/reu/cargo-sherlock/helpers/crate_data.py", line 25, in get_crate_metadata
    logger.logger(crate.name, crate.version, "exp")
  File "/home/abasu/reu/cargo-sherlock/helpers/logger.py", line 828, in logger
    information = get_stars_and_forks(crate_name)
  File "/home/abasu/reu/cargo-sherlock/helpers/logger.py", line 58, in get_stars_and_forks
    repository_url = repository_url.rstrip('.git')
AttributeError: 'NoneType' object has no attribute 'rstrip'
muhammad-hassnain commented 1 month ago

Getting Logging Information About Crate bigint-4.4.3... This crate has been flagged by RustSec. This crate has not been audited by any organization. Failed to retrieve data: 404 Logging information for bigint-4.4.3: defaultdict(<class 'list'>, {'audits': [], 'dependencies': [CrateVersion(name='byteorder', version='1.5.0'), CrateVersion(name='crunchy', version='0.2.2')], 'developers': ['NikVolf', 'github:paritytech:core-devs'], 'downloads': 706366, 'failed_rudra': True, 'forks': 0, 'in_rust_sec': True, 'num_side_effects': 0, 'stars': 0})

It does not crash on my end, I do see a 404, which leads to 0 stars and forks. I am investigating that.

muhammad-hassnain commented 1 month ago

The error was due to parsing issue on the github repo url. It has been fixed.