Question

Problem when provisioning with Chef, but also with dpkg

Posted September 22, 2014 8.2k views

I’m new to Chef, but from what I can tell this has to do with dpkg. Any thoughts?

Running handlers:
[2014-09-22T15:50:26-04:00] ERROR: Running exception handlers
Running handlers complete
[2014-09-22T15:50:26-04:00] ERROR: Exception handlers complete
[2014-09-22T15:50:26-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 1 resources updated in 32.856243327 seconds
[2014-09-22T15:50:26-04:00] ERROR: package[nginx] (nginx::default line 10) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y install nginx=1.4.6-1ubuntu3.1 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  fontconfig-config libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8
  libtiff5 libvpx1 libxpm4 libxslt1.1 nginx-common nginx-core
Suggested packages:
  libgd-tools fcgiwrap nginx-doc
The following NEW packages will be installed:
  fontconfig-config libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8
  libtiff5 libvpx1 libxpm4 libxslt1.1 nginx nginx-common nginx-core
0 upgraded, 13 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2,703 kB of archives.
After this operation, 6,088 kB of additional disk space will be used.
Selecting previously unselected package fontconfig-config.
(Reading database ... 140901 files and directories currently installed.)
Preparing to unpack .../fontconfig-config_2.11.0-0ubuntu4.1_all.deb ...
STDERR: debconf: apt-extracttemplates failed: No such file or directory
dpkg: unrecoverable fatal error, aborting:
 fork failed: Cannot allocate memory
E: Sub-process /usr/bin/dpkg returned an error code (2)
---- End output of apt-get -q -y install nginx=1.4.6-1ubuntu3.1 ----
Ran apt-get -q -y install nginx=1.4.6-1ubuntu3.1 returned 100
[2014-09-22T15:50:26-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

That’s very strange… Does the file /usr/bin/apt-extracttemplates exist on the the system?

$ dpkg -S  /usr/bin/apt-extracttemplates
apt-utils: /usr/bin/apt-extracttemplates

It should be available on most systems as the apt-utils package is a dependency of ubuntu-minimal

  • the file did not exist, so I did

     dpkg -S  /usr/bin/apt-extracttemplates
    

    …more after log

    Starting Chef Client, version 11.16.2
    resolving cookbooks for run list: ["nginx"]
    Synchronizing Cookbooks:
      - apt
      - nginx
    Compiling Cookbooks...
    Converging 4 resources
    Recipe: apt::default
      * execute[apt-get update] action run
    
        ================================================================================
        Error executing action `run` on resource 'execute[apt-get update]'
        ================================================================================
    
        Mixlib::ShellOut::ShellCommandFailed
        ------------------------------------
        Expected process to exit with [0], but received '100'
        ---- Begin output of apt-get update ----
        STDOUT: Ign http://mirrors.digitalocean.com trusty InRelease
        Ign http://mirrors.digitalocean.com trusty-updates InRelease
        Ign http://mirrors.digitalocean.com trusty-backports InRelease
        Hit http://mirrors.digitalocean.com trusty Release.gpg
        Hit http://mirrors.digitalocean.com trusty-updates Release.gpg
        Hit http://mirrors.digitalocean.com trusty-backports Release.gpg
        Hit http://mirrors.digitalocean.com trusty Release
        Hit http://mirrors.digitalocean.com trusty-updates Release
        Hit http://mirrors.digitalocean.com trusty-backports Release
        Ign http://get.docker.io docker InRelease
        Hit http://mirrors.digitalocean.com trusty/main Sources
        Hit http://mirrors.digitalocean.com trusty/restricted Sources
        Hit http://mirrors.digitalocean.com trusty/universe Sources
        Hit http://mirrors.digitalocean.com trusty/multiverse Sources
        Hit http://mirrors.digitalocean.com trusty/main amd64 Packages
        Hit http://mirrors.digitalocean.com trusty/restricted amd64 Packages
        Hit http://mirrors.digitalocean.com trusty/universe amd64 Packages
        Hit http://mirrors.digitalocean.com trusty/multiverse amd64 Packages
        Hit http://mirrors.digitalocean.com trusty/main i386 Packages
        Hit http://mirrors.digitalocean.com trusty/restricted i386 Packages
        Hit http://mirrors.digitalocean.com trusty/universe i386 Packages
        Hit http://mirrors.digitalocean.com trusty/multiverse i386 Packages
        Hit http://mirrors.digitalocean.com trusty/main Translation-en
        Hit http://mirrors.digitalocean.com trusty/multiverse Translation-en
        Hit http://mirrors.digitalocean.com trusty/restricted Translation-en
        Hit http://mirrors.digitalocean.com trusty/universe Translation-en
        Hit http://mirrors.digitalocean.com trusty-updates/main Sources
        Hit http://mirrors.digitalocean.com trusty-updates/restricted Sources
        Hit http://mirrors.digitalocean.com trusty-updates/universe Sources
        Hit http://mirrors.digitalocean.com trusty-updates/multiverse Sources
        Hit http://mirrors.digitalocean.com trusty-updates/main amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-updates/restricted amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-updates/universe amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-updates/multiverse amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-updates/main i386 Packages
        Hit http://mirrors.digitalocean.com trusty-updates/restricted i386 Packages
        Hit http://mirrors.digitalocean.com trusty-updates/universe i386 Packages
        Hit http://get.docker.io docker Release.gpg
        Hit http://get.docker.io docker Release
        Hit http://mirrors.digitalocean.com trusty-updates/multiverse i386 Packages
        Hit http://mirrors.digitalocean.com trusty-updates/main Translation-en
        Hit http://mirrors.digitalocean.com trusty-updates/multiverse Translation-en
        Hit http://mirrors.digitalocean.com trusty-updates/restricted Translation-en
        Hit http://mirrors.digitalocean.com trusty-updates/universe Translation-en
        Hit http://mirrors.digitalocean.com trusty-backports/main Sources
        Hit http://mirrors.digitalocean.com trusty-backports/restricted Sources
        Hit http://mirrors.digitalocean.com trusty-backports/universe Sources
        Hit http://mirrors.digitalocean.com trusty-backports/multiverse Sources
        Hit http://mirrors.digitalocean.com trusty-backports/main amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/restricted amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/universe amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/multiverse amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/main i386 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/restricted i386 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/universe i386 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/multiverse i386 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/main Translation-en
        Hit http://get.docker.io docker/main amd64 Packages
        Hit http://mirrors.digitalocean.com trusty-backports/multiverse Translation-en
        Hit http://mirrors.digitalocean.com trusty-backports/restricted Translation-en
        Hit http://mirrors.digitalocean.com trusty-backports/universe Translation-en
        Hit http://get.docker.io docker/main i386 Packages
        Ign http://security.ubuntu.com trusty-security InRelease
        Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
        Ign http://get.docker.io docker/main Translation-en
        Get:2 http://security.ubuntu.com trusty-security Release [59.7 kB]
        Get:3 http://security.ubuntu.com trusty-security/main Sources [44.9 kB]
        Get:4 http://security.ubuntu.com trusty-security/restricted Sources [14 B]
        Get:5 http://security.ubuntu.com trusty-security/universe Sources [10.8 kB]
        Get:6 http://security.ubuntu.com trusty-security/multiverse Sources [700 B]
        Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [141 kB]
        Get:8 http://security.ubuntu.com trusty-security/restricted amd64 Packages [14 B]
        Get:9 http://security.ubuntu.com trusty-security/universe amd64 Packages [48.4 kB]
        Get:10 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [1148 B]
        Get:11 http://security.ubuntu.com trusty-security/main i386 Packages [135 kB]
        Get:12 http://security.ubuntu.com trusty-security/restricted i386 Packages [14 B]
        Get:13 http://security.ubuntu.com trusty-security/universe i386 Packages [48.4 kB]
        Get:14 http://security.ubuntu.com trusty-security/multiverse i386 Packages [1398 B]
        Hit http://security.ubuntu.com trusty-security/main Translation-en
        Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
        Hit http://security.ubuntu.com trusty-security/restricted Translation-en
        Hit http://security.ubuntu.com trusty-security/universe Translation-en
        Fetched 493 kB in 4s (114 kB/s)
        STDERR: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
        ---- End output of apt-get update ----
        Ran apt-get update returned 100
    
        Resource Declaration:
        ---------------------
        # In /var/chef/cache/cookbooks/apt/recipes/default.rb
    
         10: execute "apt-get update" do
         11:   command "apt-get update"
         12: end
    
        Compiled Resource:
        ------------------
        # Declared in /var/chef/cache/cookbooks/apt/recipes/default.rb:10:in `from_file'
    
        execute("apt-get update") do
          action "run"
          retries 0
          retry_delay 2
          guard_interpreter :default
          command "apt-get update"
          backup 5
          returns 0
          cookbook_name "apt"
          recipe_name "default"
        end
    
    
    Running handlers:
    [2014-09-22T16:01:06-04:00] ERROR: Running exception handlers
    Running handlers complete
    [2014-09-22T16:01:06-04:00] ERROR: Exception handlers complete
    [2014-09-22T16:01:06-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
    Chef Client failed. 0 resources updated in 8.443425098 seconds
    [2014-09-22T16:01:06-04:00] ERROR: execute[apt-get update] (apt::default line 10) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
    ---- Begin output of apt-get update ----
    STDOUT: Ign http://mirrors.digitalocean.com trusty InRelease
    Ign http://mirrors.digitalocean.com trusty-updates InRelease
    Ign http://mirrors.digitalocean.com trusty-backports InRelease
    Hit http://mirrors.digitalocean.com trusty Release.gpg
    Hit http://mirrors.digitalocean.com trusty-updates Release.gpg
    Hit http://mirrors.digitalocean.com trusty-backports Release.gpg
    Hit http://mirrors.digitalocean.com trusty Release
    Hit http://mirrors.digitalocean.com trusty-updates Release
    Hit http://mirrors.digitalocean.com trusty-backports Release
    Ign http://get.docker.io docker InRelease
    Hit http://mirrors.digitalocean.com trusty/main Sources
    Hit http://mirrors.digitalocean.com trusty/restricted Sources
    Hit http://mirrors.digitalocean.com trusty/universe Sources
    Hit http://mirrors.digitalocean.com trusty/multiverse Sources
    Hit http://mirrors.digitalocean.com trusty/main amd64 Packages
    Hit http://mirrors.digitalocean.com trusty/restricted amd64 Packages
    Hit http://mirrors.digitalocean.com trusty/universe amd64 Packages
    Hit http://mirrors.digitalocean.com trusty/multiverse amd64 Packages
    Hit http://mirrors.digitalocean.com trusty/main i386 Packages
    Hit http://mirrors.digitalocean.com trusty/restricted i386 Packages
    Hit http://mirrors.digitalocean.com trusty/universe i386 Packages
    Hit http://mirrors.digitalocean.com trusty/multiverse i386 Packages
    Hit http://mirrors.digitalocean.com trusty/main Translation-en
    Hit http://mirrors.digitalocean.com trusty/multiverse Translation-en
    Hit http://mirrors.digitalocean.com trusty/restricted Translation-en
    Hit http://mirrors.digitalocean.com trusty/universe Translation-en
    Hit http://mirrors.digitalocean.com trusty-updates/main Sources
    Hit http://mirrors.digitalocean.com trusty-updates/restricted Sources
    Hit http://mirrors.digitalocean.com trusty-updates/universe Sources
    Hit http://mirrors.digitalocean.com trusty-updates/multiverse Sources
    Hit http://mirrors.digitalocean.com trusty-updates/main amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-updates/restricted amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-updates/universe amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-updates/multiverse amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-updates/main i386 Packages
    Hit http://mirrors.digitalocean.com trusty-updates/restricted i386 Packages
    Hit http://mirrors.digitalocean.com trusty-updates/universe i386 Packages
    Hit http://get.docker.io docker Release.gpg
    Hit http://get.docker.io docker Release
    Hit http://mirrors.digitalocean.com trusty-updates/multiverse i386 Packages
    Hit http://mirrors.digitalocean.com trusty-updates/main Translation-en
    Hit http://mirrors.digitalocean.com trusty-updates/multiverse Translation-en
    Hit http://mirrors.digitalocean.com trusty-updates/restricted Translation-en
    Hit http://mirrors.digitalocean.com trusty-updates/universe Translation-en
    Hit http://mirrors.digitalocean.com trusty-backports/main Sources
    Hit http://mirrors.digitalocean.com trusty-backports/restricted Sources
    Hit http://mirrors.digitalocean.com trusty-backports/universe Sources
    Hit http://mirrors.digitalocean.com trusty-backports/multiverse Sources
    Hit http://mirrors.digitalocean.com trusty-backports/main amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/restricted amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/universe amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/multiverse amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/main i386 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/restricted i386 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/universe i386 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/multiverse i386 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/main Translation-en
    Hit http://get.docker.io docker/main amd64 Packages
    Hit http://mirrors.digitalocean.com trusty-backports/multiverse Translation-en
    Hit http://mirrors.digitalocean.com trusty-backports/restricted Translation-en
    Hit http://mirrors.digitalocean.com trusty-backports/universe Translation-en
    Hit http://get.docker.io docker/main i386 Packages
    Ign http://security.ubuntu.com trusty-security InRelease
    Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
    Ign http://get.docker.io docker/main Translation-en
    Get:2 http://security.ubuntu.com trusty-security Release [59.7 kB]
    Get:3 http://security.ubuntu.com trusty-security/main Sources [44.9 kB]
    Get:4 http://security.ubuntu.com trusty-security/restricted Sources [14 B]
    Get:5 http://security.ubuntu.com trusty-security/universe Sources [10.8 kB]
    Get:6 http://security.ubuntu.com trusty-security/multiverse Sources [700 B]
    Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [141 kB]
    Get:8 http://security.ubuntu.com trusty-security/restricted amd64 Packages [14 B]
    Get:9 http://security.ubuntu.com trusty-security/universe amd64 Packages [48.4 kB]
    Get:10 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [1148 B]
    Get:11 http://security.ubuntu.com trusty-security/main i386 Packages [135 kB]
    Get:12 http://security.ubuntu.com trusty-security/restricted i386 Packages [14 B]
    Get:13 http://security.ubuntu.com trusty-security/universe i386 Packages [48.4 kB]
    Get:14 http://security.ubuntu.com trusty-security/multiverse i386 Packages [1398 B]
    Hit http://security.ubuntu.com trusty-security/main Translation-en
    Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
    Hit http://security.ubuntu.com trusty-security/restricted Translation-en
    Hit http://security.ubuntu.com trusty-security/universe Translation-en
    Fetched 493 kB in 4s (114 kB/s)
    STDERR: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
    ---- End output of apt-get update ----
    Ran apt-get update returned 100
    [2014-09-22T16:01:06-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
    

    So then I did:

    sudo dpkg --configure -a
    
    

    And once again:

    unning handlers:
    [2014-09-22T16:03:13-04:00] ERROR: Running exception handlers
    Running handlers complete
    [2014-09-22T16:03:13-04:00] ERROR: Exception handlers complete
    [2014-09-22T16:03:13-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
    Chef Client failed. 1 resources updated in 20.844821637 seconds
    [2014-09-22T16:03:13-04:00] ERROR: package[nginx] (nginx::default line 10) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
    ---- Begin output of apt-get -q -y install nginx=1.4.6-1ubuntu3.1 ----
    STDOUT: Reading package lists...
    Building dependency tree...
    Reading state information...
    The following extra packages will be installed:
      fontconfig-config libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8
      libtiff5 libvpx1 libxpm4 libxslt1.1 nginx-common nginx-core
    Suggested packages:
      libgd-tools fcgiwrap nginx-doc
    The following NEW packages will be installed:
      libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx1
      libxpm4 libxslt1.1 nginx nginx-common nginx-core
    The following packages will be upgraded:
      fontconfig-config
    1 upgraded, 12 newly installed, 0 to remove and 3 not upgraded.
    2 not fully installed or removed.
    Need to get 0 B/2,703 kB of archives.
    After this operation, 5,725 kB of additional disk space will be used.
    (Reading database ... 140901 files and directories currently installed.)
    Preparing to unpack .../fontconfig-config_2.11.0-0ubuntu4.1_all.deb ...
    STDERR: debconf: apt-extracttemplates failed: No such file or directory
    dpkg: unrecoverable fatal error, aborting:
     fork failed: Cannot allocate memory
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    ---- End output of apt-get -q -y install nginx=1.4.6-1ubuntu3.1 ----
    Ran apt-get -q -y install nginx=1.4.6-1ubuntu3.1 returned 100
    [2014-09-22T16:03:13-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
    

    I’m at a loss.

  • dpkg -S just shows what package the file belongs to, in this case apt-utils Though it looks like you might be caught in a bit of a loop here. Try removing the package that didn’t cleanly install first, then install apt-utils

    sudo apt-get remove --purge fontconfig-config
    sudo dpkg --configure -a
    sudo apt-get install apt-utils
    
  • Well here’s another loop:

    I do:

     sudo apt-get remove --purge fontconfig-config
    sudo dpkg --configure -a
    sudo apt-get install apt-utils
    

    Then I get the error:

     pkg: error processing package fonts-dejavu-core (--configure):
     package fonts-dejavu-core is not ready for configuration
     cannot configure (current status `half-installed') 
     Errors were encountered while processing:
     fonts-dejavu-core
     E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    and then the process starts over again. I’m thinking I should just start a new server at this point.

  • If it was a fresh server, that might be the best idea. The other option is to keep adding packages to that list to uninstall until you’ve gone through the whole dependency chain.

  • thanks for the help, I’m going to start fresh.

  • Well I started over again, now I’m getting this error:

    STDERR: dpkg-deb (subprocess): decompressing archive member: lzma error: Cannot allocate memory
    dpkg-deb: error: subprocess <decompress> returned error exit status 2
    dpkg: error processing archive /var/cache/apt/archives/fonts-dejavu-core_2.34-1ubuntu1_all.deb (--unpack):
     subprocess dpkg-deb --fsys-tarfile returned error exit status 2
    No apport report written because the error message indicates an issue on the local system
    Errors were encountered while processing:
     /var/cache/apt/archives/fonts-dejavu-core_2.34-1ubuntu1_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    ---- End output of apt-get -q -y install nginx=1.4.6-1ubuntu3.1 ----
    Ran apt-get -q -y install nginx=1.4.6-1ubuntu3.1 returned 100
    [2014-09-23T16:57:18-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
    

    Any ideas?

Submit an Answer