I have deployed a FastAPI application in Snowflake Snowpark Container Services (SPSC), and while the service appears to be running successfully, when I hit my API endpoints, I'm getting Snowflake's default UI HTML response instead of my FastAPI JSON responses. Environment
Platform: Snowflake Snowpark Container Services (SPCS)
Framework: FastAPI (Python)
Container Status: RUNNING
Endpoint Status: PUBLIC endpoint accessible
spec:
containers:
- name: main
image: /my_db/my_schema/image_repository/my_img:v1
env:
PYTHONUNBUFFERED: "1"
TOKEN: "changeme"
SERVER_PORT: 8080
resources:
requests:
memory: 2Gi
cpu: 1000m
limits:
memory: 4Gi
cpu: 2000m
readinessProbe:
port: 8080
path: /healthz
endpoints:
- name: fastapi-endpoint
port: 8080
public: true
Expected Behavior When I send a POST request to https://my-endpoint.snowflakecomputing.app/api/data with body:
json{
"image": "base64_image_string",
"bill_no": "1000",
"sheet_no": "466432",
"attempt": "5"
}
I should get:
json{
"status": "failed",
"message": "Not Detected",
"bill_no": "100017119874",
"sheet_no": "466432",
"crop_image_path": ""
}
Actual Behavior Instead, I'm getting a Snowflake UI HTML page (login form or default Snowflake interface) rather than my FastAPI JSON response.
Troubleshooting Done
✅ Verified service status is RUNNING
✅ Confirmed container is healthy via SHOW SERVICE CONTAINERS
✅ Verified endpoint is accessible and returns 200 status
✅ FastAPI app starts successfully (no errors in logs)
✅ Health check endpoint /healthz works correctly as I got it in logs from spsc(SELECT SYSTEM$GET_SERVICE_LOGS('my_service', '0', 'main');) but getting same html response for this also in postman
✅ Verified port 8080 is correctly configured in both container and endpoint