Cannot push code to my git repo

Asked by Ar Rakin

I've added my ssh key to launchpad, and then I've added the remote 'git+ssh://<email address hidden>/~onesoftnet/invention/+git/invention' to my local repo.
But the problem is I cannot push files.

SSH fails to authenticate with launchpad.

Please help me.

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

Could you post the output of "ssh -vvv <email address hidden>"? (Check the output for secrets just in case, but it shouldn't include anything like private key material.)

Revision history for this message
Ioana Lasc (ilasc) said :
#2

Hello

Can you please provide exact failure message ?

One thing to try is verify the ssh-agent is running in the background and if not start it and make sure your SSH private key is added to the ssh-agent.

The other issue I see is the way the remote is specified for the repo you're trying to push to: is you're trying to push code under the project I would specify the remote like this:

git+ssh://<email address hidden>/~rakinar2/onesoftnet/+git/invention

otherwise for personal repos I would try:

git+ssh://<email address hidden>/~rakinar2/+git/invention

Revision history for this message
Colin Watson (cjwatson) said :
#3

Pushing to ~onesoftnet ought to work, though, since ~rakinar2 is a member of that team. But let's see the exact output and work from there :-)

Revision history for this message
Ar Rakin (rakinar2) said :
#4

Output of `ssh -vvv <email address hidden>`:

OpenSSH_8.7p1, OpenSSL 1.1.1k 25 Mar 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/c/Users/rakinar2/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/c/Users/rakinar2/.ssh/known_hosts2'
debug2: resolving "git.launchpad.net" port 22
debug3: ssh_connect_direct: entering
debug1: Connecting to git.launchpad.net [185.125.188.44] port 22.
debug3: set_sock_tos: set socket 4 IP_TOS 0x48
debug1: Connection established.
debug1: identity file /c/Users/rakinar2/.ssh/id_rsa type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_dsa type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_ed25519 type 3
debug1: identity file /c/Users/rakinar2/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_xmss type -1
debug1: identity file /c/Users/rakinar2/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.7
debug1: Remote protocol version 2.0, remote software version Twisted_20.3.0+lp5
debug1: compat_banner: match: Twisted_20.3.0+lp5 pat Twisted_* compat 0x00000000
debug2: fd 4 setting O_NONBLOCK
debug1: Authenticating to git.launchpad.net:22 as 'rakinar2'
debug3: record_hostkey: found key type RSA in file /c/Users/rakinar2/.ssh/known_hosts:6
debug3: load_hostkeys_file: loaded 1 keys from git.launchpad.net
debug1: load_hostkeys: fopen /c/Users/rakinar2/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug3: order_hostkeyalgs: prefer hostkeyalgs: <email address hidden>,<email address hidden>,<email address hidden>,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,<email address hidden>,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: <email address hidden>,<email address hidden>,<email address hidden>,rsa-sha2-512,rsa-sha2-256,ssh-rsa,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,<email address hidden>,<email address hidden>
debug2: ciphers ctos: <email address hidden>,aes128-ctr,aes192-ctr,aes256-ctr,<email address hidden>,<email address hidden>,aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc
debug2: ciphers stoc: <email address hidden>,aes128-ctr,aes192-ctr,aes256-ctr,<email address hidden>,<email address hidden>,aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc
debug2: MACs ctos: <email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: <email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,<email address hidden>,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,<email address hidden>,zlib
debug2: compression stoc: none,<email address hidden>,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,<email address hidden>,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-s
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: aes256-ctr,aes256-cbc,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,cast128-cbc,blowfish-cbc,3des-cbc
debug2: ciphers stoc: aes256-ctr,aes256-cbc,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,cast128-cbc,blowfish-cbc,3des-cbc
debug2: MACs ctos: hmac-sha2-512,hmac-sha2-384,hmac-sha2-256,hmac-sha1,hmac-md5
debug2: MACs stoc: hmac-sha2-512,hmac-sha2-384,hmac-sha2-256,hmac-sha1,hmac-md5
debug2: compression ctos: none,zlib
debug2: compression stoc: none,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: [key has been omitted]
debug3: record_hostkey: found key type RSA in file /c/Users/rakinar2/.ssh/known_hosts:6
debug3: load_hostkeys_file: loaded 1 keys from git.launchpad.net
debug1: load_hostkeys: fopen /c/Users/rakinar2/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'git.launchpad.net' is known and matches the RSA host key.
debug1: Found key in /c/Users/rakinar2/.ssh/known_hosts:6
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /c/Users/rakinar2/.ssh/id_rsa
debug1: Will attempt key: /c/Users/rakinar2/.ssh/id_dsa
debug1: Will attempt key: /c/Users/rakinar2/.ssh/id_ecdsa
debug1: Will attempt key: /c/Users/rakinar2/.ssh/id_ecdsa_sk
debug1: Will attempt key: /c/Users/rakinar2/.ssh/id_ed25519 ED25519 SHA256:9Ucw/nXhZIPdvbH3RC8EaVJRQa8vnUO1WgGizkEUdKE
debug1: Will attempt key: /c/Users/rakinar2/.ssh/id_ed25519_sk
debug1: Will attempt key: /c/Users/rakinar2/.ssh/id_xmss
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-512,rsa-sha2-256,ssh-rsa>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/rakinar2/.ssh/id_rsa
debug3: no such identity: /c/Users/rakinar2/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /c/Users/rakinar2/.ssh/id_dsa
debug3: no such identity: /c/Users/rakinar2/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /c/Users/rakinar2/.ssh/id_ecdsa
debug3: no such identity: /c/Users/rakinar2/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /c/Users/rakinar2/.ssh/id_ecdsa_sk
debug3: no such identity: /c/Users/rakinar2/.ssh/id_ecdsa_sk: No such file or directory
debug1: Offering public key: /c/Users/rakinar2/.ssh/id_ed25519 ED25519 SHA256:9Ucw/nXhZIPdvbH3RC8EaVJRQa8vnUO1WgGizkEUdKE
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /c/Users/rakinar2/.ssh/id_ed25519 ED25519 SHA256:9Ucw/nXhZIPdvbH3RC8EaVJRQa8vnUO1WgGizkEUdKEdebug3: sign_and_send_pubkey: ED25519 SHA256:9Ucw/nXhZIPdvbH3RC8EaVJRQa8vnUO1WgGizkEUdKE
debug3: sign_and_send_pubkey: signing using [key has been omitted]
Enter passphrase for key '/c/Users/rakinar2/.ssh/id_ed25519': [passphrase]
debug3: send packet: type 50
debug3: receive packet: type 52
Authenticated to git.launchpad.net ([185.125.188.44]:22) using "publickey".
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Entering interactive session.
debug1: pledge: filesystem full
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 4 setting TCP_NODELAY
debug3: set_sock_tos: set socket 4 IP_TOS 0x48
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 131072 rmax 32768
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd ext data 27
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug2: channel 0: output open -> drain
debug2: chan_shutdown_read: channel 0: (i0 o1 sock -1 wfd 5 efd 7 [write])
debug2: channel 0: input open -> closed
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
debug3: channel 0: will not send data after close
debug2: channel 0: obuf_empty delayed efd 7/(27)
No shells on this server.
debug2: channel 0: written 27 to efd 7
debug3: channel 0: will not send data after close
debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i3 o1 sock -1 wfd 6 efd 7 [write])
debug2: channel 0: output drain -> closed
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/7 sock -1 cc -1)

