Project

General

Profile

Actions

Task #2463

closed

Deploy stage gerrit instance and upgrade prod instance from 2.11.11 to 2.13.11

Added by Guilhem Moulin over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Gerrit
Target version:
Team - Q2/2018
Start date:
Due date:
% Done:

0%

Tags:

Description

Per the Jan 16 2018 infra call minutes:

  • Q: according to my notes 2.11.8 was released on 2016-03-09 and 2.13.9 on 2017-07-03? Are there known vuln in 2.11.x? Is it about getting feature fixes and new shiniest software?
    - No known vulnerability, but there are a bunch of new features, especially inline edit feature
  • David: dedup scripts should keep working with 2.13.x
  • David: see old redmine ticket Norbert filed about migration
    - do you mean my comments in https://redmine.documentfoundation.org/issues/1587#note-4 ?
    . I meant this Norbert's comment: https://redmine.documentfoundation.org/issues/1587#note-8
  • Cloph: difficult to test everything as OAuth needs proper DNS setup
  • Cloph: can't copy the database to a test VM and grant access to everyone as we have private repos
  • Cloph: release-wise, it would be ideal to do that (switching the live instance) in March or so (after 6.0.1)
    - Q: Is Norbert coming to FOSDEM? Would be ideal time to brainstorm there
  • Roadmap:
    - Set up staging gerrit instance:
    . Synchronize production gerrit content to gerrit-test:
    . Simulate upgrade process:
    . Stop gerrit
    . Perform database and git repository backup
    . Update gerrit version
    . Update all external plugins (gerrit-oauth-provider)
    - Run init command in batch mode, all used internal plugins should be updated (double-check)
    - Run reindex command
    - Start gerrit
    - Verify, that gerrit still works as expected
    . this is the (very) hard part, as test-instance cannot have all features enabled, and of course you don't think of any possible user-mistakes that had to be dealt with.
    - Schedule gerrit upgrade in production
Actions #1

Updated by Guilhem Moulin about 6 years ago

  • Target version set to Q1/2018
Actions #2

Updated by Guilhem Moulin about 6 years ago

  • Subject changed from Deploy stage gerrit instance and upgrade prod instance from 2.11.8 to 2.13.9 to Deploy stage gerrit instance and upgrade prod instance from 2.11.8 to 2.13.10
Actions #3

Updated by David Ostrovsky about 6 years ago

One reason to update:

Gerrit 2.11 still uses Java 7, and as such uses weak cryptographic standards.

See this discussion on Gerrit mailing list:

https://groups.google.com/d/topic/repo-discuss/AMVDwTIeDJw/discussion

And this removal notice from GitHub dev team:

https://githubengineering.com/crypto-removal-notice/

Actions #4

Updated by David Ostrovsky about 6 years ago

I cherry-picked JSch upgrades from latest gerrit release to 2.11 release line,
and uploaded this series upstream under this topic:

https://gerrit-review.googlesource.com/#/q/topic:gh-crypto-removal-notice

Release artifact can be fetched from GerritForge CI:

https://gerrit-ci.gerritforge.com/job/Gerrit-verifier-buck/2224/artifact/gerrit/buck-out/gen/gerrit.war

or from my server:

http://ostrovsky.org/gerrit/release-2.11.10-5-g276a209ff4.war

Actions #5

Updated by Guilhem Moulin about 6 years ago

David Ostrovsky wrote:

I cherry-picked JSch upgrades from latest gerrit release to 2.11 release line,
and uploaded this series upstream under this topic:

https://gerrit-review.googlesource.com/#/q/topic:gh-crypto-removal-notice

Thanks, much appreciated! I picked up these and that indeed fixed the broken replication issue.

Actions #6

Updated by David Ostrovsky about 6 years ago

We should upgrade to 2.13.11, see this release notes: [1].

[1] https://groups.google.com/d/topic/repo-discuss/aoQ2cZ_e7iI/discussion

Actions #7

Updated by Guilhem Moulin about 6 years ago

  • Subject changed from Deploy stage gerrit instance and upgrade prod instance from 2.11.8 to 2.13.10 to Deploy stage gerrit instance and upgrade prod instance from 2.11.11 to 2.13.11

Thanks again David, changed the subject accordingly. I upgraded to the official 2.11.11 meanwhile.

Actions #8

Updated by Florian Effenberger about 6 years ago

