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

Adding a simple example app #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jtmoulia
Copy link
Contributor

@jtmoulia jtmoulia commented Apr 2, 2015

This made it easier for me to test social in isolation.

@koddo
Copy link

koddo commented May 13, 2015

Hello. Could you help me make this example work. I get an error, but I can't see the way how to fix it.

=ERROR REPORT==== 13-May-2015::15:15:13 ===
Error in process <0.412.0> on node 'simple_example@127.0.0.1' with exit value: {[{reason,undef},{mfa,{cowboy_social,get_html,2}},{stacktrace,[{cowboy_http,urlencode,[<<9 bytes>>],[]},{cowboy_request,urlencode,1,[{file,"src/cowboy_request.erl"},{line,80}]},{cowboy_request,'-urlencode/1-lc$^0/1-0-',1,[{file,"sr...


=ERROR REPORT==== 13-May-2015::15:15:13 ===
Ranch listener cowboy had connection process started with cowboy_protocol:start_link/4 at <0.412.0> exit with reason: {[{reason,undef},{mfa,{cowboy_social,get_html,2}},{stacktrace,[{cowboy_http,urlencode,[<<"client_id">>],[]},{cowboy_request,urlencode,1,[{file,"src/cowboy_request.erl"},{line,80}]},{cowboy_request,'-urlencode/1-lc$^0/1-0-',1,[{file,"src/cowboy_request.erl"},{line,82}]},{cowboy_request,urlencode,1,[{file,"src/cowboy_request.erl"},{line,82}]},{cowboy_social,redirect,3,[{file,"src/cowboy_social.erl"},{line,237}]},{cowboy_social,get_json,2,[{file,"src/cowboy_social.erl"},{line,114}]},{cowboy_social,get_html,2,[{file,"src/cowboy_social.erl"},{line,95}]},{cowboy_rest,call,3,[{file,"src/cowboy_rest.erl"},{line,972}]}]},{req,[{socket,#Port<0.1067>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.412.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},51473}},{host,<<"127.0.0.1">>},{host_info,undefined},{port,8080},{path,<<"/auth/google/login">>},{path_info,undefined},{qs,<<>>},{qs_vals,undefined},{bindings,[{action,<<"login">>},{provider,<<"google">>}]},{headers,[{<<"host">>,<<"127.0.0.1:8080">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:37.0) Gecko/20100101 Firefox/37.0">>},{<<"accept">>,<<"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8">>},{<<"accept-language">>,<<"en-US,en;q=0.7,ru;q=0.3">>},{<<"accept-encoding">>,<<"gzip, deflate">>},{<<"connection">>,<<"keep-alive">>}]},{p_headers,[{<<"if-modified-since">>,undefined},{<<"if-none-match">>,undefined},{<<"if-unmodified-since">>,undefined},{<<"if-match">>,undefined},{<<"accept">>,[{{<<"text">>,<<"html">>,[]},1000,[]},{{<<"application">>,<<"xhtml+xml">>,[]},1000,[]},{{<<"application">>,<<"xml">>,[]},900,[]},{{<<"*">>,<<"*">>,[]},800,[]}]},{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[{media_type,{<<"text">>,<<"html">>,[]}},{charset,undefined}]},{body_state,waiting},{buffer,<<>>},{multipart,undefined},{resp_compress,false},{resp_state,waiting},{resp_headers,[{<<"vary">>,[<<"accept">>]},{<<"content-type">>,[<<"text">>,<<"/">>,<<"html">>,<<>>]}]},{resp_body,<<>>},{onresponse,undefined}]},{state,{state,<<"login">>,[{client_id,<<"611699877179-vq8v7c4dlmhf327a0nsrhdub4ifo7co4.apps.googleusercontent.com">>},{client_secret,<<"JxN47368_g6CWIB479k_9AmZ">>},{callback_uri,<<"http://127.0.0.1:8080/auth/google/callback">>},{scope,<<"https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile">>},{authorize_uri,<<"https://accounts.google.com/o/oauth2/auth">>},{token_uri,<<"https://accounts.google.com/o/oauth2/token">>}],<<"google">>,undefined}}],[{cowboy_rest,set_resp_body,2,[{file,"src/cowboy_rest.erl"},{line,854}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,442}]}]}

@jtmoulia
Copy link
Contributor Author

It's working fine for me.

Are you running it as described in the README?

When are you seeing the error? On start, or when trying to handle a request?

@koddo
Copy link

koddo commented May 13, 2015

I have pretty much the same environment, followed the instructions. Have tried again, but, sadly, get the same error.

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

Successfully merging this pull request may close these issues.

2 participants