File upload fails in dev environment with permission denied error
Bug Description
User file uploads fail in the dev environment with a permission denied error, while working correctly in local development.
Root Cause
The file service ECS task definition is missing the EFS mount for /user_files. The file service code attempts to write files to /user_files/{user_id}/{filename}, but this directory doesn't exist in the container because the corresponding EFS access point is not mounted.
Location: terraform/task-file-service.tf:52-68
Current Configuration
The file service only mounts three EFS volumes:
/tenants/artifacts/namespaces
Missing: /user_files
Impact
- Users cannot upload files to their user files storage in dev environment
- Results in permission denied errors when attempting file uploads
- Blocks user file management functionality
Why It Works Locally
In local Docker Compose development, the /user_files directory is created as a Docker volume or host mount, so the issue doesn't manifest locally.
Solution
Add the missing user_files EFS volume mount to the file service task definition:
user_files = {
id = aws_efs_file_system.data.id
mount = "/user_files"
access_point_id = aws_efs_access_point.user_files.id
}
Fix Status
✅ Fix implemented in terraform/task-file-service.tf
⏳ Needs to be deployed to dev environment
Related Files
terraform/task-file-service.tf- File service ECS task definitionterraform/efs.tf- EFS access point definitions (user_files access point already exists)backend/services/file-service/main.py:261-312- User file upload handler
Testing After Fix
- Deploy terraform changes to dev environment
- Attempt to upload a user file via the GraphQL API
- Verify file is successfully stored and accessible
- Check ECS task logs for any permission errors
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