I talked to David on the phone about this, there are actually three Gerrit-related topics:

  • make Jenkins comments visible in Gerrit by giving Jenkins user proper rights, and some more user rights to other users -> we should look into that next week
  • staging server -> we need to see which data needs to be omitted. Not super urgent, but sometime during spring would be nice
  • migration -> not super urgent either (given Q1 and Q2 has quite some high-prio topics for the team), summer/autumn would be fine for David, the earlier the btter of course

In general, we should also share responsibilities on Gerrit, so not everything is on one table.

We will discuss this in the next team call.

Actions #9

Updated by Guilhem Moulin about 6 years ago

Florian Effenberger wrote:

  • staging server -> we need to see which data needs to be omitted. Not super urgent, but sometime during spring would be nice

Yeah that's what this task is about with the aim of doing it in Q1.

In general, we should also share responsibilities on Gerrit, so not everything is on one table.

Yup :-)

Actions #10

Updated by Florian Effenberger about 6 years ago

Any update already?

Actions #11

Updated by Christian Lohmaier about 6 years ago

  • Target version changed from Q1/2018 to Q2/2018

while there is a vm assigned, the staging hasn't been setup yet, thus we won't make it in Q1 - but of course not forgotten, just GDPR and other stuff got in between.

Actions #12

Updated by Florian Effenberger almost 6 years ago

Just to flag this: We should look into this no later than early June, when the most pushing GDPR bits are done. This also matches our promise to do it during springtime, which I'd like to keep :-)

Actions #13

Updated by David Ostrovsky almost 6 years ago

Thanks for update, Florian.

Do we have a plan B, in case we also fail Q2 deadline?

Actions #14

Updated by Florian Effenberger almost 6 years ago

I actually expect that deadline is met - it's 6 weeks from now which
should give plenty of time...

Actions #15

Updated by David Ostrovsky almost 6 years ago

I actually expect that deadline is met - it's 6 weeks from now which
should give plenty of time...

Great, looking forward to help out with testing,
once staging instance is up and running.

I'm seeing also one inaccuracy in the issue description:

Q: according to my notes 2.11.8 was released on 2016-03-09 and 2.13.9 on 2017-07-03?

The relevant date is frozen code base, which is accounted from the releasing
of first release line.

So the announcement and thus release date of Gerrit 2.11 is from: 17.04.2015: [1],
3 years ago. The minor fixes in Gerrit never contain new features, only security
vulnerabilities and small error fixes. Major inline edit improvements and support for
new inline edit use cases, were only added in Gerrit 2.12 and 2.13.

As example, 2.11.11 was released on 27.02.2018: [2], but this of course
doesn't change the fact the 2.11 line is three year old and very outdated version.

At the time of this writing the current release is 2.15.1 and 2.15.2 is going to
be released in the next weeks.

[1] https://groups.google.com/d/topic/repo-discuss/hPbetnfBkm4/discussion
[2] https://groups.google.com/d/topic/repo-discuss/NqSp7MJ11Cs/discussion

Actions #16

Updated by Florian Effenberger almost 6 years ago

  • Status changed from New to In Progress

Christian Lohmaier: You did some work on this last Friday. Can you update the ticket?
From what I remember a base deployment is done and some public repositories have been copied over.
Can you add more details and an ETA? ;-)

Actions #17

Updated by Guilhem Moulin almost 6 years ago

A stage instance (Debian 9 baseline, gerrit 2.13.11) is now available at https://vm178.documentfoundation.org with a subset of projects. OAuth2 and OpenID authentication are both working, but the maintenance scripts (account merging etc.) haven't been tested yet.

Actions #18

Updated by Guilhem Moulin almost 6 years ago

Guilhem Moulin wrote:

OAuth2 and OpenID authentication are both working

I should have added that they're not working out of the box: for OAuth2 one needs to fix the URL (twice), and for OpenID one needs to temporary run git config -f ~gerrit/etc/gerrit.config gerrit.canonicalWebUrl https://vm178.documentfoundation.org/ (OAuth2 breaks if it's not https://gerrit.libreoffice.org/ so that's what it's set to normally). So while it's a bit cumbersome it's not impossible. And then one can use the site as usual.

Actions #19

Updated by David Ostrovsky almost 6 years ago

Guilhem Moulin wrote:

Guilhem Moulin wrote:

