git ubuntu fails to call ssh on Focal due to mismatched host ssh_config

Bug #1871827 reported by Christian Ehrhardt 
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Fix Released
High
Robie Basak

Bug Description

Seems to be an issue between "git ubuntu submit" and focal.

The new SSHs config file by default has an include path
  19 Include /etc/ssh/ssh_config.d/*.conf

It seems git-ubuntu comes with an older ssh/git combo that fails on it.

$ git ubuntu submit --reviewer canonical-server-packageset-reviewers --target-branch ubuntu/bionic-devel
04/09/2020 13:10:57 - ERROR:Command exited 128: git push paelzer refs/heads/bug-1847361-miss-old-so-on-upgrade-SRU-BIONIC:refs/heads/bug-1847361-miss-old-so-on-upgrade-SRU-BIONIC
04/09/2020 13:10:57 - ERROR:stdout:
04/09/2020 13:10:57 - ERROR:stderr: /etc/ssh/ssh_config: line 19: Bad configuration option: include
  /etc/ssh/ssh_config: terminating, 1 bad configuration options
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.

04/09/2020 13:10:57 - ERROR:Unable to push refs/heads/bug-1847361-miss-old-so-on-upgrade-SRU-BIONIC to remote paelzer

Tags: snap submit

Related branches

tags: added: submit
Robie Basak (racb)
tags: added: snap
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

$ ssh -V
OpenSSH_8.2p1 Ubuntu-4, OpenSSL 1.1.1f 31 Mar 2020

$ snap run --shell git-ubuntu
$ which ssh
/snap/core/current/usr/bin/ssh
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, OpenSSL 1.0.2n 7 Dec 2017

So you are using ssh from the core snap, instead of the host, with host ssh configs.

Either you need to prefer ssh from the host (or all of PATH?), or upgrade git-ubuntu to use "base: core20".

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Workaround:
$ sudo mount -o bind /usr/bin/ssh /snap/core/current/usr/bin/ssh

Still fails:
$ git-ubuntu submit
04/30/2020 04:34:15 - ERROR:Unable to create merge proposal: HTTP Error 400: Bad Request
Response headers:
---
connection: close
content-length: 40
content-security-policy: frame-ancestors 'self';
content-type: text/plain;charset=utf-8
date: Thu, 30 Apr 2020 03:34:15 GMT
server: zope.server.http (HTTP)
status: 400
strict-transport-security: max-age=15552000
vary: Accept
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-launchpad-revision: fbdff7602bd10fb883bf7e2ddcc7fd5a16f60398
x-lazr-notifications: []
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-xss-protection: 1; mode=block
---
Response body:
---
b'merge_target: Required input is missing.'
---

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@snapd team, surely, on classic systems one wants to run /usr/bin/ssh not /snap/core*/current/usr/bin/ssh by default.....

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 1871827] Re: git ubuntu submit fails on focal

Classic snaps should never invoke binaries from the core snap, as they will
try to load libraries from the host, which may not be compatible or present.

On Sat, 2 May 2020, 04:21 Dimitri John Ledkov, <email address hidden>
wrote:

> @snapd team, surely, on classic systems one wants to run /usr/bin/ssh
> not /snap/core*/current/usr/bin/ssh by default.....
>
> --
> You received this bug notification because you are a member of Snappy
> Developers, which is subscribed to Snappy.
> https://bugs.launchpad.net/bugs/1871827
>
> Title:
> git ubuntu submit fails on focal
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snappy/+bug/1871827/+subscriptions
>

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On Fri, 2020-05-01 at 17:47:28 -0300, Michael Hudson-Doyle wrote:

> Classic snaps should never invoke binaries from the core snap, as they will
> try to load libraries from the host, which may not be compatible or
> present.

Unless the base is made classic safe, which AFAIK requires similar work
to the work we do en Snapcraft for app type snaps.

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote : Re: git ubuntu submit fails on focal

Since it's a classic snap, I would argue that the problem is outside of snapd scope. Ultimately the snap must figure out which ssh binary to call such that it can operate successfully on a given host.

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

This is an issue for non-classic Snap packages as well if they make use of the ssh-keys interface.

For example: https://github.com/digitalocean/doctl/issues/809

no longer affects: snappy
Revision history for this message
Robie Basak (racb) wrote :
Changed in usd-importer:
status: New → Triaged
importance: Undecided → High
Robie Basak (racb)
summary: - git ubuntu submit fails on focal
+ git ubuntu fails to call ssh on Focal
summary: - git ubuntu fails to call ssh on Focal
+ git ubuntu fails to call ssh on Focal due to mismatched host ssh_config
Robie Basak (racb)
Changed in usd-importer:
status: Triaged → In Progress
assignee: nobody → Robie Basak (racb)
Revision history for this message
Robie Basak (racb) wrote :

Fixed in 69bf644.

Changed in usd-importer:
status: In Progress → Fix Committed
Revision history for this message
Robie Basak (racb) wrote : Fix released in git-ubuntu

Fix released in git-ubuntu version 1.0

Changed in usd-importer:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.