-
Notifications
You must be signed in to change notification settings - Fork 6
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
Surveda crashes when Guisso returns invalid oauth token #2218
Comments
I'm reproducing on my local: I have a Verboice channel configured in Surveda on my local environment and I configured Guisso for everything. If I try to start Surveda before I start Guisso (i.e. which happens all the time, because I always forget to start Guisso), then Surveda crashes because it can't get a valid token on behalf of Verboice. Once I start Guisso, then Surveda won't crash anymore on start. Verboice on the other hand doesn't have any issue: it simply reports the channel as Unauthorized. |
What type of channel do you have configured? I setup an smpp channel and have tried many permutations of logging in, logging out, and loading pages with guisso not running and guisso running and I haven't got anything to crash so far. I mostly get redirected to a guisso url that doesn't load when guisso is down but surveda hasn't crashed from that. |
@ysbaddaden will provide the steps to reproduce the crash. |
I'll try to reproduce more exactly. It was either the QST simulator (SMS) or the Twilio simulator. |
What's breaking is the internal OAuth tokens for channels, not the OAuth web flow for connecting the UI to Surveda. Surveda is requesting guisso for an oauth token for talking with verboice or nuntium, then will regularly refresh it after some minutes (e.g. when restarting surveda after some time). |
@nthiad I don't know if the latest comments by Julien, help you to reproduce the issue. |
I've tried more things and I've been working on other patches but I still haven't been able to reproduce this issue either intentionally or by working on other tickets. |
For future reference: I forgot to start Guisso on my local, and Surveda won't start properly. Here's the stacktrace:
The Survey Broker needs to communicate with verboice (to cancel some calls if I'm reading this correctly). For that it needs to refresh the access token from Guisso, but Guisso isn't started so it fails. In my log, I have a second attempt, and then nothing. The Erlang process doesn't exit, but I can't reach Surveda from the Web. It's left in a zombie-like state. |
When Guisso returns an invalid token (e.g.
expires_at
isnil
instead of an UNIX timestamp), the Broker crashes, taking down the whole Surveda application altogether.Surveda should be resilient to such issues. In the worst case, only the oauth
gen_server
should crash yet be restarted by its supervisor (and not crash the whole app). At best, failing to refresh an oauth token should be taken care of: consider the channel down and try again later (probably)? delete the token?Related to instedd/guisso#83
The text was updated successfully, but these errors were encountered: