Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with credential provider #873

Closed
jecisc opened this issue Jun 20, 2018 · 3 comments
Closed

Error with credential provider #873

jecisc opened this issue Jun 20, 2018 · 3 comments
Assignees
Milestone

Comments

@jecisc
Copy link
Contributor

jecisc commented Jun 20, 2018

In Pharo 7 I tried to push some commits to gitlab on a private project and I got an error:

IceTipInteractiveCredentialsProvider(Object)>>subclassResponsibility
IceTipInteractiveCredentialsProvider(IceCredentialsProvider)>>obtainSshCredentials:
IceTipInteractiveCredentialsProvider(IceCredentialsProvider)>>provideSshCredentialsTo:
[ credentials := self new.
provider provideSshCredentialsTo: credentials.
credentials createWith: lgitCredentials.
^ 0 ] in LGitCredentialsSSH class>>createFrom:onto: in Block: [ credentials := self new....
BlockClosure>>on:do:
LGitCredentialsSSH class>>createFrom:onto:
LGitCredentialsSSH class>>createFrom:username:onto:
LGitRemoteCallbacks class>>putCredentialsType:username:provider:onto:
[ :output :url :username_from_url :allowed_types :data | 
"Allowed types are defined in git_credtype_t 
		https://github.com/libgit2/libgit2/blob/HEAD/include/git2/transport.h#L81-111"
self
	putCredentialsType: allowed_types
	username: username_from_url
	provider: provider
	onto: output ] in LGitRemoteCallbacks class>>newCredentialsCallbackFor: in Block: [ :output :url :username_from_url :allowed_types :...etc...
[ :credAddress :url :username_from_url :allowed_types :data | 
aBlock
	valueWithArguments:
		(Array
			with: (LGitCredentials fromHandle: credAddress)
			with: url
			with: username_from_url
			with: allowed_types
			with: data) ] in LGitCredAcquireCallback>>wrapBlock: in Block: [ :credAddress :url :username_from_url :allowed_ty...etc...
LGitCredAcquireCallback(FFICallback)>>valueWithContext:sp:
CallbackForIA32(Callback)>>evaluatorValueWithContext:sp:
CallbackForIA32>>valueInContext:
Callback class>>evaluateCallbackForContext:
[ type := Callback evaluateCallbackForContext: callbackAlien ] in Alien class>>invokeCallbackContext: in Block: [ type := Callback evaluateCallbackForContext: cal...etc...
BlockClosure>>ifCurtailed:
Alien class>>invokeCallbackContext:
LGitRemote>>remote_push:refspecs:opts:
LGitSafeFFICalloutAPI(FFICalloutAPI)>>function:module:
LGitRemote(LGitExternalObject)>>call:options:
LGitRemote>>remote_push:refspecs:opts:
[ self remote_push: self refspecs: refspecs opts: pushOptions ] in LGitRemote>>pushWithRefSpec:pushOptions: in Block: [ self remote_push: self refspecs: refspecs opts: ...etc...
LGitRemote(LGitExternalObject)>>withReturnHandlerDo:
LGitRemote>>pushWithRefSpec:pushOptions:
[ gitRemote
	pushWithRefSpec:
		(LGitRefSpec new
			source: self fullname;
			destination: self fullname;
			yourself)
	pushOptions:
		(LGitPushOptions defaults
			callbacks:
				(LGitRemoteCallbacks
					withProvider: (IceCredentialsProvider defaultForRemote: aRemote));
			yourself).

"Push tags!"
self tags
	do: [ :tag | 
		gitRemote
			pushWithRefSpec:
				(LGitRefSpec new
					source: 'refs/tags/' , tag name;
					destination: 'refs/tags/' , tag name;
					yourself)
			pushOptions:
				(LGitPushOptions defaults
					callbacks:
						(LGitRemoteCallbacks
							withProvider: (IceCredentialsProvider defaultForRemote: aRemote));
					yourself) ] ] in [ | gitRemote |
gitRemote := (LGitRemote of: self repositoryHandle named: aRemote name)
	lookup.
[ gitRemote
	pushWithRefSpec:
		(LGitRefSpec new
			source: self fullname;
			destination: self fullname;
			yourself)
	pushOptions:
		(LGitPushOptions defaults
			callbacks:
				(LGitRemoteCallbacks
					withProvider: (IceCredentialsProvider defaultForRemote: aRemote));
			yourself).

"Push tags!"
self tags
	do: [ :tag | 
		gitRemote
			pushWithRefSpec:
				(LGitRefSpec new
					source: 'refs/tags/' , tag name;
					destination: 'refs/tags/' , tag name;
					yourself)
			pushOptions:
				(LGitPushOptions defaults
					callbacks:
						(LGitRemoteCallbacks
							withProvider: (IceCredentialsProvider defaultForRemote: aRemote));
					yourself) ] ]
	on: LGit_GIT_ENONFASTFORWARD
	do: [ :e | 
		e
			resignalAs:
				(IceRemoteDesynchronized new
					remote: aRemote;
					yourself) ] ] in IceGitLocalBranch>>pushTo: in Block: [ gitRemote...
BlockClosure>>on:do:
[ | gitRemote |
gitRemote := (LGitRemote of: self repositoryHandle named: aRemote name)
	lookup.
[ gitRemote
	pushWithRefSpec:
		(LGitRefSpec new
			source: self fullname;
			destination: self fullname;
			yourself)
	pushOptions:
		(LGitPushOptions defaults
			callbacks:
				(LGitRemoteCallbacks
					withProvider: (IceCredentialsProvider defaultForRemote: aRemote));
			yourself).

"Push tags!"
self tags
	do: [ :tag | 
		gitRemote
			pushWithRefSpec:
				(LGitRefSpec new
					source: 'refs/tags/' , tag name;
					destination: 'refs/tags/' , tag name;
					yourself)
			pushOptions:
				(LGitPushOptions defaults
					callbacks:
						(LGitRemoteCallbacks
							withProvider: (IceCredentialsProvider defaultForRemote: aRemote));
					yourself) ] ]
	on: LGit_GIT_ENONFASTFORWARD
	do: [ :e | 
		e
			resignalAs:
				(IceRemoteDesynchronized new
					remote: aRemote;
					yourself) ] ] in IceGitLocalBranch>>pushTo: in Block: [ | gitRemote |...
BlockClosure>>on:do:
IceLibgitRepository>>handleLibgitError:
IceGitLocalBranch>>pushTo:
@guillep
Copy link
Member

guillep commented Jun 27, 2018

Fixed in #896

@guillep guillep closed this as completed Jun 27, 2018
@SergeStinckwich
Copy link
Contributor

Same error, when ssh credentials have not been added to github.

@guillep
Copy link
Member

guillep commented Jun 28, 2018

This fix will be in in the next release. We are stabilizing some features so the release will be probably next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants