Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 5, 2025

Fixes #6717

This PR improves error handling when the Roo Code extension fails to connect to Qdrant for projects on external drives.

Changes

  • Added detailed logging to detect external drive paths (macOS, Windows, Linux)
  • Added pre-connection validation to check Qdrant accessibility
  • Improved error messages with specific handling for Internal Server Error (500)
  • Added comprehensive test coverage for all new error scenarios

Testing

  • All existing tests pass
  • Added 10 new test cases for enhanced error handling
  • Tested with mocked Qdrant responses

Important

Improves Qdrant connection error handling in QdrantVectorStore, with detailed logging and pre-connection validation, especially for external drives.

  • Behavior:
    • Enhanced error handling in QdrantVectorStore for Qdrant connection issues, especially for external drives.
    • Added pre-connection validation to check Qdrant accessibility in initialize().
    • Improved error messages for Internal Server Error (500) in initialize().
    • Detects and logs external drive paths in constructor.
  • Logging:
    • Added detailed logging for connection attempts and errors in qdrant-client.ts.
    • Logs Qdrant client configuration details and URL parsing errors.
  • Testing:
    • Added 10 new test cases in qdrant-client.spec.ts for enhanced error handling scenarios.
    • Tests include mocked Qdrant responses and external drive path detection.

This description was created by Ellipsis for 2ec84d9. You can customize this summary. It will automatically update as commits are pushed.

- Add detailed error logging for external drive paths detection
- Improve error messages for Qdrant connection failures
- Add pre-connection check to validate Qdrant accessibility
- Handle Internal Server Error (500) responses with specific messages
- Add comprehensive test coverage for new error scenarios

Fixes #6717
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing my own code is like debugging in production - technically possible but morally questionable.

this.qdrantUrl = parsedUrl

// Log workspace path for debugging external drive issues
console.log(`[QdrantVectorStore] Initializing with workspace path: "${workspacePath}"`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this level of console.log usage intentional? While helpful for debugging, it might be too verbose for production. Consider using a debug flag or a logger with configurable levels to avoid cluttering the console.

this.qdrantUrl = parsedUrl

// Log workspace path for debugging external drive issues
console.log(`[QdrantVectorStore] Initializing with workspace path: "${workspacePath}"`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workspace path being logged here could expose sensitive directory structures. Should we consider sanitizing or limiting what path information is logged for security reasons?

console.log(`[QdrantVectorStore] Initializing with workspace path: "${workspacePath}"`)

// Check if workspace path is on an external drive (common patterns)
const isExternalDrive =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This external drive detection logic might miss some edge cases. For example:

  • Network drives on Windows (\server\share)
  • Symlinked directories that point to external drives
  • Case sensitivity on different file systems

Is this intentional, or should we expand the detection logic?

this.vectorSize = vectorSize
this.collectionName = `ws-${hash.substring(0, 16)}`

console.log(`[QdrantVectorStore] Generated collection name: "${this.collectionName}" from workspace path`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting this log prefix as a constant to ensure consistency and make future changes easier. For example: const LOG_PREFIX = '[QdrantVectorStore]';

})
})

describe("External Drive Detection and Logging", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great test coverage! Consider adding test cases for the edge cases mentioned earlier:

  • Network drive paths (\server\share)
  • Symlinked directories
  • Mixed case drive letters on Windows

This would ensure the external drive detection is robust across all scenarios.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 5, 2025
@daniel-lxs
Copy link
Member

This is too specific, closing for now

@daniel-lxs daniel-lxs closed this Aug 6, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 6, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

External Drive Project Fails to Index: Internal Error Connecting to Qdrant Roo Code Indexing Fails to Connect to Qdrant Vector Database

4 participants