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

permissions errors when using Cloudant remote #543

Closed
dominicbarnes opened this issue Dec 11, 2017 · 4 comments
Closed

permissions errors when using Cloudant remote #543

dominicbarnes opened this issue Dec 11, 2017 · 4 comments

Comments

@dominicbarnes
Copy link

I'm using Cloudant as my remote CouchDB backend, and deploying my application on up. (AWS Lambda + API Gateway) I'm getting permission errors that I'm not sure how to resolve. I don't have the same issues running locally, so I think something is up with Cloudant specifically.

It appears that, when a new user account is created, hoodie is able to create the _users document, but is unable to create a hoodie-store document or the user's database. The account creation endpoint appears to be successful, and the account is able to be logged into. However, any attempts to access the store API result in errors. (401 Unauthorized)

I believe the store API error is caused by the missing database and hoodie-store document, so figuring out why creating a user would fail at these steps will probably lead to a solution. I don't mind doing some digging myself, but some guidance on the internals of hoodie would probably help me do that more effectively.

@dominicbarnes
Copy link
Author

I'm starting to wonder if hoodie makes assumptions about running only on a single server. The main difference between running locally (where things are fine) and running in my production setup is the use of AWS Lambda, which could easily have multiple servers running concurrently to serve requests. (effectively a load balancer is at the front door)

When I started 2 hoodie servers locally (both talking to the same remote db), I would see a document conflict error when I did a "sign up" with one of the servers, usually on the other server.

Am I on the right track here? What is the expected behavior if multiple hoodie servers are talking to the same remote db? (is that even supported?)

@gr2m
Copy link
Member

gr2m commented Dec 11, 2017

I haven’t run Hoodie on multiple servers myself yet. We built out the architecture with that in mind, but I can’t recall I used that setup myself somewhere. Unfortunately I’ll be offline for the next 7 days, I’d be happy to help investigate the issue afterwards, it’s certainly a relevant issue to us

@dominicbarnes
Copy link
Author

After some more investigation, I'm pretty sure this has nothing to do with lambda or multiple servers. If I run my app locally with a vanilla CouchDB (1.7) as the remote, things are fine. If I run my app locally with Cloudant as the remote, I get the same behavior described above.

I'm not sure how Cloudant's configuration could cause issues with hoodie, at least not atm.

@dominicbarnes
Copy link
Author

The root issue is actually #542, so I'll close this issue.

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