[Bug] Add dependency health check for poppler-utils #349
Open
BhakktiGautam wants to merge 2 commits into
Open
Conversation
|
@BhakktiGautam is attempting to deploy a commit to the Durgeshwar's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Following up on PR #337 (PDF Images Extractor). Please review and add GSSoC label when possible. Thanks! 🙏 |
5 tasks
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.
📌 Closes Issue
Closes #329
🐛 Problem
When poppler-utils is missing on the host system, users see a cryptic 500 error after uploading a PDF. This provides no actionable feedback.
✅ Solution
Add a health check endpoint that validates system dependencies before users attempt conversions.
🚀 What's New?
Backend
GET /health/dependencies- Returns status of all system dependenciesGET /health- Simple health checkFrontend
DependencyWarningcomponent - Shows non-intrusive warning banner📁 Files Added/Modified
New Files
backend/utils/dependency_checker.pybackend/blueprints/health.pyfrontend/src/components/DependencyWarning.jsxModified Files
backend/main.pyfrontend/src/App.jsx🔧 API Response Example
{ "status": "degraded", "dependencies": { "poppler-utils": { "installed": false, "required_for": ["PDF to PNG", "PDF to DOCX"], "install_command": "apt-get install poppler-utils", "brew_command": "brew install poppler", "windows_command": "conda install -c conda-forge poppler" }, "tesseract-ocr": { "installed": true, "required_for": ["Image OCR"], "install_command": "apt-get install tesseract-ocr" }, "ghostscript": { "installed": false, "required_for": ["PDF compression"], "optional": true, "install_command": "apt-get install ghostscript" } }, "critical_missing": ["poppler-utils"] } Rule Compliance No data storage No external APIs Pure file manipulation 🧪 How to Test Backend bash curl http://localhost:5000/health/dependencies Frontend Start the app See warning banner if poppler missing Click close button to dismiss ##Checklist /health/dependencies returns accurate status Warning banner shows before upload Works on Windows/Linux/Mac (commands for all OS) Close button to dismiss banner