geerlingguy / drupal-vm

A VM for Drupal development
https://www.drupalvm.com/
MIT License
1.37k stars 645 forks source link

Postfix install error #310

Closed kostajh closed 9 years ago

kostajh commented 9 years ago

Possibly related to #216. When I run vagrant reload --provision, I get this error:

TASK: [geerlingguy.postfix | Ensure postfix is installed (Debian).] *********** 
failed: [drupalvm] => {"failed": true}
stderr: E: There are problems and -y was used without --force-yes

stdout: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  libyaml-0-2 python-crypto python-httplib2 python-jinja2 python-markupsafe
  python-paramiko python-pkg-resources python-support python-yaml sshpass
Use 'apt-get autoremove' to remove them.
Suggested packages:
  procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre sasl2-bin
  dovecot-common postfix-cdb mail-reader postfix-doc
The following packages will be REMOVED:
  ssmtp
The following NEW packages will be installed:
  postfix
0 upgraded, 1 newly installed, 1 to remove and 106 not upgraded.
Need to get 0 B/1084 kB of archives.
After this operation, 3600 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  postfix

msg: '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"   install 'postfix'' failed: E: There are problems and -y was used without --force-yes

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/kosta/playbook.retry

drupalvm                   : ok=12   changed=1    unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

To fix, I need to ssh into the Drupal VM, run sudo apt-get install postfix --force-yes -y

geerlingguy commented 9 years ago
WARNING: The following packages cannot be authenticated!
  postfix

This usually indicates an Apt error; if you destroy and rebuild, or just wait a while and rebuild, will it start working?

kostajh commented 9 years ago

I don't want to destroy, but a colleague of mine has noted the same issue. Is there a way to run --force-yes in the postfix role? That would solve the problem, I think.

Jeff Geerling writes:

WARNING: The following packages cannot be authenticated!
  postfix

This usually indicates an Apt error; if you destroy and rebuild, or just wait a while and rebuild, will it start working?


Reply to this email directly or view it on GitHub: https://github.com/geerlingguy/drupal-vm/issues/310#issuecomment-156461635

@kostajh | kosta@kostaharlan.net

chasingmaxwell commented 9 years ago

I am having this same issue. It also happens with the "unzip" package when it is included in the extra_packages property. I've destroyed and rebuilt several times over two days with no success.

geerlingguy commented 9 years ago

This definitely sounds like an Apt issue. @chasingmaxwell can you paste in the error output from Ansible?

chasingmaxwell commented 9 years ago
failed: [drupalvm] => (item=unzip) => {"failed": true, "item": "unzip"}
stderr: E: There are problems and -y was used without --force-yes

stdout: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  libyaml-0-2 python-crypto python-httplib2 python-jinja2 python-markupsafe
  python-paramiko python-pkg-resources python-support python-yaml sshpass
Use 'apt-get autoremove' to remove them.
Suggested packages:
  zip
The following NEW packages will be installed:
  unzip
0 upgraded, 1 newly installed, 0 to remove and 48 not upgraded.
Need to get 157 kB of archives.
After this operation, 395 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  unzip

msg: '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"   install 'unzip'' failed: E: There are problems and -y was used without --force-yes

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/peter/playbook.retry

drupalvm                  : ok=146  changed=75   unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
geerlingguy commented 9 years ago

I'm running into this every now and then too... something is up with the Ubuntu apt sources right now, so the most reliable fix for this issue is to log into the VM (vagrant ssh), then run sudo apt-get update, then log back out and run vagrant provision again.

I've had it happen twice (on different packages each time), and both times it was fixed by doing apt-get update. No idea why packages are going stale like this, but it doesn't seem to be anything Drupal VM can fix automatically... it already does an apt-get update the first time it's provisioned, and in some other situations where it knows it's needed :P