Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging #8

Open
cjstone opened this issue Oct 2, 2018 · 7 comments
Open

Debugging #8

cjstone opened this issue Oct 2, 2018 · 7 comments
Assignees

Comments

@cjstone
Copy link

cjstone commented Oct 2, 2018

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

@spark2ignite
Copy link
Contributor

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?

@zen
Copy link

zen commented Apr 29, 2019

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
Copy link

zen commented Apr 29, 2019

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

@spark2ignite
Copy link
Contributor

@Dror88 can you please look into this?

@Dror88
Copy link
Collaborator

Dror88 commented Apr 30, 2019

@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'

@zen
Copy link

zen commented Apr 30, 2019

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

@Dror88
Copy link
Collaborator

Dror88 commented Apr 30, 2019

  • 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants