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

Deleting organisation while user is still in it, causes 500 error #614

Closed
2 of 4 tasks
sigio opened this issue Jan 8, 2017 · 7 comments · Fixed by #633
Closed
2 of 4 tasks

Deleting organisation while user is still in it, causes 500 error #614

sigio opened this issue Jan 8, 2017 · 7 comments · Fixed by #633
Labels
Milestone

Comments

@sigio
Copy link

sigio commented Jan 8, 2017

Version: 6aacf4d
OS: Debian stable

  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Not relevant

Description

I've created some organisations, but wanting to keep them 'hidden' from the explore mode to non-logged in users. It seems that this wasn't possible, so I wanted to remove these organisations again.

I had created the orgs with my regular user account, and later removed them with the administrator account.

When logging in with my regular user account, the dashboard, issues and pull-request pages would give 500 errors, explore would work correctly.

It seems that the entries are not removed from the org_user table, after manually removing these, the 500 error disappeared:

sqlite> select * from org_user;
1|1|3|0|0|0
2|2|3|1|1|1
3|2|4|0|1|1
4|2|5|0|1|1

As my only remaining org had org_id 3, I did the following:

sqlite> delete from org_user where org_id > 3;
sqlite> select * from org_user;
1|1|3|0|0|0
2|2|3|1|1|1
sqlite>

this solved this issue, but removing a non-empty org should not be possible, or cascade and remove the relevant org_user entries.

@lunny
Copy link
Member

lunny commented Jan 9, 2017

It seems this issue has been resolved.

@glothriel
Copy link

glothriel commented Jan 9, 2017

I tried to reproduce it. I faced all the above problems, in addition also removing the organization from admin account yielded with 500 error. This error was triggered:
https://github.com/go-gitea/gitea/blob/master/models/user.go#L923

Btw, why is organization an User instance?

@Bwko
Copy link
Member

Bwko commented Jan 9, 2017

@glothriel Did you set a custom avatar for that organisation?

@sigio
Copy link
Author

sigio commented Jan 9, 2017

I had custom avatars for the orgs

@glothriel
Copy link

@Bwko Nope

@appleboy
Copy link
Member

I can reproduce this issue and fix in this pull request #633.

@appleboy
Copy link
Member

appleboy commented Jan 10, 2017

Reproduce process in https://try.gitea.io/ :

  1. Create organization
  2. Create a report on the organization
  3. Delete organization.

@tboerger tboerger added this to the 1.1.0 milestone Jan 16, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants