jasondamour/discord-gcloud-commands

Deploy cloud function not Deploying

Closed this issue · 4 comments

I can't get it to deploy I'm wondering if I miss understudy something about setup.
image

Here is a screenshot of the structure of the code. Maybe you can spot a mistake?

image

@JeBenzon , There would be an error in the revision logs for a failure to deploy, can you open the logs and send the errors in a text code block (not screenshot)?

[ { "protoPayload": { "@type": "type.googleapis.com/google.cloud.audit.AuditLog", "authenticationInfo": { "principalEmail": "[Email]" }, "requestMetadata": { "callerIp": "2a05:f6c3:2063:0:bc2a:7497:c55e:8fb2", "callerSuppliedUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36,gzip(gfe),gzip(gfe)", "requestAttributes": { "time": "2022-02-05T17:59:59.218299Z", "reason": "8uSywAYQGg5Db2xpc2V1bSBGbG93cw", "auth": {} }, "destinationAttributes": {} }, "serviceName": "cloudfunctions.googleapis.com", "methodName": "google.cloud.functions.v1.CloudFunctionsService.CreateFunction", "authorizationInfo": [ { "resource": "projects/helical-decoder-316817/locations/europe-west1/functions/discord-app-7", "permission": "cloudfunctions.functions.create", "granted": true, "resourceAttributes": {} } ], "resourceName": "projects/helical-decoder-316817/locations/europe-west1/functions/discord-app-7", "request": { "location": "projects/helical-decoder-316817/locations/europe-west1", "function": { "labels": { "deployment-tool": "console-cloud" }, "runtime": "nodejs16", "httpsTrigger": { "securityLevel": "SECURE_OPTIONAL" }, "serviceAccountEmail": "app-engine-default-service-acc@helical-decoder-316817.iam.gserviceaccount.com", "availableMemoryMb": 128, "maxInstances": 3000, "sourceUploadUrl": "https://storage.googleapis.com/gcf-upload-europe-west1-5e8e6b0f-8b5d-45a2-8495-0c4a42aed60d/42bd84c8-0dd2-4935-9010-9743f87744c1.zip?GoogleAccessId=service-903418723039@gcf-admin-robot.iam.gserviceaccount.com&Expires=1644085797&Signature=G%2B2dAb7vUJCHhaDjyRxS9oCOWhmHnLQaIfKmO%2Be4SDQKbqXmMJjKDS2DTBIos1rwhEqNqwApEDALTP1DE8x8SupcF6pnJW1W9aMmDyULd1%2BIAuADffUCSxT%2FKLGpDZjrLo3qhf6bEPpUwP6M6fQhwo6g%2BFuxplr1XjdHAYpcVgqDGag18vzNrIEpDnO60EkR3fChRJ19qy0mcBiKQd5WbvlQJ0RcTaFVpwbysGZDDN82V%2FAJCzMwYjRE2uA66Me6vfFwlKhuTanAR063YU0qICm5Cc8GKfOiyM4t4N%2Fq%2BzCDPZBqV4eNISiW1efFLtd9KVayqzXf01wzkPUgTr3aiA%3D%3D", "ingressSettings": "ALLOW_ALL", "timeout": "60s", "name": "projects/helical-decoder-316817/locations/europe-west1/functions/discord-app-7", "entryPoint": "slash-create" }, "@type": "type.googleapis.com/google.cloud.functions.v1.CreateFunctionRequest" }, "resourceLocation": { "currentLocations": [ "europe-west1" ] } }, "insertId": "kjhy8tdqrwa", "resource": { "type": "cloud_function", "labels": { "project_id": "helical-decoder-316817", "region": "europe-west1", "function_name": "discord-app-7" } }, "timestamp": "2022-02-05T17:59:58.986449Z", "severity": "NOTICE", "logName": "projects/helical-decoder-316817/logs/cloudaudit.googleapis.com%2Factivity", "operation": { "id": "operations/aGVsaWNhbC1kZWNvZGVyLTMxNjgxNy9ldXJvcGUtd2VzdDEvZGlzY29yZC1hcHAtNy9POUxNZnFHcXVXTQ", "producer": "cloudfunctions.googleapis.com", "first": true }, "receiveTimestamp": "2022-02-05T17:59:59.281788416Z" }, { "textPayload": "Function 'slash-create' is not defined in the provided module.", "insertId": "000000-5b6284ad-ac8c-4c6e-a175-db4eac62437e", "resource": { "type": "cloud_function", "labels": { "function_name": "discord-app-7", "region": "europe-west1", "project_id": "helical-decoder-316817" } }, "timestamp": "2022-02-05T18:01:42.851Z", "labels": { "execution_id": "" }, "logName": "projects/helical-decoder-316817/logs/cloudfunctions.googleapis.com%2Fcloud-functions", "receiveTimestamp": "2022-02-05T18:01:44.287734537Z" }, { "textPayload": "Did you specify the correct target function to execute?", "insertId": "000001-7260b0ed-23c9-4625-b6c7-090edf0beac7", "resource": { "type": "cloud_function", "labels": { "function_name": "discord-app-7", "project_id": "helical-decoder-316817", "region": "europe-west1" } }, "timestamp": "2022-02-05T18:01:42.851Z", "labels": { "execution_id": "" }, "logName": "projects/helical-decoder-316817/logs/cloudfunctions.googleapis.com%2Fcloud-functions", "receiveTimestamp": "2022-02-05T18:01:44.287734537Z" }, { "textPayload": "Could not load the function, shutting down.", "insertId": "000002-8a2d28ba-d369-49ba-94b1-fa522f1feef0", "resource": { "type": "cloud_function", "labels": { "region": "europe-west1", "project_id": "helical-decoder-316817", "function_name": "discord-app-7" } }, "timestamp": "2022-02-05T18:01:42.851Z", "labels": { "execution_id": "" }, "logName": "projects/helical-decoder-316817/logs/cloudfunctions.googleapis.com%2Fcloud-functions", "receiveTimestamp": "2022-02-05T18:01:44.287734537Z" }, { "textPayload": "Function cannot be initialized. Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging\n", "insertId": "000000-e972c2a7-36bf-408d-a80c-d02addbfd0bf", "resource": { "type": "cloud_function", "labels": { "region": "europe-west1", "project_id": "helical-decoder-316817", "function_name": "discord-app-7" } }, "timestamp": "2022-02-05T18:01:43.998073087Z", "severity": "ERROR", "labels": { "execution_id": "" }, "logName": "projects/helical-decoder-316817/logs/cloudfunctions.googleapis.com%2Fcloud-functions", "receiveTimestamp": "2022-02-05T18:01:44.287734537Z" }, { "protoPayload": { "@type": "type.googleapis.com/google.cloud.audit.AuditLog", "status": { "code": 3, "message": "Function failed on loading user code. This is likely due to a bug in the user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation." }, "authenticationInfo": { "principalEmail": "[Email]" }, "serviceName": "cloudfunctions.googleapis.com", "methodName": "google.cloud.functions.v1.CloudFunctionsService.CreateFunction", "resourceName": "projects/helical-decoder-316817/locations/europe-west1/functions/discord-app-7" }, "insertId": "-at7sqdc1p6", "resource": { "type": "cloud_function", "labels": { "region": "europe-west1", "project_id": "helical-decoder-316817", "function_name": "discord-app-7" } }, "timestamp": "2022-02-05T18:01:44.066649Z", "severity": "ERROR", "logName": "projects/helical-decoder-316817/logs/cloudaudit.googleapis.com%2Factivity", "operation": { "id": "operations/aGVsaWNhbC1kZWNvZGVyLTMxNjgxNy9ldXJvcGUtd2VzdDEvZGlzY29yZC1hcHAtNy9POUxNZnFHcXVXTQ", "producer": "cloudfunctions.googleapis.com", "last": true }, "receiveTimestamp": "2022-02-05T18:01:44.884470402Z" } ]

I'm not sure this is the right log.
Hope it is, its a really cool project, really want to get it working!

Function 'slash-create' is not defined in the provided module

the default name of the exposed function is interactions