BookmarkSubscribeRSS Feed
Sajid01
Meteorite | Level 14

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.

 

15 REPLIES 15
CaseySmith
SAS Employee

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

Sajid01
Meteorite | Level 14

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"

dazimm
SAS Employee

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

 

Sajid01
Meteorite | Level 14

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.

snoopy369
Barite | Level 11

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.

dazimm
SAS Employee

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

snoopy369
Barite | Level 11

@dazimm Does the key need to have a blank passphrase?  Or can I add a passphrase?

dazimm
SAS Employee

@snoopy369 

Yes, leave the password blank. The Git functions currently do not support password protected SSH keys.

snoopy369
Barite | Level 11
Got it, that worked for GIT_FN(). Studio's integrated git repos still don't work properly with it, but I'll play with that a bit more; assuming Studio is actually using GIT_FN behind the scenes I can look at the logs and see what's being sent. Thanks!
dazimm
SAS Employee

Studio does use the functions behind the scenes. You might need to update the ssh keys in your Git Profile within studio.

snoopy369
Barite | Level 11

@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.

snoopy369
Barite | Level 11

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.  

dazimm
SAS Employee

I see. The bug occurs within the SASStudio code and not the function code. We addressed this in a hotfix.

snoopy369
Barite | Level 11
Okay, that's what I figured; I thought we had that hotfix in but apparently not. Will install it next week - thanks again for the help!

(Also, is there a good place/person to send suggestions for future additions to the git integration? I have a few dozen 🙂 )

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 15 replies
  • 2955 views
  • 5 likes
  • 4 in conversation