2016-04-15 17:46:32 |
Scott Moser |
bug |
|
|
added bug |
2016-04-15 18:05:02 |
Scott Moser |
ssh-import-id (Ubuntu): status |
New |
Confirmed |
|
2016-04-15 18:05:04 |
Scott Moser |
ssh-import-id (Ubuntu): importance |
Undecided |
Low |
|
2016-04-15 18:05:13 |
Scott Moser |
bug task added |
|
ssh-import-id |
|
2016-04-15 18:13:10 |
Scott Moser |
ssh-import-id: status |
New |
Confirmed |
|
2016-04-15 18:13:12 |
Scott Moser |
ssh-import-id: importance |
Undecided |
Low |
|
2017-01-18 21:56:41 |
Joshua Powers |
bug |
|
|
added subscriber Ubuntu Server Team |
2017-06-07 21:17:15 |
Christian Ehrhardt |
tags |
amd64 apport-bug ec2-images xenial |
amd64 apport-bug bot-stop-nagging ec2-images xenial |
|
2017-07-03 16:18:40 |
Launchpad Janitor |
branch linked |
|
lp:~smoser/ssh-import-id/trunk.lp1570997 |
|
2017-07-04 14:42:39 |
Christian Ehrhardt |
ssh-import-id (Ubuntu): assignee |
|
Scott Moser (smoser) |
|
2017-07-04 14:44:20 |
Andreas Hasenack |
ssh-import-id (Ubuntu): assignee |
Scott Moser (smoser) |
|
|
2017-07-10 14:05:39 |
Scott Moser |
ssh-import-id: status |
Confirmed |
In Progress |
|
2017-07-10 14:05:42 |
Scott Moser |
ssh-import-id: assignee |
|
Scott Moser (smoser) |
|
2017-07-11 20:47:24 |
Dustin Kirkland |
ssh-import-id: assignee |
Scott Moser (smoser) |
Dustin Kirkland (kirkland) |
|
2017-07-11 20:52:06 |
Launchpad Janitor |
branch linked |
|
lp:ssh-import-id |
|
2017-07-11 21:37:42 |
Dustin Kirkland |
ssh-import-id: status |
In Progress |
Fix Committed |
|
2017-07-11 21:38:01 |
Dustin Kirkland |
ssh-import-id (Ubuntu): status |
Confirmed |
Fix Committed |
|
2017-07-11 21:38:05 |
Dustin Kirkland |
ssh-import-id (Ubuntu): assignee |
|
Dustin Kirkland (kirkland) |
|
2017-07-11 23:33:17 |
Launchpad Janitor |
ssh-import-id (Ubuntu): status |
Fix Committed |
Fix Released |
|
2018-03-27 18:03:34 |
Scott Moser |
nominated for series |
|
Ubuntu Xenial |
|
2018-03-27 18:03:34 |
Scott Moser |
bug task added |
|
ssh-import-id (Ubuntu Xenial) |
|
2018-03-27 18:13:09 |
Scott Moser |
description |
I've modified /usr/bin/ssh-import-id to show a stack trace rather than unhelpful message:
TypeError: join() argument must be str or bytes, not 'NoneType'
Then, running:
$ env -u HOME ssh-import-id smoser
Traceback (most recent call last):
File "/usr/bin/ssh-import-id", line 62, in <module>
main()
File "/usr/bin/ssh-import-id", line 45, in main
k = import_keys(proto, username, parser.options.useragent)
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 204, in import_keys
local_keys = key_list(read_keyfile())
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 135, in read_keyfile
output_file = parser.options.output or os.path.join(os.getenv("HOME"), ".ssh", "authorized_keys")
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
I came to find this by trying to launch an instance with:
$ ec2metadata --user-data
#!/bin/sh
exec >/my.log 2>&1
cat /proc/uptime
date -R
ssh-import-id smoser
The basic issue is that the environment that cloud-init runs in does not have HOME set.
I suggest using os.path.expanduser
def authorized_key_file():
return os.path.join(os.path.expanduser("~"), ".ssh", "authorized_keys")
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ssh-import-id 5.5-0ubuntu1 [modified: usr/bin/ssh-import-id]
ProcVersionSignature: User Name 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Fri Apr 15 17:36:09 2016
Ec2AMI: ami-929f8cf8
Ec2AMIManifest: ubuntu-us-east-1/images-testing/hvm-instance/ubuntu-xenial-daily-amd64-server-20160412.manifest.xml
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: m3.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ssh-import-id
UpgradeStatus: No upgrade log present (probably fresh install) |
=== Begin SRU Template ===
[Impact]
Running ssh-import-id without environment variable HOME set
will fail and print an error message like:
TypeError: join() argument must be str or bytes, not 'NoneType'
[Test Case]
$ name="my-x"
$ ud=$(printf '%s\n%s\n' '#!/bin/sh' 'ssh-import-id smoser')
$ lxc launch ubuntu-daily:xenial "$name" "--config=user.user-data=$ud"
To see failure, you can then just:
$ lxc exec "$name" -- cat /run/cloud-init/result.json
{
"v1": {
"datasource": "DataSourceHetzner",
"errors": [
"('scripts-user', RuntimeError('Runparts: 1 failures in 1 attempted commands',))"
]
}
}
$ lxc exec "$name" -- grep "ssh-import-id smoser" /root/.ssh/authorized_keys &&
echo GOOD || echo FAIL
[Regression Potential]
Regression is unlikely. The code only does anything if HOME is not present.
This has been in Artful and Bionic since 2016-09-16.
[Other Info]
Upstream merge proposal:
https://code.launchpad.net/~smoser/ssh-import-id/trunk.lp1570997/+merge/326692
=== End SRU Template ===
I've modified /usr/bin/ssh-import-id to show a stack trace rather than unhelpful message:
TypeError: join() argument must be str or bytes, not 'NoneType'
Then, running:
$ env -u HOME ssh-import-id smoser
Traceback (most recent call last):
File "/usr/bin/ssh-import-id", line 62, in <module>
main()
File "/usr/bin/ssh-import-id", line 45, in main
k = import_keys(proto, username, parser.options.useragent)
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 204, in import_keys
local_keys = key_list(read_keyfile())
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 135, in read_keyfile
output_file = parser.options.output or os.path.join(os.getenv("HOME"), ".ssh", "authorized_keys")
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
I came to find this by trying to launch an instance with:
$ ec2metadata --user-data
#!/bin/sh
exec >/my.log 2>&1
cat /proc/uptime
date -R
ssh-import-id smoser
The basic issue is that the environment that cloud-init runs in does not have HOME set.
I suggest using os.path.expanduser
def authorized_key_file():
return os.path.join(os.path.expanduser("~"), ".ssh", "authorized_keys")
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ssh-import-id 5.5-0ubuntu1 [modified: usr/bin/ssh-import-id]
ProcVersionSignature: User Name 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Fri Apr 15 17:36:09 2016
Ec2AMI: ami-929f8cf8
Ec2AMIManifest: ubuntu-us-east-1/images-testing/hvm-instance/ubuntu-xenial-daily-amd64-server-20160412.manifest.xml
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: m3.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ssh-import-id
UpgradeStatus: No upgrade log present (probably fresh install) |
|
2018-03-27 18:30:40 |
Launchpad Janitor |
merge proposal linked |
|
https://code.launchpad.net/~smoser/ubuntu/+source/ssh-import-id/+git/ssh-import-id/+merge/342231 |
|
2018-03-27 18:32:03 |
Scott Moser |
ssh-import-id (Ubuntu Xenial): status |
New |
In Progress |
|
2018-03-27 18:32:06 |
Scott Moser |
ssh-import-id (Ubuntu Xenial): importance |
Undecided |
Low |
|
2018-03-27 18:32:09 |
Scott Moser |
ssh-import-id (Ubuntu Xenial): assignee |
|
Scott Moser (smoser) |
|
2018-04-02 05:29:05 |
touny |
ssh-import-id: status |
Fix Committed |
Confirmed |
|
2018-04-02 05:29:13 |
touny |
ssh-import-id: status |
Confirmed |
Incomplete |
|
2018-04-02 05:29:24 |
touny |
ssh-import-id: status |
Incomplete |
Fix Released |
|
2018-04-02 05:29:55 |
touny |
ssh-import-id (Ubuntu Xenial): status |
In Progress |
Fix Released |
|
2018-04-05 20:41:43 |
Brian Murray |
ssh-import-id (Ubuntu Xenial): status |
Fix Released |
Fix Committed |
|
2018-04-05 20:41:45 |
Brian Murray |
bug |
|
|
added subscriber Ubuntu Stable Release Updates Team |
2018-04-05 20:41:47 |
Brian Murray |
bug |
|
|
added subscriber SRU Verification |
2018-04-05 20:41:52 |
Brian Murray |
tags |
amd64 apport-bug bot-stop-nagging ec2-images xenial |
amd64 apport-bug bot-stop-nagging ec2-images verification-needed verification-needed-xenial xenial |
|
2018-04-09 20:11:57 |
Scott Moser |
tags |
amd64 apport-bug bot-stop-nagging ec2-images verification-needed verification-needed-xenial xenial |
amd64 apport-bug bot-stop-nagging ec2-images verification-failed-xeniall xenial |
|
2018-04-10 07:28:46 |
Jean-Baptiste Lallement |
tags |
amd64 apport-bug bot-stop-nagging ec2-images verification-failed-xeniall xenial |
amd64 apport-bug bot-stop-nagging ec2-images verification-failed-xenial xenial |
|
2018-05-17 01:57:27 |
Michael Hudson-Doyle |
nominated for series |
|
Ubuntu Bionic |
|
2018-05-17 01:57:27 |
Michael Hudson-Doyle |
bug task added |
|
ssh-import-id (Ubuntu Bionic) |
|
2018-05-17 19:31:02 |
Brian Murray |
ssh-import-id (Ubuntu Bionic): status |
New |
Fix Committed |
|
2018-05-17 19:31:08 |
Brian Murray |
tags |
amd64 apport-bug bot-stop-nagging ec2-images verification-failed-xenial xenial |
amd64 apport-bug bot-stop-nagging ec2-images verification-failed-xenial verification-needed verification-needed-bionic xenial |
|
2018-05-17 21:55:14 |
Michael Hudson-Doyle |
bug |
|
|
added subscriber Michael Hudson-Doyle |
2018-05-23 13:31:19 |
Scott Moser |
description |
=== Begin SRU Template ===
[Impact]
Running ssh-import-id without environment variable HOME set
will fail and print an error message like:
TypeError: join() argument must be str or bytes, not 'NoneType'
[Test Case]
$ name="my-x"
$ ud=$(printf '%s\n%s\n' '#!/bin/sh' 'ssh-import-id smoser')
$ lxc launch ubuntu-daily:xenial "$name" "--config=user.user-data=$ud"
To see failure, you can then just:
$ lxc exec "$name" -- cat /run/cloud-init/result.json
{
"v1": {
"datasource": "DataSourceHetzner",
"errors": [
"('scripts-user', RuntimeError('Runparts: 1 failures in 1 attempted commands',))"
]
}
}
$ lxc exec "$name" -- grep "ssh-import-id smoser" /root/.ssh/authorized_keys &&
echo GOOD || echo FAIL
[Regression Potential]
Regression is unlikely. The code only does anything if HOME is not present.
This has been in Artful and Bionic since 2016-09-16.
[Other Info]
Upstream merge proposal:
https://code.launchpad.net/~smoser/ssh-import-id/trunk.lp1570997/+merge/326692
=== End SRU Template ===
I've modified /usr/bin/ssh-import-id to show a stack trace rather than unhelpful message:
TypeError: join() argument must be str or bytes, not 'NoneType'
Then, running:
$ env -u HOME ssh-import-id smoser
Traceback (most recent call last):
File "/usr/bin/ssh-import-id", line 62, in <module>
main()
File "/usr/bin/ssh-import-id", line 45, in main
k = import_keys(proto, username, parser.options.useragent)
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 204, in import_keys
local_keys = key_list(read_keyfile())
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 135, in read_keyfile
output_file = parser.options.output or os.path.join(os.getenv("HOME"), ".ssh", "authorized_keys")
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
I came to find this by trying to launch an instance with:
$ ec2metadata --user-data
#!/bin/sh
exec >/my.log 2>&1
cat /proc/uptime
date -R
ssh-import-id smoser
The basic issue is that the environment that cloud-init runs in does not have HOME set.
I suggest using os.path.expanduser
def authorized_key_file():
return os.path.join(os.path.expanduser("~"), ".ssh", "authorized_keys")
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ssh-import-id 5.5-0ubuntu1 [modified: usr/bin/ssh-import-id]
ProcVersionSignature: User Name 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Fri Apr 15 17:36:09 2016
Ec2AMI: ami-929f8cf8
Ec2AMIManifest: ubuntu-us-east-1/images-testing/hvm-instance/ubuntu-xenial-daily-amd64-server-20160412.manifest.xml
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: m3.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ssh-import-id
UpgradeStatus: No upgrade log present (probably fresh install) |
=== Begin SRU Template ===
[Impact]
Running ssh-import-id without environment variable HOME set
will fail and print an error message like:
TypeError: join() argument must be str or bytes, not 'NoneType'
[Test Case]
$ name="my-x"
$ ud=$(printf '%s\n%s\n' '#!/bin/sh' 'ssh-import-id lp:smoser')
$ lxc launch ubuntu-daily:xenial "$name" "--config=user.user-data=$ud"
To see failure, you can then just:
$ lxc exec "$name" -- cat /run/cloud-init/result.json
{
"v1": {
"datasource": "DataSourceHetzner",
"errors": [
"('scripts-user', RuntimeError('Runparts: 1 failures in 1 attempted commands',))"
]
}
}
$ lxc exec "$name" -- grep "ssh-import-id smoser" /root/.ssh/authorized_keys &&
echo GOOD || echo FAIL
[Regression Potential]
Regression is unlikely. The code only does anything if HOME is not present.
This has been in Artful and Bionic since 2016-09-16.
[Other Info]
Upstream merge proposal:
https://code.launchpad.net/~smoser/ssh-import-id/trunk.lp1570997/+merge/326692
=== End SRU Template ===
I've modified /usr/bin/ssh-import-id to show a stack trace rather than unhelpful message:
TypeError: join() argument must be str or bytes, not 'NoneType'
Then, running:
$ env -u HOME ssh-import-id smoser
Traceback (most recent call last):
File "/usr/bin/ssh-import-id", line 62, in <module>
main()
File "/usr/bin/ssh-import-id", line 45, in main
k = import_keys(proto, username, parser.options.useragent)
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 204, in import_keys
local_keys = key_list(read_keyfile())
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 135, in read_keyfile
output_file = parser.options.output or os.path.join(os.getenv("HOME"), ".ssh", "authorized_keys")
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
I came to find this by trying to launch an instance with:
$ ec2metadata --user-data
#!/bin/sh
exec >/my.log 2>&1
cat /proc/uptime
date -R
ssh-import-id smoser
The basic issue is that the environment that cloud-init runs in does not have HOME set.
I suggest using os.path.expanduser
def authorized_key_file():
return os.path.join(os.path.expanduser("~"), ".ssh", "authorized_keys")
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ssh-import-id 5.5-0ubuntu1 [modified: usr/bin/ssh-import-id]
ProcVersionSignature: User Name 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Fri Apr 15 17:36:09 2016
Ec2AMI: ami-929f8cf8
Ec2AMIManifest: ubuntu-us-east-1/images-testing/hvm-instance/ubuntu-xenial-daily-amd64-server-20160412.manifest.xml
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: m3.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ssh-import-id
UpgradeStatus: No upgrade log present (probably fresh install) |
|
2018-05-23 13:32:08 |
Scott Moser |
description |
=== Begin SRU Template ===
[Impact]
Running ssh-import-id without environment variable HOME set
will fail and print an error message like:
TypeError: join() argument must be str or bytes, not 'NoneType'
[Test Case]
$ name="my-x"
$ ud=$(printf '%s\n%s\n' '#!/bin/sh' 'ssh-import-id lp:smoser')
$ lxc launch ubuntu-daily:xenial "$name" "--config=user.user-data=$ud"
To see failure, you can then just:
$ lxc exec "$name" -- cat /run/cloud-init/result.json
{
"v1": {
"datasource": "DataSourceHetzner",
"errors": [
"('scripts-user', RuntimeError('Runparts: 1 failures in 1 attempted commands',))"
]
}
}
$ lxc exec "$name" -- grep "ssh-import-id smoser" /root/.ssh/authorized_keys &&
echo GOOD || echo FAIL
[Regression Potential]
Regression is unlikely. The code only does anything if HOME is not present.
This has been in Artful and Bionic since 2016-09-16.
[Other Info]
Upstream merge proposal:
https://code.launchpad.net/~smoser/ssh-import-id/trunk.lp1570997/+merge/326692
=== End SRU Template ===
I've modified /usr/bin/ssh-import-id to show a stack trace rather than unhelpful message:
TypeError: join() argument must be str or bytes, not 'NoneType'
Then, running:
$ env -u HOME ssh-import-id smoser
Traceback (most recent call last):
File "/usr/bin/ssh-import-id", line 62, in <module>
main()
File "/usr/bin/ssh-import-id", line 45, in main
k = import_keys(proto, username, parser.options.useragent)
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 204, in import_keys
local_keys = key_list(read_keyfile())
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 135, in read_keyfile
output_file = parser.options.output or os.path.join(os.getenv("HOME"), ".ssh", "authorized_keys")
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
I came to find this by trying to launch an instance with:
$ ec2metadata --user-data
#!/bin/sh
exec >/my.log 2>&1
cat /proc/uptime
date -R
ssh-import-id smoser
The basic issue is that the environment that cloud-init runs in does not have HOME set.
I suggest using os.path.expanduser
def authorized_key_file():
return os.path.join(os.path.expanduser("~"), ".ssh", "authorized_keys")
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ssh-import-id 5.5-0ubuntu1 [modified: usr/bin/ssh-import-id]
ProcVersionSignature: User Name 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Fri Apr 15 17:36:09 2016
Ec2AMI: ami-929f8cf8
Ec2AMIManifest: ubuntu-us-east-1/images-testing/hvm-instance/ubuntu-xenial-daily-amd64-server-20160412.manifest.xml
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: m3.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ssh-import-id
UpgradeStatus: No upgrade log present (probably fresh install) |
=== Begin SRU Template ===
[Impact]
Running ssh-import-id without environment variable HOME set
will fail and print an error message like:
TypeError: join() argument must be str or bytes, not 'NoneType'
[Test Case]
$ name="my-x"
$ ud=$(printf '%s\n%s\n' '#!/bin/sh' 'ssh-import-id smoser')
$ lxc launch ubuntu-daily:xenial "$name" "--config=user.user-data=$ud"
To see failure, you can then just:
$ lxc exec "$name" -- cat /run/cloud-init/result.json
{
"v1": {
"datasource": "DataSourceHetzner",
"errors": [
"('scripts-user', RuntimeError('Runparts: 1 failures in 1 attempted commands',))"
]
}
}
$ lxc exec "$name" -- grep "ssh-import-id lp:smoser" /root/.ssh/authorized_keys &&
echo GOOD || echo FAIL
[Regression Potential]
Regression is unlikely. The code only does anything if HOME is not present.
This has been in Artful and Bionic since 2016-09-16.
[Other Info]
Upstream merge proposal:
https://code.launchpad.net/~smoser/ssh-import-id/trunk.lp1570997/+merge/326692
=== End SRU Template ===
I've modified /usr/bin/ssh-import-id to show a stack trace rather than unhelpful message:
TypeError: join() argument must be str or bytes, not 'NoneType'
Then, running:
$ env -u HOME ssh-import-id smoser
Traceback (most recent call last):
File "/usr/bin/ssh-import-id", line 62, in <module>
main()
File "/usr/bin/ssh-import-id", line 45, in main
k = import_keys(proto, username, parser.options.useragent)
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 204, in import_keys
local_keys = key_list(read_keyfile())
File "/usr/lib/python3/dist-packages/ssh_import_id/__init__.py", line 135, in read_keyfile
output_file = parser.options.output or os.path.join(os.getenv("HOME"), ".ssh", "authorized_keys")
File "/usr/lib/python3.5/posixpath.py", line 89, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
I came to find this by trying to launch an instance with:
$ ec2metadata --user-data
#!/bin/sh
exec >/my.log 2>&1
cat /proc/uptime
date -R
ssh-import-id smoser
The basic issue is that the environment that cloud-init runs in does not have HOME set.
I suggest using os.path.expanduser
def authorized_key_file():
return os.path.join(os.path.expanduser("~"), ".ssh", "authorized_keys")
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ssh-import-id 5.5-0ubuntu1 [modified: usr/bin/ssh-import-id]
ProcVersionSignature: User Name 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Fri Apr 15 17:36:09 2016
Ec2AMI: ami-929f8cf8
Ec2AMIManifest: ubuntu-us-east-1/images-testing/hvm-instance/ubuntu-xenial-daily-amd64-server-20160412.manifest.xml
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: m3.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ssh-import-id
UpgradeStatus: No upgrade log present (probably fresh install) |
|
2018-05-23 13:40:54 |
Scott Moser |
ssh-import-id (Ubuntu Xenial): status |
Fix Committed |
Triaged |
|
2018-05-23 13:42:40 |
Scott Moser |
tags |
amd64 apport-bug bot-stop-nagging ec2-images verification-failed-xenial verification-needed verification-needed-bionic xenial |
amd64 apport-bug bot-stop-nagging ec2-images verification-done verification-done-bionic |
|
2018-05-23 13:43:13 |
Scott Moser |
attachment added |
|
verification log for bionic https://bugs.launchpad.net/ubuntu/+source/ssh-import-id/+bug/1570997/+attachment/5143292/+files/verify-bionic.txt |
|
2018-05-24 23:27:31 |
Launchpad Janitor |
ssh-import-id (Ubuntu Bionic): status |
Fix Committed |
Fix Released |
|
2018-05-24 23:27:38 |
Brian Murray |
removed subscriber Ubuntu Stable Release Updates Team |
|
|
|
2023-05-11 08:58:48 |
Christian Ehrhardt |
ssh-import-id (Ubuntu Xenial): status |
Triaged |
Won't Fix |
|
2023-05-11 08:58:50 |
Christian Ehrhardt |
ssh-import-id (Ubuntu Xenial): assignee |
Scott Moser (smoser) |
|
|
2023-05-11 08:58:52 |
Christian Ehrhardt |
ssh-import-id (Ubuntu): assignee |
Dustin Kirkland (kirkland) |
|
|
2023-05-11 08:58:54 |
Christian Ehrhardt |
ssh-import-id: assignee |
Dustin Kirkland (kirkland) |
|
|