Netflix-Skunkworks / Scumblr

Web framework that allows performing periodic syncs of data sources and performing analysis on the identified results
Apache License 2.0
2.64k stars 317 forks source link

Issue creating new Scumblr task search #135

Closed geometric-networks closed 7 years ago

geometric-networks commented 7 years ago

Hi,

I have an issue where after tying my API keys for Google, Facebook, eBay, etc... I continue to get access denied or error messages when attempting to create new tasks that search these services. I checked the permissions for scumblr.rb and they don't appear to be different from the other files. I'm not sure how to troubleshoot further. Any suggestions?

Thanks in advance

ahoernecke commented 7 years ago

Hi, can you be more specific on the error messages your receiving and from where? If you could post screenshots of the errors your getting it might be useful.

geometric-networks commented 7 years ago

Yep, screenshots are below. In Scumblr's WebUI, under TASKS, New Task, all the API keys I defined in /home/"usr"/Scumblr/environments/initializer/scumblr.rb are not working in the WebUI.

twitter google github youtube ebay

ahoernecke commented 7 years ago

A few things,

  1. I'm assuming you've restarted your server?
  2. The path you posted for the scumblr.rb file is not correctly. The location should be /home/Scumblr/config/initializers/scumblr.rb Please make sure it's in the right place.
  3. If fixing the above doesn't work can you please post a (redacted) screenshot of your scumblr.rb file?

Thanks

geometric-networks commented 7 years ago

Ahoernecke,

  1. Yes. No luck.
  2. So I would need a user named Scumblr or ensure the Scumblr folder is in the /home system directory specifically, not inside a specific user folder?
  3. Step 2 didn't work after the folder move. See below. I am now seeing WebUI options for the logged in user that weren't there before. scumblr rb file

Thanks

ahoernecke commented 7 years ago

Based on your original comment it appeared the scumblr root directory was /home/Scumblr... It doesn't really matter what this is, but where have you have the scumblr code there should be a /config/initializer folder. This is where the scumblr.rb file need to be. In other words:

<scumblr folder>/config/initializers/scumblr.rb
geometric-networks commented 7 years ago

ahoernecke,

apologies for misclarification. original path was /home/"user"/Scumblr, but when I move to /home/Scumblr, I now see several new sections where I didn't before. That definitely helped! I don't understand the API error part. It's in the correct location: /home/Scumblr/config/initializers/scumblr.rb and the scumblr.rb.example file was taken out. File permissions are set to 0664.

ahoernecke commented 7 years ago

Can you post a redacted version of your scumblr file and a directory listing for the initializers folder?

geometric-networks commented 7 years ago

I did. Please see original thread: https://github.com/Netflix/Scumblr/issues/135

ahoernecke commented 7 years ago

Oh thanks, I missed it. I think I see what's happening here... The ENV["..."] syntax will load the value from an environment variable. So for example you have the google application set to ENV["Scumblr"]. This is going to check for an environment variable named "Scumblr" and set the value to that variable's value.

From looking at your config, I think what you've done is put the actual secret value in the quotes (i.e. ENV["secret here"]. This won't work because it will be looking for a environment variable with the secret's name.

If this is right you have two options:

  1. Either change the config back to how it was in the sample and then set the appropriate environment variables to the secret values

or

  1. If you'd rather put the secrets inline just change the config to be like this:
    config.google_developer_key = "secret_here"

    (In other works get rid of the ENV[] part)

geometric-networks commented 7 years ago

Np. Ah, I see I see. That makes sense. I completely overlooked something. Okay, I'll give that a try.

geometric-networks commented 7 years ago

I confirmed it works! Thank you. :)