OAuth2 and OpenID authentication are both working

I should have added that they're not working out of the box: for OAuth2 one needs to fix the URL (twice), and for OpenID one needs to temporary run git config -f ~gerrit/etc/gerrit.config gerrit.canonicalWebUrl https://vm178.documentfoundation.org/ (OAuth2 breaks if it's not https://gerrit.libreoffice.org/ so that's what it's set to normally). So while it's a bit cumbersome it's not impossible. And then one can use the site as usual.

In the past we used this URL: gerrit-test.libreoffice.org to simplify this set up. Do we have that option now and can set it up that way?

Actions #20

Updated by Guilhem Moulin almost 6 years ago

David Ostrovsky wrote:

In the past we used this URL: gerrit-test.libreoffice.org to simplify this set up. Do we have that option now and can set it up that way?

I fail to see how that would help with respect to authentication. As long as the domain isn't gerrit.libreoffice.org (or a domain enabled by the OAuth2 provider) one will need to trick the system to get in.

So why having a less generic domain name? It's fairly usual to use vmXYZ.documentfoundation.org during the testing phase.

Actions #21

Updated by David Ostrovsky almost 6 years ago

I was trying to logn with my usual account (OpenID) that I used on production site, and git this error after successful redirect from my OpenID provider (Launchpad):

https://gerrit.libreoffice.org/#SignInFailure,SIGN_IN,Direct+signature+verification+failed.
The page you requested was not found, or you do not have permission to view this page.
Actions #22

Updated by Guilhem Moulin almost 6 years ago

Quoting myself:

for OpenID one needs to temporary run git config -f ~gerrit/etc/gerrit.config gerrit.canonicalWebUrl https://vm178.documentfoundation.org/ (OAuth2 breaks if it's not https://gerrit.libreoffice.org/ so that's what it's set to normally).

We were not able to make OAuth2 and OpenID work simultaneously. I just did the above, meaning OpenID works while OAuth2 no longer does.

Actions #23

Updated by David Ostrovsky almost 6 years ago

Guilhem Moulin wrote:

Quoting myself:

for OpenID one needs to temporary run git config -f ~gerrit/etc/gerrit.config gerrit.canonicalWebUrl https://vm178.documentfoundation.org/ (OAuth2 breaks if it's not https://gerrit.libreoffice.org/ so that's what it's set to normally).

We were not able to make OAuth2 and OpenID work simultaneously. I just did the above, meaning OpenID works while OAuth2 no longer does.

Thanks. I was able to login now. And my old account was preserved, with Account ID 1000020, and that is fine.

Second thing I tried is to create online change (from browser). It didn't work. I got this error:

Code Review - Error
500 Internal server error

Can you please check the server log, what is going on there?

Actions #24

Updated by Guilhem Moulin almost 6 years ago

David Ostrovsky wrote:

Can you please check the server log, what is going on there?

[2018-06-13 21:29:31,209] [HTTP-77] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in POST /changes/
java.io.IOException: Permission denied
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createTempFile(File.java:2024)

Too tight ACLs? Does it try to create the temporary file in /tmp rather than $gerrit_site/tmp? I just configured the service file to mount a private /tmp a dedicated FS namespace. Should help if that's indeed the case.

Actions #25

Updated by David Ostrovsky almost 6 years ago

Guilhem Moulin wrote:

David Ostrovsky wrote:

Can you please check the server log, what is going on there?

[...]

Too tight ACLs? Does it try to create the temporary file in /tmp rather than $gerrit_site/tmp? I just configured the service file to mount a private /tmp a dedicated FS namespace. Should help if that's indeed the case.

Nothing changed, I'm still getting: "500 Internal server error".

I guess, that the gerrit user doesn't have the ACL to right into git repository, under $gerrit_site/git. I'm trying to create change for Lode project.

Actions #26

Updated by Guilhem Moulin almost 6 years ago

David Ostrovsky wrote:

I guess, that the gerrit user doesn't have the ACL to right into git repository, under $gerrit_site/git. I'm trying to create change for Lode project.

Good guess, …/lode.git was copied without preserving the ownership/group, I just chmod'ed it. Other repositories had proper ownership (gerrit:gerrit) already.

Actions #27

Updated by David Ostrovsky almost 6 years ago

Guilhem Moulin wrote:

David Ostrovsky wrote:

I guess, that the gerrit user doesn't have the ACL to right into git repository, under $gerrit_site/git. I'm trying to create change for Lode project.

Good guess, …/lode.git was copied without preserving the ownership/group, I just chmod'ed it. Other repositories had proper ownership (gerrit:gerrit) already.

Thanks for the quick fix! It looks good now, I was able to create change online: [1].
And all new online edit features, that I contributed back in 2015 and waiting for years,
are there: [2].

What is the ETA to bump the production version to 2.13.11?

[1] https://vm178.documentfoundation.org/#/c/38878
[2] https://imgur.com/a/RCsbqVW

Actions #28

Updated by Guilhem Moulin almost 6 years ago

Quoting floeff on comment #8:

  • migration -> not super urgent either (given Q1 and Q2 has quite some high-prio topics for the team), summer/autumn would be fine for David, the earlier the btter of course

Time-wise the migration also needs to be suitable from a release engineering perspective; I assume July/August would be ideal, do you agree Christian Lohmaier? That leaves time for us to test the migration scripts.

By the way, one thing we did not do in the staging instance, was to migrate the H2 database for account patch reviews to PostgreSQL: https://www.gerritcodereview.com/releases/2.13.md#manual-schema-update-for-reviewed-flags . Would you say there is a good reason to do that, David?

Actions #29

Updated by David Ostrovsky almost 6 years ago

Guilhem Moulin wrote:

Quoting floeff on comment #8:

  • migration -> not super urgent either (given Q1 and Q2 has quite some high-prio topics for the team), summer/autumn would be fine for David, the earlier the btter of course

Time-wise the migration also needs to be suitable from a release engineering perspective; I assume July/August would be ideal, do you agree Christian Lohmaier? That leaves time for us to test the migration scripts.

SGTM.

By the way, one thing we did not do in the staging instance, was to migrate the H2 database for account patch reviews to PostgreSQL: https://www.gerritcodereview.com/releases/2.13.md#manual-schema-update-for-reviewed-flags . Would you say there is a good reason to do that, David?

It depends on how much records we do have there. On bis sites tehre are millions of rows and H2 database doesn't handle this very fast. Also note, that this migration can be done later. We wrote migration site program that can be used, so it must not be done during the migration. If you decide to do that, note though, that it must be a new database that only includes this single table. Main ReviewDb database cannot be used for this purpose.

Actions #30

Updated by Guilhem Moulin almost 6 years ago

  • Status changed from In Progress to Closed

Closing this, as we upgraded the prod instance to 2.13.11 last night.

Actions #31

Updated by Florian Effenberger almost 6 years ago

Closing this, as we upgraded the prod instance to 2.13.11 last night.

To double check:
This means that the planned upgrade for August, post-6.1, is already
done, or is there something pending?

Actions #32

Updated by Guilhem Moulin almost 6 years ago

Florian Effenberger wrote:

This means that the planned upgrade for August, post-6.1, is already
done, or is there something pending?

The latter; issue closed hence nothing pending :-) In the Jun 19 infra call cloph said he'd rather have the upgrade before RC1, hence the deadline revision.

Actions #33

Updated by Florian Effenberger almost 6 years ago

This means that the planned upgrade for August, post-6.1, is already
done, or is there something pending?

The latter; issue closed hence nothing pending :-) In the Jun 19 infra
call cloph said he'd rather have the upgrade before RC1, hence the
deadline revision.

I'm confused now ;-)
The latter means "something pending" - I guess you meant all is done,
ticket can be closed, right?

Actions #34

Updated by Guilhem Moulin almost 6 years ago

Florian Effenberger wrote:

This means that the planned upgrade for August, post-6.1, is already
done, or is there something pending?

The latter; issue closed hence nothing pending :-) In the Jun 19 infra
call cloph said he'd rather have the upgrade before RC1, hence the
deadline revision.

I'm confused now ;-)
The latter means "something pending" - I guess you meant all is done,
ticket can be closed, right?

Oops yeah sorry, I meant “the former”: everything in this ticket has been addressed already (there is nothing pending), and the ticket itself is closed already :-)

Actions #35

Updated by Florian Effenberger almost 6 years ago

Great, thanks a lo! :9

Actions #36

Updated by Florian Effenberger almost 6 years ago

Great, thanks a lo! :9

Great, thanks a lot! ;-)
is what I meant... :)

Actions

Also available in: Atom PDF