Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to enable LDAP by uncommenting the sample line in config.yaml results in a failing build #1947

Closed
rszrama opened this issue Nov 14, 2019 · 6 comments

Comments

@rszrama
Copy link
Contributor

rszrama commented Nov 14, 2019

Describe the bug
I was trying to add the PHP LDAP extension to an environment to test the LDAP module for Drupal 8. I found through this queue that there was an example in config.yaml showing how to get that extension, but simply uncommenting that line produces the following error on build:

Errors were encountered while processing:
 php7.3-fpm
E: Sub-process /usr/bin/dpkg returned an error code (1)
', stderr='Building db
Building web
Service 'web' failed to build: The command '/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests php-yaml php7.3-ldap' returned a non-zero code: 100' 

To Reproduce
Steps to reproduce the behavior:

  1. Open config.yaml.
  2. Uncomment the webimage_extra_packages definition.
  3. Attempt to start the project.
  4. See error. 😱

Version and configuration information (please complete the following information):

  • Host computer OS and Version: macOS High Sierra
  • Docker version: 19.03.4
  • ddev version: v1.11.0
  • config.yaml contents: the current template with the change to the commented line.
  • Do you have any custom configuration (nginx, php, mysql) in the .ddev folder? Nope.
@rfay
Copy link
Member

rfay commented Nov 14, 2019

I'm unable to recreate that problem. I was wondering if you were using php 7.2 and installing php7.3-ldap, but that also worked fine for me. You can experiment with this and maybe see more info with:

ddev ssh
sudo apt-get update 
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends --no-install-suggests php-yaml php7.3-ldap

@Z0zol3
Copy link

Z0zol3 commented Nov 15, 2019

I can confirm this issue by trying to install php-ldap, also php-imap with standard configuration.

EDIT: I tried to remove php-imap module from a project and leave php7.2-ldap, since we are using php 7.2 and the error message seems to disappear.
rfay's presumption could be true in this case.

@rfay
Copy link
Member

rfay commented Nov 15, 2019

I was able to recreate this by going back to v1.11.0, and the problem is that the upgrade of php7.3-ldap actually upgrades way too much stuff, including php-fpm, and there's a config change to www.conf, so you get

Setting up php7.3-fpm (7.3.11-1+0~20191026.48+debian9~1.gbpf71ca0) ...

Configuration file '/etc/php/7.3/fpm/pool.d/www.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** www.conf (Y/I/N/O/D/Z) [default=N] ?

Because DEBIAN_FRONTEND is noninteractive, it's a plain failure.

I'm not entirely sure there's a good workaround for this. But as @Z0zol3 points out, you can probably do php7.2-ldap just fine if you're using php7.2.

It does look like changing to apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confnew" --no-install-recommends --no-install-suggests may force the new config per https://serverfault.com/a/279446/79810

Thanks for pointing raising this bug. It would happen in the future at various times when a ddev release and its associated images got a little bit old compared to the upstream packages, or major config changes in the upstream Debian packages, as happened here. I'll do a PR to try to make this work more generally.

@rfay
Copy link
Member

rfay commented Nov 15, 2019

Thanks so much for the issue, #1951 should fix it, at least in this situation.

And of course for your short-term situation,

  • you can just use php7.2-ldap if you're using php7.2 (which doesn't have the major churn upstream)
  • Or if you need php7.3, you can add .ddev/web-build/Dockerfile (copy from .ddev/web-build/Dockerfile.example) with apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confnew" --no-install-recommends --no-install-suggests php7.3-ldap

@rfay
Copy link
Member

rfay commented Nov 15, 2019

BTW, the reason I was initially unable to recreate was that I was using a newer ddev, which used a more recent image, which didn't have the upstream php7.3 churn.

@rszrama
Copy link
Contributor Author

rszrama commented Nov 15, 2019

No worries, thanks for all the extra detail and ideas! Wouldn't be a bad thing for me to be testing against 7.3 locally regardless. : D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants