2

When I deployed Cloud Functions from Cloud Source Repositries, I got a "Failed to retrieve function source code" and the deployment failed.

Some of the Cloud Functions currently running are deployed from Cloud Source Repositries, so I copied and deployed it, but I get the same error.

Deployment is done with GUI and Python 3.8 is used.

I didn't get this error until last week.

I've found information that there is a problem with the GCP payment method, but I haven't changed my payment information recently.

Please tell me what is the cause. I'm sorry if I'm not good at English and it's hard to read. Thank you.

{
protoPayload: {
@type: "type.googleapis.com/google.cloud.audit.AuditLog"
status: {
code: 3
message: "Failed to retrieve function source code"
}
authenticationInfo: {
principalEmail: "xxxxxx@xxxxxx"
}
serviceName: "cloudfunctions.googleapis.com"
methodName: "google.cloud.functions.v1.CloudFunctionsService.CreateFunction"
resourceName: "projects/xxxxxx/locations/asia-northeast1/functions/xxxxxx"
}
insertId: "-xxxxxx"
resource: {
type: "cloud_function"
labels: {
project_id: "xxxxxx"
function_name: "xxxxxx"
region: "asia-northeast1"
}
}
timestamp: "2021-02-03T10:56:30.332588Z"
severity: "ERROR"
logName: "projects/xxxxxx/logs/cloudaudit.googleapis.com%2Factivity"
operation: {
id: "xxxxxxx"
producer: "cloudfunctions.googleapis.com"
last: true
}
receiveTimestamp: "2021-02-03T10:56:30.618763199Z"
}
hanzawa
  • 29
  • 1
  • 4
  • There may be hundreds of reasons. Can you check the Stackdriver log to see any details there, please? – al-dann Feb 03 '21 at 15:25
  • How do you deploy your Cloud Functions? – guillaume blaquiere Feb 03 '21 at 15:41
  • @al-dann Thank you for your reply. I pasted the log at the beginning of the thread. – hanzawa Feb 03 '21 at 16:02
  • @guillaumeblaquiere Thank you for your reply.I opened Cloud Functions in the GUI and created it from there. SourceCode is obtained from Cloud Source Repositories. – hanzawa Feb 03 '21 at 16:03
  • and you have only one log message, have not you? I mean, in my experience, there should be a few (3 or 4) lines in logs, so it should be possible to get a bit more details about the failure reasons. – al-dann Feb 03 '21 at 16:20
  • @al-dann Only this one log was output after deployment. There are a few lines for other errors, but this time it was the only one. – hanzawa Feb 04 '21 at 00:16
  • CHange branch from main to master https://stackoverflow.com/questions/70431064/head-of-cloud-source-repository-is-not-pointing-to-any-commit. It did the trick for me – Varun Srivastava Jul 06 '23 at 10:46

1 Answers1

0

I deployed it now and it was successful. The procedure is exactly the same as last time.

I think it's a GCP bug, but there was no failure information. https://status.cloud.google.com/

I've solved it, so I'll close it. Thank you very much.

hanzawa
  • 29
  • 1
  • 4
  • Have you changed any files in your CSR before the issue resolved, by any chance? – Deniss T. Feb 04 '21 at 11:58
  • For some users, it might also help to re-enable the *Cloud Functions* and the *Cloud Source Repositories* APIs. – Deniss T. Feb 04 '21 at 12:01
  • @DenisT. Thank you for your reply. No, I haven't changed the CSR file. If the same thing happens in the future, try re-enable. – hanzawa Feb 05 '21 at 01:35