[SOLVED] GCP Cloud Function does not find Cloud Pub/Sub Topic

Hello everyone.

I know this is a GCP issue. But because it is indirectly related with ChirpStack, I am bringing it here. Maybe somebody more experienced with GCP might help me.

I was following this guide https://www.chirpstack.io/guides/google-cloud-platform/ to deploy ChirpStack in GCP. I am stuck on Create downlink Cloud Function.

The Cloud function fails on being deployed. This is the log:

Deployment failure:
indent preformatted text by 4 spaces
Build failed: go: finding google.golang.org/genproto v0.0.0-20190605220351-eb0b1bdb6ae6 
go: finding cloud.google.com/go v0.39.0 go: finding google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8 
go: finding google.golang.org/api v0.5.0 go: downloading cloud.google.com/go v0.39.0 
go: downloading google.golang.org/genproto v0.0.0-20190605220351-eb0b1bdb6ae6 
go: downloading google.golang.org/api v0.5.0 go: downloading google.golang.org/grpc v1.19.0 
go: downloading github.com/googleapis/gax-go/v2 v2.0.4 
go: downloading github.com/golang/protobuf v1.3.1 
go: downloading golang.org/x/net v0.0.0-20190311183353-d8887717615a 
go: downloading golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a 
go: downloading golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 
go: downloading golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 
go: downloading go.opencensus.io v0.21.0 
go: downloading github.com/hashicorp/golang-lru v0.5.0 
    # serverlessapp 
    ./worker.go:48:28: undefined: iotpubsub.HelloPubSub 
    ./worker.go:173:29: undefined: iotpubsub.HelloPubSub

When I re-edit the function, I can observe an error message: This selected message was not found in the list of topic projects.

Strange. As you can see, the topic is listed, but the function does not find it. I double-check in Pub/Sub, and it is there! I tried choosing from that list, and I also tried to create a topic. None of these attempts was successful.

I would appreciate any light here.

With regards

Sebastian

My mistake: I had omitted this specific instruction:

The Function to execute is called Send .

:man_facepalming:

can you tell me which go.mod file you have used since the go.mod that is being shown in quickstart guide for gcp is showing an error upon deployment. the error is because of module iotpubsub line, can you help me out with that what exactly we have to type there??

Hello @Suray_Mittal,

Thank you for your message. Unfortunately, I deleted that project long time ago. I have any record about that.
Wish you a great day.

With best regards

Sebastian