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

[Bug]: Public Brain subscriptions - Not functioning #1713

Closed
LordDougall opened this issue Nov 26, 2023 · 6 comments
Closed

[Bug]: Public Brain subscriptions - Not functioning #1713

LordDougall opened this issue Nov 26, 2023 · 6 comments
Assignees
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working

Comments

@LordDougall
Copy link

What happened?

Seems as if the new secrets tied to brain created an issue when going to subscribe to public brains.

bug

Relevant log output

No response

Twitter / LinkedIn details

No response

@LordDougall LordDougall added the bug Something isn't working label Nov 26, 2023
Copy link

dosubot bot commented Nov 26, 2023

🤖

Hello @LordDougall,

Welcome to the Quivr GitHub repository! I'm Dosu, an AI assistant here to help you with any bugs, answer questions, and guide you through becoming a contributor. I'm here to assist while you're waiting for a human maintainer. Let's get started on solving your issue!

Thank you for bringing this issue to our attention. Based on the changes made in the latest version of Quivr, there are a few potential reasons why you might be experiencing issues when trying to subscribe to public brains.

In the latest version, a new endpoint was added to subscribe to a public brain. This endpoint checks if the user is already subscribed to the brain and if the brain is public. If the brain is of type "api", it also checks for the required secrets. If all checks pass, the user is added to the brain with viewer rights.

If you're trying to subscribe to a public brain of type "api", you need to provide the correct secrets. If a required secret is not provided, an HTTPException is raised with a status code of 400 and a detail message indicating the missing secret.

Here are some potential error messages or behaviors you might observe based on the code:

  1. If the user's email is not defined, an HTTPException with status code 400 and detail "UserIdentity email is not defined" is raised.
  2. If the brain with the provided brain_id is not found, an HTTPException with status code 404 and detail "Brain not found" is raised.
  3. If the brain's status is not "public", an HTTPException with status code 403 and detail "You cannot subscribe to this brain without invitation" is raised.
  4. If the user is already subscribed to the brain, an HTTPException with status code 403 and detail "You are already subscribed to this brain" is raised.
  5. If the brain type is "api" and the user does not provide the required secrets, an HTTPException with status code 400 and detail "Please provide the secret {secret}" is raised.
  6. If there is an error while adding the user to the brain, an HTTPException with status code 400 and detail "Error adding user to brain: {e}" is raised, where {e} is the exception message.

To help us better understand the issue, could you please provide more details about the error you're experiencing? Specifically, are you seeing any error messages when you try to subscribe to a public brain? If so, what are they? Also, are you trying to subscribe to a public brain of type "api"? If so, are you providing the required secrets?

Your feedback is invaluable in helping us improve Quivr, and we appreciate your patience as we work to resolve this issue.

Sources

@dosubot dosubot bot added the area: backend Related to backend functionality or under the /backend directory label Nov 26, 2023
@LordDougall
Copy link
Author

LordDougall commented Nov 26, 2023

Error produced when a brain, set to public, containing knowledge, is listed in brains-management/library. (NOT API BRAIN)

When another user (not owner) attempts to subscribe by clicking button on /brains-management/library page, there is no error message popup - Only error is displayed in console

fd9d1056-84dd40c146c17fec.js:9 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys ()
at handleBrainSubscription (page-2756b7c2d943bf60.js:1:2457)
at onClick (page-2756b7c2d943bf60.js:1:2911)
at Object.l5 (fd9d1056-84dd40c146c17fec.js:9:67290)
at ar (fd9d1056-84dd40c146c17fec.js:9:67444)
at fd9d1056-84dd40c146c17fec.js:9:132983
at u2 (fd9d1056-84dd40c146c17fec.js:9:133082)
at u3 (fd9d1056-84dd40c146c17fec.js:9:133496)
at fd9d1056-84dd40c146c17fec.js:9:138988
at oS (fd9d1056-84dd40c146c17fec.js:9:88337)

functions as expected in v.0.0.98

@LordDougall
Copy link
Author

Correction - Functions as expected in v0.0.111

@LordDougall
Copy link
Author

Screenshot 2023-11-26 212634

commenting out all related to "secrets" within these four files provided a temp fix, subscribe function works however will conflict with api - look forward to solution!

@mamadoudicko
Copy link
Contributor

Thanks to @LordDougall for describing this issue so well!

Just fixed it in #1727

@LordDougall
Copy link
Author

nice seems to be working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants