ginjo / slackspace

Slack integration for Rackspace notifications
7 stars 1 forks source link

Error on SlackSpace page signup #2

Open ghost opened 7 years ago

ghost commented 7 years ago

After entering Rackspace login/pass (or API key), I'm getting an Internal Server Error when taken to "https://slackspace.herokuapp.com/rackspace/login" page.

danifonseca commented 7 years ago

Same here!

ginjo commented 7 years ago

Hi @coltwest and @danifonseca, thanks for the reports.

@danifonseca, were your actions and the error you received the same as @coltwest 's? Were you both able to reproduce the error a 2nd (or nth) time? Any behavioral differences on different browsers?

Meanwhile, I'll see if I can pick anything out of the logs and code.

ghost commented 7 years ago

I'm able to reproduce it every time across Chrome and Safari.

ginjo commented 7 years ago

Thanks @coltwest - I just hit a similar error. It looks like the call to the Rackspace API is taking more time than it should. The Heroku router times out just before the web app returns. The call to Rackspace should be quick, so I'm guessing there was a change to their API that's blocking any kind of meaningful response to SlackSpace. I'll look into our code that calls the Rackspace API.

danifonseca commented 7 years ago

Good stuff, thanks for doing this, William. I had also tried chrome and safari.

On Thu, 18 May 2017 at 04:39, William Richardson notifications@github.com wrote:

Thanks @coltwest https://github.com/coltwest - I just hit a similar error. It looks like the call to the Rackspace API is taking more time than it should. The Heroku router times out just before the web app returns. The call to Rackspace should be quick, so I'm guessing there was a change to their API that's blocking any kind of meaningful response to SlackSpace. I'll look into our code that calls the Rackspace API.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ginjo/slackspace/issues/2#issuecomment-302291974, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoQ1sFyYdBTs9mbPqDOgeuDdINImc9cks5r672DgaJpZM4MwkoD .

goldencut commented 7 years ago

Same with latest, 54.0.1 Firefox on OSX Sierra.

DrizzlyOwl commented 7 years ago

Is there any update available for the Heroku demo app that would fix this timeout?

ginjo commented 7 years ago

I'm looking into the timeout error. I can't reproduce it consistently, and the logs suggest there might be something else contributing to this problem. I'll post back when I get some potential fixes uploaded to the staging server.

When the Rackspace login returns with an error, is anyone receiving anything other than a 500 "internal server error"?

ginjo commented 7 years ago

Ok, if someone could try out the staging server with their Rackspace credentials, the error should look different now. You may still get an error, but hopefully it will be a Ruby, Rack, or Sinatra error, instead of Heroku's generic 500 error. If this is the case, we have made some progress 😄 Please let me know what you get, either way. Thanks

Note that the staging server uses a separate database - different than the live production database. Any SlackSpace settings you create on the staging server will not be reflected on the production server.

DrizzlyOwl commented 7 years ago

@ginjo I got "Could not authenticate Rackspace credentials: An error occurred while authenticating with Rackspace." in response to using a username & API Key combination.

DrizzlyOwl commented 6 years ago

@ginjo Any update due soon?

ginjo commented 6 years ago

Hi @DrizzlyOwl , sorry if this is still an issue. It's tricky, because I have a hard time reproducing the error myself - not doubting that it happens for others though :sweat_smile: . I'll look into it again. I'm hoping that someday Rackspace adopts OAUTH access for its API (that's how the Slack part of this works). OAUTH shifts the core authentication process out of 3rd-party developers' hands and into the realm of the entity providing the authenticated service (Rackspace). It would pretty much eliminate this issue.

ginjo commented 6 years ago

Just curious, @DrizzlyOwl ... or anyone really, are you using Rackspace two-factor authentication on your Rackspace account?

DrizzlyOwl commented 6 years ago

@ginjo Yes! 2FA is enabled on my account, but surely that should be bypassed when using API Key? 🤔

ginjo commented 6 years ago

Ah, well, looks like it's time to build-out support for 2FA. If login using the API Key bypasses 2FA, that would seem to be a security hole. But if it requires 2FA, that would be rather inconvenient for some 3rd party apps.

Fortunately, this app does not need access to Rackspace, except when you are specifically asking it to. So if we're forced to use 2FA even while logging in with an API Key, it should still be workable.

Meanwhile, I've updated error handling and logging during the login process. Feel free to run a login attempt on the staging server, it helps with debugging :smile: (thanks).

EDIT: I believe I've uncovered a bug in the SlackSpace authentication process, not related to 2FA. I created a new user on my Rackspace account, and that user is consistently causing an error at signup/signin. The response from Rackspace is actually authenticated, but it's missing a field that the app is expecting. This happens with both password and api-key authentication (I don't have 2FA enabled on this new user yet). So, a little more debugging is in order. And never mind testing the server at this point; I have enough data to troubleshoot the issue.

ginjo commented 6 years ago

Ok, the bug should be fixed now. Rackspace sign-in should work correctly with either an api-key or with a password. If you have two-factor-auth enforced for your Rackspace user, use an api-key (Rackspace api-key login doesn't use 2FA).

goldencut commented 6 years ago

Hurray, it works! Thanks!

DrizzlyOwl commented 6 years ago

Hurray! @ginjo I've been able to sign-in using an API Key and send a test and have received it in Slack. What's next?

ginjo commented 6 years ago

Great to hear @goldencut and @DrizzlyOwl !

Drizzly, While I was working on the system tonight, I think I sent a test message to your Slack account mistakenly. Please accept my humblest apologies 😊

ginjo commented 6 years ago

@DrizzlyOwl , once you've activated the slack channels on the SlackSpace page, go to your Rackspace Intelligence control panel https://intelligence.rackspace.com. If you click the "Rackspace Notification" table heading on the SlackSpace page, it should take you there.

On the Rackspace site, attach the Notification (that SlackSpace created) to a Rackspace Notification Plan. Then attach the Plan to one of your Alarms.

It can be a little confusing on the Rackspace site. The Rackspace objects go like this.

The flow goes like this: A Check communicates with an Entity periodically. If an Alarm detects a problem, a Notification Plan is triggered. Then the Plan runs all of its Notifications.

DrizzlyOwl commented 6 years ago

@ginjo Maybe it's just me but is the formatting supposed to be like this?

Output from slackspace: slackspace-staging_herokuapp_com.Mixd.hosting

Shouldn't it match more closely to the fqdn? slackspace-staging.herokuapp.com...

Do I add the above to Rackspace as a "webhook"?

Similarly, I think the UX is a bit confusing. Perhaps we can discuss in a separate thread.

ginjo commented 6 years ago

@DrizzlyOwl , thanks for the feedback. The formatting you're referring to is just a display label. You can change the label in your Rackspace control panel for each notification definition that SlackSpace creates. I've been reworking some the data and UI presentation, so new integrations & notifications should be easier to read now. Happy to discuss UX issues further, but I think a new thread would be best.

When you activate a SlackSpace integration on a particular channel, SlackSpace creates the notification definition in your Rackspace account as type 'webhook'. The URL of the notification points to SlackSpace with an encrypted key (leave that URL as it is), so that SlackSpace knows exactly which team-domain and channel to forward the notification to. The only thing you need to do in your Rackspace account is add the newly created notification to a Rackspace Notification Plan. Then you're good to go.