Hello
When I try to puch from local copy of develop branch from my machine to the bit bucket server I get an error.
My code is this
%let my_local=full_path_of_local_repo;
%let this_user=my_username;
%let my_pub_key=full_path_of_public_key;
%let my_pvt_key=full_path_of_pvt_key;
data _null_;
rc =GITFN_PUSH( "&my_local.", "&this_user", "", "&my_pub_key.", "&my_pvt_key.");
put rc=;
run;
The error is
ERROR: Return code from GIT is (12). too many redirects or authentication replays
If I use my username and password it works.
Git clone works with ssh keys
Any advise?
Note: I have gone through the sas documentation ( https://go.documentation.sas.com/?docsetId=lefunctionsref&docsetTarget=n10pxql65jtf4sn11m3d6jzcrgcz.... ) and Zimmerman's paper (https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3057-2019.pdf.)
Looking for something beyond this.
Thanks once again.
What version of SAS are you running? 9.4M5 or 9.4M6?
Are you saying the same ssh keys work with GITFN_CLONE? Or do you mean with "git clone" from command-line?
@dazimm, any ideas why this wouldn't work with ssh keys? Perhaps related to the ssh keys needing to be generated a special way?
Casey
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
1. 9.4M6
2. Yes it is GITFN_CLONE in SAS EG
3. ssh keys were generated as usual in git bash as follows
ssh-keygen -t rsa -C "myemail"
Hi Somename,
GITFN_CLONE will work without credentials if the remote repository is public.
Try generating your ssh keys with the following command in git bash:
ssh-keygen -t rsa -m PEM -b 4096 -C “email”
If that doesn't work, make sure that the user name parameter is whatever comes before the @ in the ssh url. See below:
git@github.com:sascommunities/sas-global-forum-2019.git
Danny
Thanks.
Learn't from admins that repository needs to be cloned using ssh.
Did that. But now the error message is
ERROR: Return code from GIT is (23). failed to start SSH session: Unable to exchange encryption keys
Saw a SAS note http://support.sas.com/kb/63/549.html for this error.
The documentation on the hotfix (http://ftp.sas.com/techsup/download/hotfix/HF2/D/D9T/D9T006/xx/lax/D9T006la.html) indicates it is for Linux whereas the server OS in my case is WINDOWS SERVER 2016.
By the way everything (ssh keys) works with git-bash.
Thanks everybody for your help.
Looks like this is an issue at my site as well - in Windows, HTTPS works, SSH doesn't, same error code 23 whether in GITFN_x or Studio direct integration, in 9.4 TS1M6. Getting M7 soon hopefully so will report back if it's fixed then, but otherwise looks like HTTPS is the way to go on Windows.
Hi @snoopy369,
Try regenerating the SSH keys you are using with the following command and try again:
ssh-keygen -t rsa -m PEM -b 4096 -C “email”
The SSH library we use with the git library seems to have issues with some of the newer SSH keygen algorithms.
Danny
@dazimm Does the key need to have a blank passphrase? Or can I add a passphrase?
Yes, leave the password blank. The Git functions currently do not support password protected SSH keys.
Studio does use the functions behind the scenes. You might need to update the ssh keys in your Git Profile within studio.
@dazimm Looks like Studio is messing things up - it adds a "ssh://" to the username. Not sure if the hotfix that makes this "production" would fix that or not, I believe we have that installed, but will double check during maintenance next week.
Just to be clear, this works:
data _null_;
rc =GITFN_PUSH( "pathtorepo", "matise-joe",
"", "pathto/id_rsa.pub", "pathto/id_rsa");
put rc=;
run;
But when I do the Studio integrated version, it runs this code:
data _null_;
rc =GITFN_PUSH( "pathtorepo", "ssh://matise-joe",
"", "pathto/id_rsa.pub", "pathto/id_rsa");
put rc=;
run;
Which of course fails.
I see. The bug occurs within the SASStudio code and not the function code. We addressed this in a hotfix.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.