My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 1768: Not possible to edit project
5 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by patrik.l...@vismadevtrend.com, Jan 22, 2013
Affected Version: 2.5.1

What steps will reproduce the problem?
1. Upgrade working setup from 2.4.2 to 2.5.1
2. Warning while upgrade: Duplicate key name 'submodule_subscription_access_bySubscription', Continue.
3. Not possible to edit projects, even though I am a member of the Administrators group.

What is the expected output? What do you see instead?

I expect to be able to edit projects. However, after the upgrade I cannot, even though I am a member of the Administrators group.
I can edit branches for a project (add and delete), but I cannot edit the General section nor the Access section. The fields are grayed out and there is no edit button.

I noticed that in the All-Projects project have duplicate rows (see attached screenshot: Project All-Projects.png), I guess this was caused by the migration scripts.

It's very likely that we have something in our setup which causes this behavior, and that it happens rarely, since I cannot find anyone else with the same problem...  :(


Please provide any additional information below.

Here is the output from the upgrade process:

# java -jar /opt/gerrit/bin/gerrit.war init -d /opt/gerrit
[...]
Upgrading database schema from version 64 to 65 ...
Upgrading database schema from version 65 to 66 ...
Upgrading database schema from version 66 to 67 ...
Update ownerGroupId to ownerGroupUUID
Upgrading database schema from version 67 to 68 ...
warning: Cannot create index for submodule subscriptions
Duplicate key name 'submodule_subscription_access_bySubscription'
Ignore warning and proceed with schema upgrade [y/N]? Y
Upgrading database schema from version 68 to 69 ...
Upgrading database schema from version 69 to 70 ...
Upgrading database schema from version 70 to 71 ...
Upgrading database schema from version 71 to 72 ...
Upgrading database schema from version 72 to 73 ...
Execute the following SQL to drop unused objects:

  DROP TABLE contributor_agreements;
  DROP TABLE account_agreements;
  DROP TABLE account_group_agreements;
  ALTER TABLE account_groups DROP COLUMN owner_group_id;
  ALTER TABLE account_groups DROP COLUMN external_name;
  ALTER TABLE tracking_ids DROP COLUMN tracking_id;
  ALTER TABLE accounts DROP COLUMN display_patch_sets_in_reverse_order;
  ALTER TABLE accounts DROP COLUMN display_person_name_in_review_category;

Execute now [Y/n]? Y
Initialized /opt/gerrit


Project All-Projects.png
19.7 KB   View   Download
Jan 23, 2013
Project Member #1 edwin.ke...@gmail.com
This really looks like something is messed up.
First of all you should try to restore your admin permissions. I guess they are lost because you are now having multiple groups with the name 'Administrators' with different group UUIDs, but only one of them is the actual administrators group which has the permissions to administrate the server. Connect to the Gerrit database and check in the table 'SYSTEM_CONFIG' which group is set as admin group (fields 'ADMIN_GROUP_ID' and 'ADMIN_GROUP_UUID'), then make sure that you are member of this group by looking at 'ACCOUNT_GROUP_MEMBERS' table and insert yourself as member for this group if needed to restore your admin permissions.
Jan 23, 2013
#2 patrik.l...@vismadevtrend.com
Thanks for quick reply!

Actually I have already checked this, and it looks alright.
There is only one 'Administrators' group in the ACCOUNT_GROUPS table, and I am a member of that group in the cross table ACCOUNT_GROUP_MEMBERS.

I however found that in the SYSTEM_CONFIG table both ADMIN_GROUP_ID and ADMIN_GROUP_UUID was NULL after the upgrade, but I tried to stop gerrit, manually set the id (1) and UUID obtained from the ACCOUNT_GROUPS table, then start gerrit and also log out and in int the system in case anything is cached, but still no cigar :(
Jan 23, 2013
#3 patrik.l...@vismadevtrend.com
I have been digging around the database, and I can not see any problems (but then I'm just guessing how the structure should look like).

The more I think of it, could it be that the All-Projects git repository got corrupt?
I tried a couple of times to install 2.5.1, and interrupted the process of various reasons. If I do git diff with version before upgrade I see that there exists several Administrators groups in the repo.

I'll have a look into this now.

Screenshot depicts part of the output from git diff a5f3a76f3c9b2c800a2f3a674547eb684f86be14..aa4e7ddf832662ce4a22d1072fe02609d91de0ae

All-Projects git diff.png
30.7 KB   View   Download
Jan 23, 2013
#4 patrik.l...@vismadevtrend.com
Was as I suspected, the All-Projects repo got corrupt during upgrade.
I have a fix, and so far I haven't found any problems.
I'll post if I find something.

So basically this bug report is that the migrations might corrupt your All-Projects repo by adding a duplicate Administrators group, and in addition to that add duplicates in project.config (that problem is probably not the main issue which stopped me from editing projects - I assume that was the duplicate Administrators group).

Attached is the diff (anonymized) between how the All-Projects repo looked before and after upgrade to 2.5.1. I restarted the upgrade 3 times (interrupted two of them before I thought that any changes were actually performed), that's why there are several duplicates.

This is how I fixed it:
# Stop gerrit
# Backup All-projects.git
cp -pr /opt/gerrit/git/All-Projects.git ~/

cd /tmp
git clone /opt/gerrit/git/All-Projects.git
cd All-Projects
git config user.name "Gerrit Code Review"
git config user.email "root@server"

# Edit both files (groups and project.config), remove duplicates. I did this manually.

git add groups project.config
git commit -m "Manually restoring corrupt config after upgrade to 2.5.1"
git push origin HEAD:refs/meta/config

# Start gerrit
All-Projects.git.diff-after-upgrade-to-2.5.1
2.3 KB   View   Download
Mar 5, 2015
#5 akshay.m...@gmail.com
Ran into this after running "init" one too many times on 2.9.3 (assumed it is idempotent, perhaps mistakenly?). The instructions in #4 helped me fix the duplicate entries.

Jun 24, 2015
#6 tianbing...@gmail.com
How can I get groups and project.config files? I can not find them under All-Projects/refs/meta...
I can NOT access All-Projects with Administrators group account.
I am afraid that permission setting of All-Projects corrupt. How to fix that? 
Sign in to add a comment

Powered by Google Project Hosting