gSlack icon indicating copy to clipboard operation
gSlack copied to clipboard

Debugging

Open cjstone opened this issue 5 years ago • 7 comments

Hi, gSlack looks like something very useful, but I'm having trouble getting it to work. I've followed the tutorial to a T several times, but nothing is showing Slack nor in the stackdriver logs. Any clues on how I can further troubleshoot things?

Thanks,

--Chris

cjstone avatar Oct 02 '18 16:10 cjstone

Hey @cjstone. We have updated the repo and have fixed few bugs. Would you like to try again and let us know if gSlack works for you?

spark2ignite avatar Apr 21 '19 14:04 spark2ignite

I'm having the same problem. I don't have much experience with Firebase projects, any hints how to debug? Project looks sooo cool, but I have hard time getting it to work

zen avatar Apr 29 '19 19:04 zen

I'm getting error like this: Rule test error in 'Bucket '${$.resource.labels.bucket_name}' was ${$.protoPayload.methodName==='storage.buckets.create'?'created':'deleted'} at location '${$.resource.labels.location}' by '${$.protoPayload.authenticationInfo.principalEmail}' in project '${$.resource.labels.project_id}'': SyntaxError: Unexpected string

zen avatar Apr 29 '19 19:04 zen

@Dror88 can you please look into this?

spark2ignite avatar Apr 29 '19 20:04 spark2ignite

@zen The error mentions the "test" field, but it looks like the rule "message" is being evaluated instead. Are you sure your firestore doc is according to the example in README.md?

The field "test" should be:

$.protoPayload.serviceName==='storage.googleapis.com' && ( $.protoPayload.methodName==='storage.buckets.create' || $.protoPayload.methodName==='storage.buckets.delete')

This checks that the event service is GCS and the operation is create or delete

And then the field "message" should be:

Bucket '${$.resource.labels.bucket_name}' was ${$.protoPayload.methodName==='storage.buckets.create'?'created':'deleted'} at location '${$.resource.labels.location}' by '${$.protoPayload.authenticationInfo.principalEmail}' in project '${$.resource.labels.project_id}'

Which will be evaluated to the following slack text message:

Bucket 'my-bucket' was deleted at location 'us' by '[email protected]' in project 'my-gcp-project'

Dror88 avatar Apr 30 '19 06:04 Dror88

Hi,

Thanks, that was obvious, what a bummer. Now I corrected it, created bunch of buckets in different projects but I don't seem to be able to get any notifications. I guess I'm missing something very simple here. Some functions were triggered, I also see the logs in Stackdriver, but no notifications https://www.dropbox.com/s/0ut9p7skue36oj4/Screenshot%202019-04-30%2014.06.32.png?dl=0

zen avatar Apr 30 '19 12:04 zen

  • Are there any errors now?
  • Are the buckets you created and gslack function in different projects? if so, how did you set up the logging export/sink? (the basic example assumes everything is in the same project)

Dror88 avatar Apr 30 '19 14:04 Dror88