fix: skip an unopenable database in usageapps instead of crashing - #1117
Merged
Conversation
open_sqlite_db_readonly returns None when the database cannot be opened, and get_usageapps called db.cursor() on it without checking, so an unreadable reflection_gel_events.db raised AttributeError and the main loop lost the artifact's rows. Guard the None the same way siminfo does (#1111): skip the file and move on. usageapps is the twin of siminfo, the only other artifact that normalises the path to forward slashes before opening it. This is the leaf half of the Windows long-path work; the URI double-prefix that made the open return None on a path over 260 characters was fixed in #1113. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
get_usageappsdiddb = open_sqlite_db_readonly(file_found)and thendb.cursor()with noNonecheck.open_sqlite_db_readonlyreturnsNone(and logs why) when the database cannotbe opened, so an unreadable
reflection_gel_events.dbraisedAttributeError. The main loopcatches it as "Reading ... artifact had errors!" and the artifact loses its rows.
Guard the
Noneand skip the file, identical to the fixsiminfoalready carries (#1111).Why just this one
This is the leaf follow-up to the Windows long-path fix (#1113). An audit found 315 direct
open_sqlite_db_readonlycall sites across the cores that use the result without aNonecheck, but per fix-what-fails only
siminfowas ever observed failing, and that cause(a >260-char path making the open return
None) is now fixed at the source in #1113.usageappsissiminfo's exact twin, the only other artifact that normalises the path toforward slashes before opening, so it gets the same guard. The remaining sites are
reachable-but-unobserved and are left for opportunistic guarding when each artifact is next
touched.
Testing
usageappsafter the change.