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

SAWarning: relationship 'SBHash.reflist' will copy column sbclient_v4_lists.id to column sbclient_v4_hashes.reflist_id #10

Closed
guardiandigital opened this issue Jun 19, 2022 · 2 comments · Fixed by #11

Comments

@guardiandigital
Copy link

guardiandigital commented Jun 19, 2022

I'm seeing the following warning/error when attempting to update the clamav safebrowsing data using clamsbwrite.py:

$ ./clamsbwrite.py --config /etc/clamd.d/safebrowsing.conf
./clamsbwrite.py:36: SAWarning: relationship 'SBPrefix.hashes' will copy column sbclient_v4_prefixes.reflist_id to column sbclient_v4_hashes.reflist_id, which conflicts with relationship(s): 'SBList.hashes' (copies sbclient_v4_lists.id to sbclient_v4_hashes.reflist_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="hashes"' to the 'SBPrefix.hashes' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  lists = session.query(db.SBList).all()

./clamsbwrite.py:36: SAWarning: relationship 'SBHash.reflist' will copy column sbclient_v4_lists.id to column sbclient_v4_hashes.reflist_id, which conflicts with relationship(s): 'SBPrefix.hashes' (copies sbclient_v4_prefixes.reflist_id to sbclient_v4_hashes.reflist_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="hashes"' to the 'SBHash.reflist' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)

/etc/clamd.d/safebrowsing.conf

<safebrowsing>
    # Google's apikey for the safebrowsing datafeed
    apikey = AIzaSyBwvw...L44_fvY8WVaM

    ## MySQL database parameters
    db_host = havoc.example.com
    db_user = sbclient
    db_pw = pass
    db_name = sbclient

    ## outputdir is where the update python makes its safebrowsing.gdb
    outputdir = /var/lib/clamav/
</safebrowsing>

This is on fedora35 with python3-3.10.4-1.fc35.x86_64

@micahsnyder
Copy link
Contributor

Hi @guardiandigital,

The primary developer for this tool is a former team member that no longer works with us. So ramping up on understanding and fixing this issue would take some time for whomever does it.

Can you tell me if this issue is fatal or if it is just a passing warning and you're able to still generate the safebrowsing.gdb database?

Regards,
Micah

@guardiandigital
Copy link
Author

Hi @micahsnyder - it doesn't appear that the hashes, lists, prefixes, and updates tables are being updated.

Last update appears to be more than six months ago?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants