When I try to deploy my newly created Firebase PubSub function, I get the error Error: Failed to create scheduler job projects/workouts-uat/locations/europe-west1/jobs/firebase-schedule-dailyTasks-eur3: HTTP Error: 400, Schedule or time zone is invalid.
My function is declared as follows:
exports.dailyTasks = functions
.region('europe-west2')
.pubsub
.schedule('every 24 hours 00:00')
.timeZone('Africa/Johannesburg')
.onRun(...);
From my research I found that that the region used should be the same as the region found in your project settings, which in my case is eur3 (europe-west)
. All my existing onCall
functions use europe-west2
which is why I tried to go with that first, but after finding my project settings region I updated to .region('eur3')
and .region('europe-west')
, but the error persists. So how do I successfully deploy this function?
Another hint I came across while googling the error was that a "Google App Engine (GAE) app" has to be created for pubsub functions to work, but I'm assuming that happens automatically on function deploy, right? Otherwise how does one create that? I have zero experience with GCP.