Install script fails on Debian 9 [2019-07-29]

Dear colleagues,

we have just observed the following error on a vanilla Debian 9 amd64:


$ sudo python --production


fatal: [localhost]: FAILED! => {
	"changed": false,
	"cmd": "/usr/bin/apt-key adv --no-tty --keyserver hkp:// --recv F1656F24C74CD1D8",
	"invocation": {
		"module_args": {
			"data": null,
			"file": null,
			"id": "0xF1656F24C74CD1D8",
			"key": null,
			"keyring": null,
			"keyserver": "hkp://",
			"state": "present",
			"url": null,
			"validate_certs": true
	"msg": "Error fetching key F1656F24C74CD1D8 from keyserver: hkp://",
	"rc": 2,
	"stderr": "Warning: apt-key output should not be parsed (stdout is not a terminal)\ngpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory\ngpg: connecting dirmngr at '/tmp/apt-key-gpghome.vbja1ifX81/S.dirmngr' failed: No such file or directory\ngpg: keyserver receive failed: No dirmngr\n",
	"stderr_lines": [
		"Warning: apt-key output should not be parsed (stdout is not a terminal)",
		"gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory",
		"gpg: connecting dirmngr at '/tmp/apt-key-gpghome.vbja1ifX81/S.dirmngr' failed: No such file or directory",
		"gpg: keyserver receive failed: No dirmngr"
	"stdout": "Executing: /tmp/apt-key-gpghome.vbja1ifX81/ --no-tty --keyserver hkp:// --recv F1656F24C74CD1D8\n",
	"stdout_lines": [
		"Executing: /tmp/apt-key-gpghome.vbja1ifX81/ --no-tty --keyserver hkp:// --recv F1656F24C74CD1D8"

Traceback (most recent call last):
  File "", line 413, in <module>
  File "", line 135, in install_bench
	run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "", line 327, in run_playbook
	success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/", line 186, in check_call
	raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-vvvv', 
'-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

Anyone else with the same issue?

1 Like

sudo apt install dirmngr -y


Thanks @trentmu, this resolved the issue.

Had a second issue

Traceback (most recent call last):",
		  File \"/usr/local/bin/bench\", line 11, in <module>
			load_entry_point('bench', 'console_scripts', 'bench')()
		  File \"/home/frappe/.bench/bench/\", line 40, in cli
		  File \"/usr/local/lib/python3.5/dist-packages/click/\", line 764, in __call__
			return self.main(*args, **kwargs)
		  File \"/usr/local/lib/python3.5/dist-packages/click/\", line 696, in main
		  File \"/usr/local/lib/python3.5/dist-packages/click/\", line 124, in _verify_python3_env
			' mitigation steps.' + extra
		RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult for mitigation steps.
		This system supports the C.UTF-8 locale which is recommended.
		You might be able to resolve your issue by exporting the
		following environment variables:
		   export LC_ALL=C.UTF-8
		   export LANG=C.UTF-8

This actually resolved as it says with (not using sudo)

$ export LC_ALL=C.UTF-8
$ export LANG=C.UTF-8

Now it works like a charm!

1 Like

Do the export commands

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

need to be added to .bashrc for the user, or does it work fine from a once-off perspective?

Worked once-off…

:+1: Thank you!

I feel stuff like this should be included in the install script. Unnecessary error.

Agreed. Created a Pull Request: