SynackAPI icon indicating copy to clipboard operation
SynackAPI copied to clipboard

DB initialization steps missing

Open x3419 opened this issue 1 year ago • 0 comments

Hi, Thanks for this project. After successfully setting up authentication with the OTP, I'm receiving the following error when calling h.targets.get_registered_summary():

sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) FOREIGN KEY constraint failed
[SQL: INSERT INTO targets (slug, category, organization, average_payout, codename, date_updated, end_date, is_active, is_new, is_registered, is_updated, last_submitted, start_date, vulnerability_discovery) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('scz3994tx0', 1, 'erwff4ugiu', 0.0, 'OPTIMUSDOWNLOAD', 0, 0, 0, 0, 1, 0, 0, 0, 1)]
(Background on this error at: https://sqlalche.me/e/14/gkpj)

This likely indicates that it's trying to insert a row into a table that contains a foreign key field, and the value we're trying to insert into the foreign key field doesn'texist in the table that the foreign key refers to. To resolve this, we would need to make sure that all foreign key values we're inserting already exist in their respective tables. This may be specific to OPTIMUSDOWNLOAD potentially, in which case we may need to add a check to skip that target.

Any help would be greatly appreciated.

x3419 avatar Jun 03 '23 06:06 x3419