-
Notifications
You must be signed in to change notification settings - Fork 16
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
Bad entries in Hall D CCDB? #73
Comments
Note that query.py is coming from the rcdb library. Doesn't seem that it should work like that... |
good point, I missed that... that is super weird... |
Taking out the RCDB library, I get: checking /FDC/fdc_drift ... In the end, both cases are calling the same (?) sqlalchemy library, so maybe this is not so surprising... |
Hi! query.one - requires exactly one data record from a database while multiple rows has been returned. That triggers this exception. This relates to this query: query = self.session.query(TypeTable)
.filter(TypeTable.name == table_name,
TypeTable.parent_dir_id == parent_dir.id) So somehow there are two |
But you should see it with ls command |
Oh, you're right. That's not good... how in the world did that happen? I'll have to look at the logs... Any suggestions on how to cleanly get rid of one of these? For what it's worth, it looks like this table is not actually used in the current halld_recon. |
There is also get_type_tables method. You can quickly use it to check what is happening tables = db.get_type_tables('/FDC/')
for table in tables:
print(table.name, table.path)
for constant_set in table.constant_sets:
print(constant_set.assignment)
print(constant_set.assignment.run_range.min
You can look at all properties here |
MariaDB [ccdb]> select * from typeTables where name = "fdc_drift"; |
If there is no assignments just delete one. It might be cumbersome with the commands, but API is db.delete_type_table(table) tables = db.get_type_tables('/FDC/')
for table in tables:
if table.name == 'fdc_drift':
db.delete_type_table(table) |
MariaDB [ccdb]> select * from constantSets where constantTypeId = 11; MariaDB [ccdb]> select * from constantSets where constantTypeId = 14; |
looks like they are not used. Dmitry, do you agree? |
Yep. The question is how that happened |
Since there are no constants assigned for fdc_drift(id = 11) nor for fdc_drift(id = 14) we could delete either or both directly from the database table with no harm done, no? |
No harm |
I'll touch base with Lubomir and Keigo... |
Probably Simon is the one to ask, in any case, if they were created in 2017 and not used, I will delete them... |
I cleaned these tables, and another one. So let me be a bad user, and ask a question related to the original issue I was referring to, which is driving me crazy. So, doing a "ccdb log" on the MySQL CCDB is fine, but when working on a fresh SQLite copy, I get the following error:
I'm not sure where this comment is coming from? When I first ran into this yesterday, I set this long comment to the empty string. My attempt to find it in the SQLite file is below. Could the comment be hiding somewhere else?
|
Hi guys, Thanks, Sean |
I did look at the mysql db with the mysql command line. I could not find the offending comment. |
While tracking down an issue related to the SQLite files used in Hall D (JeffersonLab/halld_sim#178 (comment)), I noticed that there is some weird issue in getting assignments from a couple of tables. Basically, I am trying to loop through all the assignments for each table to track down problematic comment field data.
In two cases, I get the following error:
checking /FDC/fdc_drift ...
Traceback (most recent call last):
File "search.py", line 65, in
main()
File "search.py", line 57, in main
assigns = ccdb1.get_assignments(table.path)
File "/group/halld/Software/builds/Linux_CentOS7.7-x86_64-gcc4.8.5/ccdb/ccdb_1.06.06/python/ccdb/provider.py", line 1123, in get_assignments
table = self.get_type_table(path_or_table)
File "/group/halld/Software/builds/Linux_CentOS7.7-x86_64-gcc4.8.5/ccdb/ccdb_1.06.06/python/ccdb/provider.py", line 481, in get_type_table
table = query.one()
File "/group/halld/Users/sdobbs/rcdb/python/sqlalchemy/orm/query.py", line 2817, in one
"Multiple rows were found for one()")
sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one()
Any idea what could be causing this? I have attached a script that can reproduce the problem: search.py.txt
The text was updated successfully, but these errors were encountered: