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

start_link not called in Couch 2, fails with "noproc" #2

Open
jjd314 opened this issue Jun 23, 2017 · 2 comments
Open

start_link not called in Couch 2, fails with "noproc" #2

jjd314 opened this issue Jun 23, 2017 · 2 comments

Comments

@jjd314
Copy link

jjd314 commented Jun 23, 2017

First, thanks a million for porting this to Couch 2. I don't know jack about erlang, and I can't get Couch 1.6 running on Debian Stretch, so without this I would have been stuck. Although it compiled and installed, it kept throwing
{"error":"noproc","reason":"{gen_server,call,[couch_jwt_auth,{get_jwk}]}"}
whenever I tried to authenticate. From what I could tell, start_link was never being called, and so the get_jwk call failed. Digging through the other parts of Couch 2 (in particular, couchdb-b64url), I saw that it began with an "on_load" call (in that case, to init/0). I added
- on_load(start_link/0).
after the module() line at the top of couch_jwt_auth.erl, and it seems to work fine now.

I'm just leaving this as an issue, rather than a pull request, because 1) I don't know what I'm doing with erlang, and this is just a sufficiently successful hack for me, and 2) it breaks a bunch of tests (and again, my erlang-less-ness stopped me from fixing them).

I hope this helps, and again, thanks a bunch!

@dmunch
Copy link
Owner

dmunch commented Jun 26, 2017

Hi, thanks for your interest in couch_jwt_auth

There might be still some things missing in the documentation. Actually, for this version to work you need to add an additional line in you local.ini in the [deamons] section like follows

[daemons]
jwt_auth = {couch_jwt_auth, start_link, []}

Let me know if this works for you!

Best,
Daniel

@jjd314
Copy link
Author

jjd314 commented Apr 9, 2018

Hi Daniel,
Thanks for this fork! I had the same problem as the OP of this issue, and your solution worked for me. I just thought you (and others following) might want to know. I also just submitted a pull request for a change putting those lines into priv/default.d/jwt_auth.ini

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

2 participants