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

Fix for default org creation error for first user. #1394

Merged
merged 2 commits into from
May 20, 2024

Conversation

yashsinghcodes
Copy link
Member

This fixes the problem that I was facing that is creating not creating a org when I register my first admin user. I noticed the handleRegister does not set the Active Org for the user and does not add the first user to the org. Which I think is the reason behind the error. I tested it with my change in code and it worked and again did the same without the changes and I get the error where no organisation is created for the user.

@frikky
Copy link
Member

frikky commented May 17, 2024

This fixes the problem that I was facing that is creating not creating a org when I register my first admin user. I noticed the handleRegister does not set the Active Org for the user and does not add the first user to the org. Which I think is the reason behind the error. I tested it with my change in code and it worked and again did the same without the changes and I get the error where no organisation is created for the user.

The main reason for the error was not really this. It was during RunInit() that it started doing init, but failed to find orgs due to EOF AKA the database not being available. That should have been solved on nightly builds since about 1 month ago.

When originally setting up the DB, did you use the local repo, or the latest/nightly docker container?

@yashsinghcodes
Copy link
Member Author

yashsinghcodes commented May 17, 2024

I used opensearch docker container which is version 2.11.1 and ran backend(go-apps) and frontend(react) locally from the 1.4.0 branch. Following was my log from the backend go-apps was I was trying to login.
2024-05-17_17-13

I did register successfully for my first admin account which I think indicate that the database is working and available right?

Here is error at the frontend:
2024-05-17_17-08

I think this does solve the problem by creating a default org and assigning it to the admin to initial login. But we can also handle it at the RunInitEs function which I think it once did but is now commented for runInitCloudSetup() ?https://github.com/Shuffle/Shuffle/blob/1.4.0/backend/go-app/main.go#L3598

@frikky frikky merged commit e6fdee4 into Shuffle:1.4.0 May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants