Save 36% for Black Friday! Learn more

Bob Bannister


10 Experience
0 Lessons Completed
0 Questions Solved


Posted in Using Vagrant for Rails Development Discussion

I too have battled with this for ages, using vagrant et al on Ubuntu 17.10. Kept getting the "too many children" error. I discovered that many thought the problem was with "archive-tar-minitar" gem, which used to be true but has been fixed by giving Vagrant a new dependency on "minitar" instead - see here.  So that line of research proved fruitless, however, inspired by Chris' debugging adventures, I dug deeper. The error message located the problem at ~/.vagrant.d/gems/2.3.3/gems/librarian-chef-nochef-0.2.0/lib/librarian/chef/source/site.rb:309. So I had a look and found the following:
303             # Cookbook files, as pulled from Opscode Community Site API, are
304             # embedded in a subdirectory of the tarball. If created by git archive they
305             # can include the subfolder `pax_global_header`, which is ignored.
306             subtemps = temp.children
307             subtemps.empty? and raise "The package archive was empty!"
308             subtemps.delete_if{|pth| pth.to_s[/pax_global_header/]}
309             subtemps.size > 1 and raise "The package archive has too many children!"

I tracked down the first package to fail (system) and examined the value of subtemps to find that there was a second child subdirectory, but its name did not match the 'pax_global_header' string. It was 'PaxHeader'.
I added in a line to delete that..
308             subtemps.delete_if{|pth| pth.to_s[/pax_global_header/]}
309(new)        subtemps.delete_if{|pth| pth.to_s[/PaxHeader/]}
... and Hey Presto! the 'vagrant up' command now completes and we are up and running.

Ah! WAIT... that's not quite true. So much junk lying around from previous attempts that it masked the error in my thinking. PaxHeader may seem to be something useful, so a re-think is required. I'll update you all when I unravel it :)
logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.