Bug Tracker: HuggingFace Spaces Deployment
This directory tracks bugs found during deployment to HuggingFace Spaces.
Active Bugs
None currently.
Fixed Bugs
| ID | Title | Severity | Status |
|---|---|---|---|
| 001 | CORS regex blocking static file requests | Critical | FIXED |
| 002 | HTTP vs HTTPS URL mismatch behind proxy | High | FIXED |
Common HuggingFace Spaces Pitfalls
Based on research and experience, here are common issues to watch for:
1. CORS Configuration
- HF Spaces URLs use single hyphens:
{username}-{spacename}.hf.space - Proxy/embed URLs may use double hyphens:
{username}--{spacename}--{hash}.hf.space - Always use a permissive regex that matches both formats
2. HTTPS Behind Proxy
- HF Spaces terminates SSL at their proxy
- Uvicorn sees HTTP internally
- Add
--proxy-headersto trustX-Forwarded-Proto - Or explicitly set
BACKEND_PUBLIC_URLenvironment variable
3. File System Restrictions
- Only
/tmpis writable - Use
/tmp/stroke-resultsfor output files - Ensure directories are created with proper permissions
4. Static Files
- Mount static files AFTER directory exists
- Ensure CORS allows file fetches from frontend origin
- Files served from
/files/...must be accessible
5. Environment Variables
HF_SPACES=1indicates running on HF SpacesSPACE_IDcontains the space identifier- Use these to detect production environment