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

COMPOSER_VERSION in options.json breaks buildpak #169

Closed
3 tasks done
janaurka opened this issue Oct 20, 2016 · 7 comments
Closed
3 tasks done

COMPOSER_VERSION in options.json breaks buildpak #169

janaurka opened this issue Oct 20, 2016 · 7 comments

Comments

@janaurka
Copy link

Hey

When trying to select a custom composer version using the documented way the buildpack breaks (check errorlog below).

What version of Cloud Foundry are you using?

cf dev version
PCF Dev version 0.21.0 (CLI: e0fdf71, OVA: 0.337.0)

Also testet on a PCF installation running (API version: 2.54.0).

What version of the buildpack you are using?

php_buildpack                6          true      false    php_buildpack-cached-v4.3.14.zip

-> but also when cf push test -b https://github.com/cloudfoundry/php-buildpack.git which is using the latest version.

If you were attempting to accomplish a task, what was it you were attempting to do?
According to the docs it should be possible to set the COMPOSER_VERSION in .bp-config/options.json like this:

cat .bp-config/options.json
{
    "COMPOSER_VERSION": "1.0.0"
}

What did you expect to happen?
I expected the buildpack to download the requested version of composer and use this version.

What was the actual behavior?
An error occured:

Staging...
-------> Buildpack version 4.3.21
Installing HTTPD
HTTPD 2.4.23
Downloaded [https://buildpacks.cloudfoundry.org/concourse-binaries/httpd/httpd-2.4.23-linux-x64.tgz] to [/tmp]
Installing PHP
PHP 5.5.38
Downloaded [https://buildpacks.cloudfoundry.org/concourse-binaries/php/php-5.5.38-linux-x64-1474040750.tgz] to [/tmp]
Downloaded [https://buildpacks.cloudfoundry.org/concourse-binaries/php/php-5.5.38-linux-x64-1474040750.tgz] to [/tmp]
Traceback (most recent call last):
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/scripts/compile.py", line 50, in <module>
    .from_build_pack('lib/additional_commands')
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/lib/build_pack_utils/builder.py", line 208, in extensions
    process_extension(path, ctx, 'compile', process, args=[self])
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/lib/build_pack_utils/utils.py", line 69, in process_extension
    success(getattr(extn, to_call)(*args))
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/extensions/composer/extension.py", line 414, in compile
    return composer.compile(install)
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/lib/extension_helpers.py", line 154, in compile
    self._compile(install)
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/extensions/composer/extension.py", line 180, in _compile
    self.install()
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/extensions/composer/extension.py", line 215, in install
    extract=False)
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/lib/build_pack_utils/cloudfoundry.py", line 209, in _install_binary_from_manifest
    self._dwn.download(url, self._ctx['TMPDIR'])
  File "/tmp/buildpacks/a8097900bb0ea6f0bb97ef3a727783fc/lib/build_pack_utils/downloads.py", line 38, in download
    raise RuntimeError("Could not download dependency: %s" % url)
RuntimeError: Could not download dependency: /composer/1.0.0/composer.phar
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
Successfully destroyed container

FAILED
Error restarting application: BuildpackCompileFaile

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/132837149

The labels on this github issue will be updated when the story is started.

@jchesterpivotal
Copy link
Contributor

It's a bit unclear which PHP buildpack version you're using.

What I take to be the cf buildpacks output show the cached v4.3.14, but the staging logs show output for an uncached v4.3.21.

4.3.14 included composer 1.0.0, 3.4.21 includes composer 1.2.1.

Is there a reason for trying to pick 1.0.0? Especially on the .21 buildpack?

@janaurka
Copy link
Author

@jchesterpivotal : oh, yes you are correct, that’s a little confusing. I’ve tested it on various versions.

I know that it comes bundled with, but according to https://docs.cloudfoundry.org/buildpacks/php/gsg-php-composer.html#configuration you can set COMPOSER_VERSION and it will install this version for you, right?

(I’m not 100% aware why I should stick with a specific version, but I need to deploy an app which according to the README wants this particular version of composer and I have no access to the devs...)

@jchesterpivotal
Copy link
Contributor

We're having trouble following the sequence of events inside the buildpack.

If you can set BP_DEBUG=1 for the app, then tail the logs using cf logs app-name, you'll get a very detailed log output. That'll help us trace the sequence.

As a note, cf logs --recent isn't enough, as it only shows the last 100 lines of output. We find in practice that, in strict accordance with Murphy's Law, the lines we need are left out.

@janaurka
Copy link
Author

@sesmith177
Copy link
Contributor

Hello @janaurka,

It looks like the documentation is misleading. COMPOSER_VERSION works as follows:

  1. In a cached buildpack, it must match the version specified in the buildpack manifest.yml
  2. In an uncached buildpack, it can either match the version in the buildpack manifest.yml or be set to 'latest'. In this case, it will download the latest version from https://getcomposer.org/composer.phar.

If you really need composer 1.0.0, you would have to fork the buildpack and add composer 1.0.0 to the manifest.yml

@janaurka
Copy link
Author

Ok, thx for the clearification

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

4 participants