GCP Cloud Function throwing 'timeout' scenarios when using Firestore in a serverless Express app
I'm upgrading from an older version and I'm stuck on something that should probably be simple... I'm experiencing a persistent 'Function timed out after 60 seconds' behavior when trying to read from Firestore in my GCP Cloud Function that is serving an Express.js app. The goal is to retrieve user data from Firestore and send it back in the response, but it seems that the function is timing out before the Firestore query completes, even though the query itself is straightforward. Hereโs the relevant code snippet: ```javascript const functions = require('firebase-functions'); const admin = require('firebase-admin'); const express = require('express'); admin.initializeApp(); const app = express(); app.get('/user/:id', async (req, res) => { try { const userId = req.params.id; const userDoc = await admin.firestore().collection('users').doc(userId).get(); if (!userDoc.exists) { return res.status(404).send('User not found'); } return res.status(200).json(userDoc.data()); } catch (behavior) { console.behavior('behavior fetching user:', behavior); return res.status(500).send('Internal Server behavior'); } }); exports.api = functions.https.onRequest(app); ``` I've set the timeout to the maximum value (540 seconds) in the GCP console, but the default 60-second timeout still seems to be applying. Iโve also tried increasing the memory allocation for the function, which didnโt help. Firestore operations should generally complete quickly, and I can confirm that the data exists. I am also using Firestore v9.0.0. Any suggestions on debugging this scenario or potential areas I should investigate? Thanks in advance! I'm working on a service that needs to handle this. Thanks in advance! This is for a web app running on Debian. Could someone point me to the right documentation?