從今天早上開始,我收到以下錯誤,但我的代碼沒有任何改變(只是添加了一個 log.println() ......即使回到以前部署的版本也不能解決問題)trigger.go(入口點)// The function that runs with the cloud function itselffunc HandleUserCreateEvent(ctx context.Context, e my_project.FirestoreEvent) error { log.Println("-------------------- oldValue --------------------") log.Printf("Name: %s\n", e.OldValue.Name) log.Printf("CreateTime: %v\n", e.OldValue.CreateTime) log.Printf("Fields: %v\n", e.OldValue.Fields) log.Printf("UpdateTime: %v\n", e.OldValue.UpdateTime) log.Println("-------------------- newValue --------------------") log.Printf("Name: %s\n", e.Value.Name) log.Printf("CreateTime: %v\n", e.Value.CreateTime) log.Printf("Fields: %v\n", e.Value.Fields) log.Printf("UpdateTime: %v\n", e.Value.UpdateTime) log.Println("-------------------- jsonValue -------------------") jsonB, _ := json.Marshal(e.Value) log.Printf("Json: %v\n", string(jsonB)) log.Println("---------------------- DONE ----------------------") // My code return nildeploy.sh(還有一個 deploy.bat 和下面的 sh 腳本一樣工作)#!/usr/bin/env bash# Deployment automationname="HandleUserCreateEvent"projectId="my_project"collection="UsersCollection"# Must call go vendor as go modules are ignoredgo mod vendoryes Y | gcloud functions deploy ${name} \ --trigger-event providers/cloud.firestore/eventTypes/document.create \ --trigger-resource "projects/${projectId}/databases/(default)/documents/${collection}/{pushId}" \ --region europe-west1 \ --runtime go113 \ --allow-unauthenticated \ --memory 128由于這是完美的工作,現在它不再(如前所述,我只是添加了您在上面看到的代碼的 jsonValue 部分)
錯誤:(gcloud.functions.deploy)OperationError:代碼=3
慕碼人8056858
2022-06-13 15:22:15