Git usage in CMS open data environments

Due to protocol changes w.r.t to the legacy environment, the git clone commands produce an error:

git clone https://github.com/cms-opendata-validation/2010-mu-mumonitor-dimuon  Validation/Mu_Mumonitor_dimuon_2010
Cloning into 'Validation/Mu_Mumonitor_dimuon_2010'...
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/cms-opendata-validation/2010-mu-mumonitor-dimuon/info/refs?service=git-upload-pack
fatal: HTTP request failed

The CMS open data environments will soon be updated to fix this error. Meanwhile, there are two solutions:

You can use git clone git format, i.e.

git clone git://github.com/cms-opendata-validation/2010-mu-mumonitor-dimuon Validation/Mu_Mumonitor_dimuon_2010

in the CMS open data containers or in the CMS Shell in the VM image.

Alternatively, clone the repository normally with git clone https... in a more recent environment:

  • if using containers, in your local area, which you mount as a volume to the container
  • if using VM, in the terminal with a more recent OS, which opens from a terminal icon on the bottom of the desktop screen (remember that in the VM, building the CMSSW area and compiling must be done in the CMS shell)

In addition to the above, if you are using containers and you want to be able to access the ssh keys needed to clone repos, for example from Github, you’ll want to launch the container such that the keys are accessible from inside the container.

docker run --it -v ${HOME}/.ssh:/home/cmsusr/.ssh ...

As a more complete example, I run the following to start a CMSSW 5.3.32 container instance making sure that I a) can access my ssh keys and b) will have X11 forwarding enabled.

 docker run -it -v ${HOME}/.ssh:/home/cmsusr/.ssh --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" cmsopendata/cmssw_5_3_32 /bin/bash

For those who are looking for the working syntex, you may use older version of git (<2.0) to checkout:

git clone git@github.com:cms-opendata-validation/2010-mu-mumonitor-dimuon Validation/Mu_Mumonitor_dimuon_2010

I’ve tried both this and the solution in the reply by SiewYan and neither has worked for me.

When using this original fix, I am told I can’t connect to GitHub and that my connection has timed out.

When I use SiewYan’s suggestion, I am told I can’t read from the directory and may not have permission or the correct address.

(I would have given the precise output I’m getting, but it is read as including too many links for me to post.)

Is there a third possible solution or do I have some other problem?

Hi, thanks for reporting!

Can you confirm the container image you are using?

If you are using cmsopendata/cmssw_5_3_32 these instructions should work.

Note that you should not submit cmsenv command in the container as it changes git back to older versions. The container environment is set up and ready to use at the start-up without additional commands.

Hope this help and if not, please list the exact command so that we can reproduce.

Best, Kati
for the CMS open data team

Thanks for the reply!

I am using cmsopendata/cmssw_5_3_32, but I had submitted the cmsenv command before I tried it.

Please forgive the question and my inexperience, but what is the best way of reversing the cmsenv command?

Thanks again!

~Jill Ziegler
QuarkNet teacher
University of Notre Dame QuarkNet Center and Hamilton High School West

I’m glad that helps! That’s a good question also for the experienced :wink: I believe the easiest thing is to exit from the container and start it again (docker start -i <container-name>)
To see if it helps you can type git --version before exiting and again when you have started and if the output is different then you’re back to the correct environment.

Best, Kati

Does that apply to the VM? I tried it and it didn’t seem to work. I’m running v 1.7.something of git, apparently.

~Jill

If you are using the VM, then you should indeed submit cmsenv in the “CMS shell” once you’ve built your CMSSW area.
But you will then use the other shell (“Outer shell”) for git as it has a different, more recent environment where you should be able to use the git clone https://... syntax.
But do not submit cmsenv in the “Outer shell”, it will change the git version there.

Remember to do all compiling (scram b) in the “CMS shell”.

This is all due to the challenge of providing the correct environment for open data, but still trying to adapt to the changes in the surrounding world.

Best, Kati