debug3: send packet: type 1
Connection to git.launchpad.net closed.
Transferred: sent 2552, received 1672 bytes, in 0.4 seconds
Bytes per second: sent 5900.6, received 3865.9
debug1: Exit status -1

Revision history for this message
Ar Rakin (rakinar2) said (last edit ):
#5

If I use `git+ssh://<email address hidden>/~rakinar2/onesoftnet/+git/invention` as remote URL and run 'git push', I get the following error:

Enter passphrase for key '/c/Users/rakinar2/.ssh/id_ed25519':
fatal: remote error: Project 'onesoftnet' does not exist.

Revision history for this message
Ar Rakin (rakinar2) said (last edit ):
#6

If I use `git+ssh://<email address hidden>/~onesoftnet/invention/+git/invention` as remote and run 'git push', I get the following error:

Enter passphrase for key '/c/Users/rakinar2/.ssh/id_ed25519':
fatal: remote error: Permission denied.

Revision history for this message
Best Colin Watson (cjwatson) said :
#7

https://code.launchpad.net/~onesoftnet/invention/+git/invention is an automatic code import from https://github.com/onesoft-sudo/invention-framework. You can't push directly to code imports, because it would leave the repository in a very confusing state - if there were subsequent changes to the source repository, which one would win?

If you want to push to that repository, you should (if you can) push directly to the repository on GitHub instead, and then Launchpad will import those changes shortly afterwards. Or, if you want to move the repository from GitHub to Launchpad, you should delete the code import and push it directly rather than using the code import system.

Revision history for this message
Ar Rakin (rakinar2) said :
#8

Hi, I don't need `https://code.launchpad.net/~onesoftnet/invention/+git/invention` git repo, please delete it. Thanks.

Revision history for this message
Ar Rakin (rakinar2) said :
#9

Thanks Colin Watson, that solved my question.