fix: handle PermissionError for local_folder - #174
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the RAG ingestion path by validating write permissions for the local_folder used for S3 downloads and falling back to /tmp when needed, while keeping the top-level local ingestion directory consistent with the prior fix in PR #173.
Changes:
- In
populate_vector_db, add a pre-check that attempts to create the configuredlocal_folder, logging and switching to a/tmp/-based path onPermissionError. - Update
download_s3_folder_to_localto accept an explicitlocal_folderparameter instead of deriving it from the S3 prefix, ensuring all regions download under the same top-level local folder. - Remove the per-region directory-creation and permission handling from
download_s3_folder_to_local, centralizing that logic inpopulate_vector_db.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
michelle-hadfield-nava
approved these changes
Jan 30, 2026
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.
Ticket
Following up from this comment
Changes
If needed, set alternative
/tmplocal_folder before the for-loopTesting
Preview environment for frontend
♻️ Environment destroyed ♻️
Preview environment for app
♻️ Environment destroyed ♻️