Skip to content

Crash: ValueError: Unknown check type '' for sites without checkType in data.json #3215

Description

@ahron-prog

Checklist

  • I'm reporting a bug in Maigret functionality
  • I've checked for similar bug reports including closed ones
  • I've checked for pull requests that attempt to fix this bug

Description

Maigret version info:

maigret 0.6.6
Socid-extractor:  0.1.1
Aiohttp:  3.13.5
Requests:  2.34.2
Python:  3.12.0

OS: Linux x86_64 (Debian-based VPS)

How to reproduce:

maigret jak2k --site sr.ht

or any full scan (--all-sites) that includes one of the affected sites.

The scan crashes with:

ValueError: Unknown check type '' for site 'sr.ht'

Root cause

Some entries in data.json have neither a checkType field nor an engine. For those, MaigretSite.check_type keeps its class default "" (see maigret/sites.py), and process_site_result() in maigret/checking.py falls through to the final else branch and raises:

raise ValueError(f"Unknown check type '{check_type}' for site '{site.name}'")

Currently 3686 of 6206 entries in data.json lack checkType, but almost all of them use an engine that supplies check_type at runtime, so they work fine. The crash only happens for entries with neither checkType nor an engine. Affected sites I've confirmed in the current DB:

  • cs.cmu.edu
  • eggplant.place
  • neodb.social
  • sr.ht
  • taittsuu.com
  • tilde.club

All six are simple profile-URL sites (url like https://sr.ht/~{username}) with no urlProbe and no presence strings, so a status_code check against the profile URL is the natural behavior.

Proposed fix

In MaigretSite.__init__, normalize an empty check_type to "status_code" (without adding it to stated_fields, so entries that use an engine still get the engine's check_type with the existing precedence logic). I'm happy to open a PR with the fix + a regression test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions