Project

General

Profile

Actions

Bug #10263

closed

[arvados-git-httpd] HOME variable necesary for gitolite-shell without GL_BYPASS_ACCESS_CHECKS=1

Added by Nico César over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Git hosting
Target version:
Story points:
-

Description

the excecution of arvados-git-httpd in centOS7 (systemd) is complaining that the hooks execution of "update" doesn't have the HOME variable

I added the variable to the arvados-git-httpd.servece but gitlite still can't see it

Actions #1

Updated by Nico César over 7 years ago

After applying this branch we discover that setting up GL_BYPASS_ACCESS_CHECKS=1 in the .service file will make it work ...

shouldn't this be part of theConfig instead of an inherit variable ?

Actions #2

Updated by Tom Clegg over 7 years ago

Ah, yes. The old runit script at http://doc.arvados.org/install/install-arv-git-httpd.html says

export GITOLITE_HTTP_HOME=/var/lib/arvados/git
export GL_BYPASS_ACCESS_CHECKS=1

Perhaps we should have a single config, which causes arvados-git-httpd to set both of those env vars?

{
  ...,
  "GitoliteHome": "/var/lib/arvados/git" 
}
Actions #3

Updated by Nico César over 7 years ago

  • Subject changed from [arvados-git-httpd] HOME variable necesary for gitolite-shell to [arvados-git-httpd] HOME variable necesary for gitolite-shell without GL_BYPASS_ACCESS_CHECKS=1

Tom Clegg wrote:

Perhaps we should have a single config, which causes arvados-git-httpd to set both of those env vars?

Yes, that sounds like a good idea.

It was very difficult to realize that the environment variables that we set in the .service file aren't pass all the way to gitolite (and it's exploding perl traceback). But again, we now that we got it working we understand what happened. we should ONLY have 1 config file, then that sets up the environment for the underlaying backend.

Actions #4

Updated by Tom Clegg over 7 years ago

  • Status changed from New to In Progress
  • Assigned To set to Tom Clegg
Actions #5

Updated by Tom Clegg over 7 years ago

10234-git-httpd-config

todo: update doc page to use the new config option instead of env vars

Actions #6

Updated by Tom Clegg over 7 years ago

Tom Clegg wrote:

todo: update doc page to use the new config option instead of env vars

This is done & merged in 70f1b69f

Actions #7

Updated by Nico César over 7 years ago

from what I see (my master is in 8b03f0b0e66190b35c55ce1f0917dd2104b8a0b9 ) HOME variable doesn't seem to be exported (I'm talking about HOME not GITOLITE_HTTP_HOME) , you can see in my simple branch 10263-env-home-missing I just re-exported the HOME env var

Jaview will paste the error and the package version.

Actions #8

Updated by Javier Bértoli over 7 years ago

In the arvagrant testing environment (/arvagrant.git, commit:0a69f7d):

From the SHELL host (with arvados-git-httpd package version arvados-git-httpd-0.1.20161013204355.70f1b69-1.x86_64 installed in the API server), when we run

cd /tmp
rm -rf /tmp/arvados.git
git clone --bare https://github.com/curoverse/arvados.git
git -c http.sslVerify=false --git-dir arvados.git push https://git.y5x3o.arvadosapi.com/arvados.git '*:*'

we get this error when pushing code to the git server:

[root@shell tmp]# git -c http.sslVerify=false --git-dir arvados.git push https://git.y5x3o.arvadosapi.com/arvados.git '*:*'
Counting objects: 93071, done.
Compressing objects: 100% (22889/22889), done.
Writing objects: 100% (93071/93071), 24.04 MiB | 0 bytes/s, done.
Total 93071 (delta 65332), reused 93071 (delta 65332)
remote: Empty compile time value given to use lib at hooks/update line 6.
remote: FATAL: errors found before logging could be setup
remote: FATAL: warn    Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/share/perl5/vendor_perl/Gitolite/Rc.pm line 207.<<newline>>
remote: error: hook declined to update refs/heads/3408-add-size-to-locators
remote: Empty compile time value given to use lib at hooks/update line 6.
remote: FATAL: errors found before logging could be setup
remote: FATAL: warn    Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/share/perl5/vendor_perl/Gitolite/Rc.pm line 207.<<newline>>
remote: error: hook declined to update refs/heads/6858-job-re-run-documentation
remote: Empty compile time value given to use lib at hooks/update line 6.
remote: FATAL: errors found before logging could be setup
remote: FATAL: warn    Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/share/perl5/vendor_perl/Gitolite/Rc.pm line 207.<<newline>>
remote: error: hook declined to update refs/heads/8488-cwl-crunchrunner-collection
remote: Empty compile time value given to use lib at hooks/update line 6.
remote: FATAL: errors found before logging could be setup
remote: FATAL: warn    Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/share/perl5/vendor_perl/Gitolite/Rc.pm line 207.<<newline>>
remote: error: hook declined to update refs/heads/master
remote: Empty compile time value given to use lib at hooks/update line 6.
remote: FATAL: errors found before logging could be setup
remote: FATAL: warn    Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/share/perl5/vendor_perl/Gitolite/Rc.pm line 207.<<newline>>
remote: error: hook declined to update refs/heads/staging
To https://git.y5x3o.arvadosapi.com/arvados.git
 ! [remote rejected] 3408-add-size-to-locators -> 3408-add-size-to-locators (hook declined)
 ! [remote rejected] 6858-job-re-run-documentation -> 6858-job-re-run-documentation (hook declined)
 ! [remote rejected] 8488-cwl-crunchrunner-collection -> 8488-cwl-crunchrunner-collection (hook declined)
 ! [remote rejected] master -> master (hook declined)
 ! [remote rejected] staging -> staging (hook declined)
error: failed to push some refs to 'https://git.y5x3o.arvadosapi.com/arvados.git'

The /etc/arvados/git-httpd/git-httpd.yml config in the API server has these values:

client:
  apihost: y5x3o.arvadosapi.com
  authtoken: 5bito7xzq5y7k4ehfyy25w77fym2cjsttgmvg65tqjv4u49wg9
  insecure: true
  gitcommand: /usr/share/gitolite3/gitolite-shell

listen: 127.0.0.1:9001
reporoot: /var/lib/arvados/git/repositories
GitoliteHome: /var/lib/arvados/git

The /lib/systemd/system/arvados-git-httpd.service

[Unit]
Description=Arvados git server
Documentation=https://doc.arvados.org/
After=network.target
AssertPathExists=/etc/arvados/git-httpd/git-httpd.yml

[Service]
User=git
Type=Notify
ExecStart=/usr/bin/arvados-git-httpd
Restart=Always

[Install]
WantedBy=multi-user.target

Actions #9

Updated by Nico César over 7 years ago

I compiled on Friday the version in the branch 10263-env-home-missing and it was working, now we've been catching up with the automation in vagrant and doesn't work anymore. Is there a reason why HOME isn't re-exported anymore?

Actions #10

Updated by Tom Clegg over 7 years ago

arv-git-httpd shouldn't need to export HOME. HOME is normally set up by gitolite-shell before the hooks run. I think the issue here is that gitolite-shell isn't running because the YAML config file has an indentation error on the "gitcommand" line.

Should be

client:
  apihost: y5x3o.arvadosapi.com
  authtoken: "" 
  insecure: true
gitcommand: /usr/share/gitolite3/gitolite-shell
listen: 127.0.0.1:9001
reporoot: /var/lib/arvados/git/repositories
GitoliteHome: /var/lib/arvados/git

(Putting an authtoken in the config is harmless, but unnecessary, so I've suggested "".)

Actions #11

Updated by Nico César over 7 years ago

This can be closed. new version of config file is working ok

Actions #12

Updated by Tom Clegg over 7 years ago

  • Category set to Git hosting
  • Status changed from In Progress to Resolved
Actions #13

Updated by Tom Clegg over 7 years ago

  • Target version set to 2016-10-26 sprint
Actions

Also available in: Atom PDF