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

Unable to deploy to cloud foundry #2

Open
chefhoobajoob opened this issue Jan 18, 2018 · 6 comments
Open

Unable to deploy to cloud foundry #2

chefhoobajoob opened this issue Jan 18, 2018 · 6 comments

Comments

@chefhoobajoob
Copy link

I'm getting the failure below. Any suggestions?

-------> Buildpack version 4.3.42
Installing HTTPD
HTTPD 2.4.27
Traceback (most recent call last):
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/scripts/compile.py", line 55, in <module>
    .from_build_pack('lib/additional_commands')
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/lib/build_pack_utils/builder.py", line 209, in extensions
    process_extension(path, ctx, 'compile', process, args=[self])
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/lib/build_pack_utils/utils.py", line 69, in process_extension
    success(getattr(extn, to_call)(*args))
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/lib/httpd/extension.py", line 45, in compile
    .package('HTTPD')
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/lib/build_pack_utils/builder.py", line 185, in package
    self._installer.install_binary(key)
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/lib/build_pack_utils/cloudfoundry.py", line 214, in install_bin
ary
    strip=strip)
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/lib/build_pack_utils/cloudfoundry.py", line 190, in _install_bi
nary_from_manifest
    self._dwn.download(url, self._ctx['TMPDIR'])
  File "/tmp/buildpacks/b9d2a80e3f1bbb4448d9b085812e89e2/lib/build_pack_utils/downloads.py", line 40, in download
    raise RuntimeError("MD5 of downloaded dependency does not match expected value")
RuntimeError: MD5 of downloaded dependency does not match expected value
Failed to compile droplet: Failed to run finalize script: exit status 1
Exit status 223
Stopping instance 8937e43f-3b6e-42f3-a2a4-bcf726bfa9a3
Destroying container
Successfully destroyed container

FAILED
Error restarting application: BuildpackCompileFailed
@dmikusa
Copy link
Member

dmikusa commented Jan 18, 2018

You're on quite an old buildpack. Can you try a more recent one and see if that works? I tested with PHP buildpack 4.3.47 and it works OK. That will pull in HTTPD 2.4.29.

@chefhoobajoob
Copy link
Author

chefhoobajoob commented Jan 18, 2018

It may be a network problem in the cf environment (for which I don't have administrative privileges). Trying to use a specific buildpack gets this result:

Starting app cf-ex-phppgadmin in org OTX / space Blazon as hoobajoob@<domain>...
Creating container
Successfully created container
Downloading app package...
Downloaded app package (9.1K)
Failed to clone git repository at https://github.com/cloudfoundry/php-buildpack/releases/tag/v4.3.47
Exit status 1
Stopping instance fb8254d2-2428-499a-bffb-dda7b2f40d8e
Destroying container
Successfully destroyed container

FAILED

To specify this version, I added the buildpack property to the manifest. Is that the right way to request a specific buildpack version?

---
applications:
- name: cf-ex-phppgadmin
  memory: 128M
  buildpack: https://github.com/cloudfoundry/php-buildpack/releases/tag/v4.3.47

@dmikusa
Copy link
Member

dmikusa commented Jan 18, 2018

Yea, seems like it can't download the buildpack. Can you ask your administrator to install a more recent one?

For what it's worth, the problem you're seeing above could also be network related. The download of the binary is failing because the MD5 of the downloaded resource doesn't match the expected value. If nothing was downloaded then the MD5 of nothing wouldn't match the MD5 of the expected download.

It's a little odd that the buildpack would need to download HTTPD though. HTTPD should be included with any offline version of the buildpack. Maybe try running cf buildpacks to check that you have an offline version of the buildpack installed.

Also, check for a .bp-config/options.json file in the root of the PHPMyAdmin project. That file can be used to specify a specific version of a binary. If it's asking for a version that's not included in buildpack, that might trigger a remote download, which seems like it would fail in your environment.

@chefhoobajoob
Copy link
Author

chefhoobajoob commented Jan 18, 2018

Ha.

Here's the result of cf buildpacks:

Getting buildpacks...

buildpack   position   enabled   locked   filename
FAILED
Failed fetching buildpacks.
Error performing request: Get https://api.bp-cf.<domain>/v2/buildpacks: dial tcp: lookup api.bp-cf.<domain>: no such host
TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.

@dmikusa
Copy link
Member

dmikusa commented Jan 18, 2018

Hmm, seems like more networking issues. Saying that you can't talk to the API. I would suggest that you get these networking issues worked out before we troubleshoot the app more. It's likely that resolving your networking issues, or at least understanding what is and isn't allowed in the environment will help.

For what it's worth, to deploy this app you need to have Internet access. This repo includes a buildpack extension which will reach out and download the PHPMyAdmin files. If Intenet access is blocked, this will fail. I expect this will fail for you unless you there is a proxy available to allow internet access during staging.

It might be easier for you to deploy PHPMyAdmin manually rather than using this project. I think the following should work:

1.) Download the PHPPgAdmin source.
2.) Make a project folder called PHPPgAdminApp.
3.) Make an htdocs folder, within PHPPgAdminApp. Ex: mkdir -p PHPPgAdminApp/htdocs.
4.) Unzip the PHPPgAdmin source to PHPPgAdminApp/htdocs.
5.) Copy this file from the project into the htdocs/conf directory of your project. This has the auto config magic that will detect your bound services.
6.) Either copy the manifest.yml or create your own. You may need to edit app or service names, depend on your environment.
7.) Create .bp-config/options.json with the values from here.
8.) cf push the app.

It's a little more of a manual process, but it should work in an offline environment. Hope that helps!

@chefhoobajoob
Copy link
Author

Yes, I agree about the network situation. In the meantime, I'll give PHPMyAdmin a run. Thank you!

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

2 participants