My application has a multi-step process for analyzing uploaded files. The final step, which involves a fetch
call from the /api/upload-complete
serverless function to the /api/process
serverless function, is failing silently.
Flow:
- Client uploads a file, which successfully creates a job (
/api/jobs
). - File is successfully uploaded to Vercel Blob.
- Client calls
/api/upload-complete
. This function logs that it is successful and attempts to trigger/api/process
viafetch
. - The Vercel logs show the
/api/upload-complete
function completes with a200 OK
status. - However, no log entries for
/api/process
are ever created. The request appears to vanish.
Debugging Steps Taken: We have exhaustively debugged every potential cause with the help of Gemini, including:
- Environment Variables: Confirmed that
BLOB_READ_WRITE_TOKEN
,INTERNAL_TRIGGER_SECRET
,KV_REST_API_URL
, andKV_REST_API_TOKEN
are all present and correctly configured in the production environment. - KV Store: Created and linked a Vercel KV (Upstash) database and confirmed the
KV_
prefix is correct. The database shows zero usage, confirming it’s never being reached. - Function Runtime: Forced all relevant API routes (
/api/jobs
,/api/upload
,/api/upload-complete
,/api/process
) to use the Node.js runtime viaexport const runtime = 'nodejs';
. Vercel logs confirm they are running on Node.js 22.x. - Testing the Target Function: We have proven the
/api/process
function is alive and deployed correctly by sending aGET
request to it directly, which correctly returns a405 Method Not Allowed
error, and this error does appear in the Vercel logs.
QUestion: The /api/process
function is reachable, but POST
requests sent from other serverless functions within the same project are being dropped without any error or log record. This points to a potential platform-level issue with internal networking or request processing. Please investigate why the fetch
call from /api/upload-complete
to /api/process
is failing to invoke the target function.