[x]):I am trying to create a repository for an Organisation. I get a 500 error.
The log file looks like this:
2016/11/24 20:38:33 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: Error 1054: Unknown column 'team_id' in 'where clause'
best regards
roland
The same issue for me.
[x]):2016/11/24 20:32:23 [...routers/repo/repo.go:101 handleCreateError()] [E] MigratePost: addRepository: getMembers: get team-users: no such column: team_idSteps to reproduce this issue:
BR,
Piotr
I am seeing the same issue on trying to create a repository under an Organization:
2016/11/25 04:08:04 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: pq: column "team_id" does not exist
P.S. This was a fresh install that I just made today, first action taken.
Gogs version (or commit ref): 0.9.100.1119
same here
Database (use [x]):
Log gist:
2016/11/25 15:24:40 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: no such column: team_id
Same issue trying to transfer the ownership of an existing repo to an organization
2016/11/25 10:08:01 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: Error 1054: Unknown column 'team_id' in 'where clause'
2016/11/25 10:08:59 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: Error 1054: Unknown column 'team_id' in 'where clause'
2016/11/25 10:10:00 [...ters/repo/setting.go:227 SettingsPost()] [E] TransferOwnership: add to owner team: getMembers: get team-users: Error 1054: Unknown column 'team_id' in 'where clause'
2016/11/25 10:10:04 [...ters/repo/setting.go:227 SettingsPost()] [E] TransferOwnership: add to owner team: getMembers: get team-users: Error 1054: Unknown column 'team_id' in 'where clause'
same here, It makes no difference if I create the repository for the Organization or transfer ownership.
creating repositories for my user however works fine.
I was using gogs:latest for the docker image - change to gogs:0.9.97 doesn't exhibit this problem and I can create repos under organizations.
Gogs Version: 0.9.100.1119 with Postgresql
Same issue here, same error log as above.
Thank you for your help !
I use gogs, the version is 0.9.100.1119 with SQLite 3, docker.
I couldn't create repositories for organizations.
500 error appers at /repo/create
log error message is:
[...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: no such column: team_id
same here, 0.9.100.1119 with postgres
Same situation as @Qs-F
I get this when running the current master.
If someone has already reported the issue with the same configuration you're running, there's no point littering the thread with redundant answers.
Isnt this considered a serious issue? no work around and unable to create a repo in a organization? why taking so long to fix?
@meffect Good question.
Maybe @Unknwon is not aware of this yet.
I tried to find out which commit introduced this bug, but sadly #3712 won't let me build earlier versions.
+1
Same here...
Thank god I kept a previous Docker image.
Had to go back to version 0.9.83.0816.
0.9.97 works fine.
I really use the organization feature to keep my repo's organized. I pulled from source and installed from scratch yesterday and it took me forever to find out that it wasnt an issue with how I installed it, but a bug in production master :(
Fresh install from source, 漏 2016 Gogs Version: 0.9.100.1119 Page: 170ms Template: 0ms English Website Go1.6.2. Ubuntu 16.04.1. Used MySQL Scripts and Systemd startup script
gogs.log
2016/12/06 08:15:02 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: Error 1054: Unknown column 'team_id' in 'where clause'
xorm.log
[xorm] [info] 2016/12/06 08:15:02.008984 [sql] BEGIN TRANSACTION
[xorm] [info] 2016/12/06 08:15:02.009112 [sql] SELECT 'id', 'owner_id', 'lower_name', 'name', 'description', 'website', 'default_branch', 'num_watches', 'num_stars', 'num_forks', 'num_issues', 'num_closed_issues', 'num_pulls', 'num_closed_pulls', 'num_milestones', 'num_closed_milestones', 'is_private', 'is_bare', 'is_mirror', 'enable_wiki', 'enable_external_wiki', 'external_wiki_url', 'enable_issues', 'enable_external_tracker', 'external_tracker_format', 'external_tracker_style', 'enable_pulls', 'is_fork', 'fork_id', 'created_unix', 'updated_unix' FROM 'repository' WHERE 'owner_id'=? AND 'lower_name'=? LIMIT 1 [args] [2 testrepo]
[xorm] [info] 2016/12/06 08:15:02.009607 [sql] INSERT INTO 'repository' ('owner_id','lower_name','name','description','website','default_branch','num_watches','num_stars','num_forks','num_issues','num_closed_issues','num_pulls','num_closed_pulls','num_milestones','num_closed_milestones','is_private','is_bare','is_mirror','enable_wiki','enable_external_wiki','external_wiki_url','enable_issues','enable_external_tracker','external_tracker_format','external_tracker_style','enable_pulls','is_fork','fork_id','created_unix','updated_unix') VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [args] [2 testrepo TestRepo 0 0 0 0 0 0 0 0 0 true false false true false true false true false 0 1481040902 1481040902]
[xorm] [info] 2016/12/06 08:15:02.077673 [sql] UPDATE 'user' SET 'lower_name' = ?, 'name' = ?, 'full_name' = ?, 'email' = ?, 'passwd' = ?, 'login_type' = ?, 'login_source' = ?, 'login_name' = ?, 'type' = ?, 'location' = ?, 'website' = ?, 'rands' = ?, 'salt' = ?, 'created_unix' = ?, 'updated_unix' = ?, 'last_repo_visibility' = ?, 'max_repo_creation' = ?, 'is_active' = ?, 'is_admin' = ?, 'allow_git_hook' = ?, 'allow_import_local' = ?, 'prohibit_login' = ?, 'avatar' = ?, 'avatar_email' = ?, 'use_custom_avatar' = ?, 'num_followers' = ?, 'num_following' = ?, 'num_stars' = ?, 'num_repos' = ?, 'description' = ?, 'num_teams' = ?, 'num_members' = ? WHERE 'id'=? [args] [com com 0 0 1 JWfATsDGdU Lby0XEnmSI 1481011235 1481040902 true -1 true false false false false true 0 0 0 1 1 1 2]
[xorm] [info] 2016/12/06 08:15:02.100224 [sql] SELECT 'id', 'org_id', 'lower_name', 'name', 'description', 'authorize', 'num_repos', 'num_members' FROM 'team' WHERE 'org_id'=? AND 'lower_name'=? LIMIT 1 [args] [2 owners]
[xorm] [info] 2016/12/06 08:15:02.100666 [sql] INSERT INTO 'team_repo' ('org_id','team_id','repo_id') VALUES (?, ?, ?) [args] [2 1 6]
[xorm] [info] 2016/12/06 08:15:02.100976 [sql] UPDATE 'team' SET 'org_id' = ?, 'lower_name' = ?, 'name' = ?, 'description' = ?, 'authorize' = ?, 'num_repos' = ?, 'num_members' = ? WHERE 'id'=? [args] [2 owners Owners owner 1 1 1]
[xorm] [info] 2016/12/06 08:15:02.101353 [sql] SELECT 'id', 'repo_id', 'user_id', 'mode' FROM 'collaboration' WHERE 'repo_id'=? [args] [6]
[xorm] [info] 2016/12/06 08:15:02.132787 [sql] SELECT 'id', 'org_id', 'lower_name', 'name', 'description', 'authorize', 'num_repos', 'num_members' FROM 'team' WHERE org_id=? [args] [2]
[xorm] [info] 2016/12/06 08:15:02.133228 [sql] SELECT 'id', 'org_id', 'team_id', 'uid' FROM 'team_user' WHERE team_id=? [args] [1]
[xorm] [info] 2016/12/06 08:15:02.133582 [sql] SELECT 'id', 'lower_name', 'name', 'full_name', 'email', 'passwd', 'login_type', 'login_source', 'login_name', 'type', 'location', 'website', 'rands', 'salt', 'created_unix', 'updated_unix', 'last_repo_visibility', 'max_repo_creation', 'is_active', 'is_admin', 'allow_git_hook', 'allow_import_local', 'prohibit_login', 'avatar', 'avatar_email', 'use_custom_avatar', 'num_followers', 'num_following', 'num_stars', 'num_repos', 'description', 'num_teams', 'num_members' FROM 'user' WHERE 'id'=? LIMIT 1 [args] [1]
[xorm] [info] 2016/12/06 08:15:02.133999 [sql] DELETE FROM 'access' WHERE 'repo_id'=? [args] [6]
[xorm] [info] 2016/12/06 08:15:02.134212 [sql] INSERT INTO 'access' ('user_id', 'repo_id', 'mode') VALUES (?, ?, ?) [args] [1 6 owner]
[xorm] [info] 2016/12/06 08:15:02.134422 [sql] SELECT 'id', 'user_id', 'repo_id', 'mode' FROM 'access' WHERE team_id=? [args] [1]
[xorm] [info] 2016/12/06 08:15:02.134529 [sql] ROLL BACK
The issue seems to be that the Engine object passed to this method points to the wrong table in the database.
It tries to read from _access_. The correct table would be _team_user_
Edit: From what I understand after reading the xorm documentation the part Find(&teamUsers) should tell the engine which table to use.
Since there's no fix in sight, could anybody share a patch so that others could at least recomple their own version please? Cheers.
@lenormf since the broken version v0.9.100 isn't officially released yet I would recommend for you to revert back to the last official release.
master branch isnt the release version? what's the point of develop branch :| All the guides for linux suggest installing from github master src
@meffect, that's exactly what bit me. Installed from master and ended up with v0.9.100, and not latest, v0.9.97.
@ChristianAE, yes but, if it's not been released, how did it get to be docker gogs/gogs:latest? That's what tripped me up.
Is someone going to fix this? It's a HUGE DEAL. I can't use the organization feature which I NEED. Your own documentation suggests installation from github master. You basically have a BROKEN PRODUCTION PRODUCT and you just act like it's no big deal. I expect this from a crappy open source project, but not a leading source control management software
@meffect, I recommend installing v0.9.97 (the actual latest release), as that's been quite stable for us and gets around this current issue with organizations.
Regarding the temporal fix of installing v0.9.97: it works for repositories and organizations, but is broken for LDAP users (see #3926, I suppose?).
My workaround has been using first the latest version, asking all the LDAP users to login once (triggering the user creation in gogs), and then downgrading to v0.9.97 in order to create all the repositories.
It seems safe to downgrade and upgrade. Whenever a new user needs to be created, or a new repo has to be created, I have to check the version and change it if required (thankfully I am currently using Docker, so it is quite straightforward).
I now have v0.9.97 installed and it's working fine, including LDAP.
@KangoV You think LDAP is working right because you have been connecting with an already registered user (using a different version from 0.9.97) . Try loging in with a non registered user, first time login of an LDAP user.
I have chosen to move to gogs v0.9.71 as a workaround, Both LDAP first logon and Organisation repository creation are working on that version.
Sadly, Arch linux users are stuck with 0.9.99+ :(
It would be very interesting to know which change in the code actually caused this issue, so that this specific change could be reverted.
From looking at the code, I really don't understand why the error occours.
@VanCoding would you agree with my initial analysis?
I went through the commits but couldn't pin point the faulty one.
@ChristianAE yes, the error definitely occurs there. But the question's why... it looks correct. Maybe it's an issue of xorm, which for some reason uses the wrong table.
So it might be neccessary to reinstall the dependencies after switching the commit, to find the bad one.
We need official docker on stable branch !
I have same problem...
Have the same issue during create new repo for group.
2016/12/11 14:29:17 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: no such column: team_id
2016/12/11 14:29:22 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: addRepository: getMembers: get team-users: no such column: team_id
hope this can be fixed.
I'm having the same issue. No update from the owner or contributors?! 鈽癸笍
@deanpcmad I'm as baffled as you are. We're not using a beta version, were using master production. I dont understand how the maintainers are ok with this
@meffect yep, also shouldn't tests find these issues before they are released?
@deanpcmad Well, at least fix it promptly, or roll back, or something
@Unknwon Are you aware that this is a serious issue for mostly everyone right now? Some acknowledgement at least would be great 馃憤
Gitea fixed this issue!
@lunny i'll try it, this is sad
Please don't start a discussion about another tool, this thread is already flooded with irrelevant comments enough.
This is hard to debug on Windows because the C bindings mess up dlv. Anyone Linux users set a break point here and see what's happening?
9.97 is broken for CI usage, #3583.
I am in a sad position trying to setup gogs with drone for CI, 9.71 does not have inline edit and webhook on pull requests, 9.97 does not allow CI to pull the code, master branch have broken organization.
hope some release come soon that does not break previous features!
Broken in Docker, using CentOS on MySQL. LMK if you need any details from me
This problem mostly occurred inside Docker, I've pushed a fix to develop branch. Also the latest Docker develop version image is available for download and test in few minutes.
@Unknwon Thank you for working on this!
Sadly, the issue still exists for me at 0.9.103.1221, but it also could be a problem of the arch linux install script, that maybe did not update the dependencies.
I'll wait for someone else to confirm that it's fixed or not.
@VanCoding Hmm.. yes you should make sure that all dependencies are up-to-date.
I can confirm that this has NOT been fixed using the latest gogs docker image!
Application Version: 0.9.104.1221
That's strange because I can't reproduce...
@Unknwon were you able to reproduce before the fix?
From looking at the fix's changes, it was (or is) a bug of xorm, right?
@VanCoding I was able to reproduce at first, than I update XORM to the latest somehow fixed.
damn this is a strange issue.. :/
Pushed another patch try to fix this problem, Docker image should be ready in few minutes.
This works for me.
Let me know if you need me to test other stuff to get rid of the dirty hack ;)
It worked!
Now I can create repos in our company group.
_Thank you!_
The first patch yesterday fixed it for me.
Thank you @Unknwon, it solved the problem.
I updated my docker image around 10:00 AM EST and it fixed the issue for me in Docker
Thanks for getting that fixed :)
Using Docker and SQLite, just pull the latest tag and recreate your containers, it does solve the problem. Thanks @Unknwon.
Most helpful comment
The same issue for me.
[x]):2016/11/24 20:32:23 [...routers/repo/repo.go:101 handleCreateError()] [E] MigratePost: addRepository: getMembers: get team-users: no such column: team_idDescription
Steps to reproduce this issue:
BR,
Piotr