Task Download daemonize archive - failed - [Errno 104] Connection reset by peer - Trellis at "Add `bin/xdebug-tunnel.sh` to manage Xdebug and SSH tunnels on remote hosts"

Update (several hours later). The problem immediately below the dollars signs on this initial post was resolved from the solution by @runofthemill.

But I have a new issue and I wanted to pull it up here to get more visibility.

Blowing the whole project away and doing vagrant destroy does not help either.

Here is the error I receive after running vagrant up from a fresh project using the tweaks suggested by @runofthemill.

TASK [geerlingguy.daemonize : Download daemonize archive.] *********************
System info:
  Ansible 2.0.2.0; Vagrant 1.8.7; Darwin
  Trellis at "Add `bin/xdebug-tunnel.sh` to manage Xdebug and SSH tunnels on remote hosts"
---------------------------------------------------
failed to create temporary content file: [Errno 104] Connection reset by peer
fatal: [default]: FAILED! => {"changed": false, "failed": true}

NO MORE HOSTS LEFT *************************************************************

$$$$$$$$$$$$$$$$$$$$$$

Original problem.

When I run vagrant up I am seeing this.

System info:
  Ansible 2.2.0.0; Vagrant 1.8.7; Darwin
  Trellis at "Disable wp-cron emails"
---------------------------------------------------
Error fetching key F1656F24C74CD1D8 from keyserver:
hkp://keyserver.ubuntu.com:80
gpg: requesting key C74CD1D8 from hkp server keyserver.ubuntu.com
gpg: no valid OpenPGP data found.
gpg: key C74CD1D8: no valid user IDs
gpg: this may be caused by a missing self-signature
gpg: Total number processed: 1
gpg:           w/o user IDs: 1

fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv F1656F24C74CD1D8", "failed": true, "rc": 2, "stdout": "Executing: /tmp/tmp.soGYuqyxhO/gpg.1.sh --keyserver\nhkp://keyserver.ubuntu.com:80\n--recv\nF1656F24C74CD1D8\n?: [fd 4]: read error: Connection reset by peer\ngpgkeys: key F1656F24C74CD1D8 partially retrieved (probably corrupt)\n", "stdout_lines": ["Executing: /tmp/tmp.soGYuqyxhO/gpg.1.sh --keyserver", "hkp://keyserver.ubuntu.com:80", "--recv", "F1656F24C74CD1D8", "?: [fd 4]: read error: Connection reset by peer", "gpgkeys: key F1656F24C74CD1D8 partially retrieved (probably corrupt)"]}

I know about the following thread and I tried what the final poster said worked for them. Does not work for me: Vagrant up error getting key id from url

Anyone have any ideas about this?

Not exactly sure the issue/solution, but we do have some updates coming for MariaDB: https://github.com/roots/trellis/pull/659

1 Like

Thanks for the heads up.

I took what was in the PR and replaced what needed replacing. Some progress as I’m getting a new error now. Hmmmm.

TASK [mariadb : Add MariaDB MySQL apt-key] *************************************
System info:
  Ansible 2.2.0.0; Vagrant 1.8.7; Darwin
  Trellis at "Disable wp-cron emails"
---------------------------------------------------
error getting key id from url: http://keyserver.ubuntu.com/pks/lookup?op=get&
fingerprint=on&search=0xF1656F24C74CD1D8
fatal: [default]: FAILED! => {"changed": false, "failed": true, "traceback": "Traceback (most recent call last):\n  File \"/tmp/ansible_VjbDCc/ansible_module_apt_key.py\", line 209, in download_key\n    return rsp.read()\n  File \"/usr/lib/python2.7/socket.py\", line 355, in read\n    data = self._sock.recv(rbufsize)\n  File \"/usr/lib/python2.7/httplib.py\", line 612, in read\n    s = self.fp.read(amt)\n  File \"/usr/lib/python2.7/socket.py\", line 384, in read\n    data = self._sock.recv(left)\nerror: [Errno 104] Connection reset by peer\n"}

Any other thoughts?

Try again? :slight_smile: Error message is just a connection issue. Might be temporary.

The site http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0xF1656F24C74CD1D8 works for me.

2 Likes

If you keep getting that error, try removing the first two tasks in roles/mariadb/tasks/main.yml (existing file, not the one from the PR):

- name: Add MariaDB MySQL apt-key
  apt_key:
    url: "http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search={{ mariadb_keyserver_fingerprint }}"
    state: present


- name: Add MariaDB MySQL deb and deb-src
  apt_repository:
    repo: "{{ item }}"
    state: present
  with_items:
    - "deb http://{{ mariadb_mirror }}/mariadb/repo/{{ mariadb_version }}/ubuntu {{ mariadb_dist | default(ansible_distribution_release) }} main"
    - "deb-src http://{{ mariadb_mirror }}/mariadb/repo/{{ mariadb_version }}/ubuntu {{ mariadb_dist | default(ansible_distribution_release) }} main"

Since it’s included in the Ubuntu repository, those aren’t needed :slight_smile:

1 Like

@swalkinshaw did try again to no avail.

Even vagrant destroy and blew the whole directory away and recloned everything. Multiple times. Was still getting the same error.

@runofthemill thanks for that I removed them and that did help it seems. But I’m getting another error now.

TASK [geerlingguy.daemonize : Download daemonize archive.] *********************
System info:
  Ansible 2.2.0.0; Vagrant 1.8.7; Darwin
  Trellis at "Add `bin/xdebug-tunnel.sh` to manage Xdebug and SSH tunnels on remote hosts"
---------------------------------------------------
failed to create temporary content file: [Errno 104] Connection reset by peer
fatal: [default]: FAILED! => {"changed": false, "failed": true}

This was similar to the error I was receiving before after pulling in that pull request referenced above. It was xdebug-tunnel.sh causing me issues and now it continues to.

Digging into it now.

PS Thank both of you for the all the help so far.

1 Like

I’m not sure if this is related, but maybe try downgrading to Ansible 2.0.2.0?

You can also run all vagrant commands with logging enabled via the command line:
$ VAGRANT_LOG=info vagrant up

Might give you some useful info…

1 Like

Occasionally I run into connection troubles after many failed playbooks, like your msg Connection reset by peer. I sometimes suspect my IP is bumping up against rate-limits.

Maybe it’s just confirmation bias, but if I then turn on a VPN in order to use a different IP, my connections typically start working again. The VPN appears to give me a new IP and a fresh identity with external services, enabling me to skirt around rate-limits instead of having to wait a while.

Or just try again after a few minutes or hours and rate-limit restrictions may have lifted for your IP.

2 Likes

Just to report back: tried those and still having the issue. The extra debug information didn’t output any additional details from the above.

Good to know. Will try later. Thanks!

I tried it much later and on a different IP to no avail. Thanks for the suggestion though!

1 Like

I updated my first post because the problem has actually changed (as well as changed the title earlier to reflect that new problem).

If anyone has any pointers it’s much appreciated.

All my googlefu is failing and I’m coming up empty handed.

@brettwise Given that it is failing on the geerlingguy.daemonize role, which was recently updated in roots/trellis#681, could you reinstall your galaxy roles to ensure you have the specified versions?

# reinstall galaxy roles
ansible-galaxy install --force -r requirements.yml

# rebuild vagrant vm
vagrant destroy -f && vagrant up
1 Like

It worked :sob::joy:!

You da real MVP @fullyint. Thanks for coming back around!

After I made sure that my local Ansible install was 2.2 and then executed the commands as you said and it worked.

And thanks to the rest of you that chimed in and helped get me there as well!

2 Likes