heroku / heroku-buildpack-ruby

Heroku's buildpack for Ruby applications.
MIT License
788 stars 1.87k forks source link

Unable to deploy legacy 1.8.7 app due to missing openjdk7 package #1004

Closed mokolabs closed 4 years ago

mokolabs commented 4 years ago

Hey, folks.

I've got a production legacy app running Rails 2.3 / Ruby 1.8.7 on Cedar 14 with this buildpack.

The app is stable and has been running fine for years, but once in a while, we need to push out a configuration change or other minor tweak.

But I'm unable to deploy to production now. The app bundle builds successfully, but then the build fails while attempting to install the JVM via this URL: http://heroku-jdk.s3.amazonaws.com/openjdk7-latest.tar.gz

If you try to access that URL for openjdk7, you get this error:

<Error>
<Code>AllAccessDisabled</Code>
<Message>All access to this object has been disabled</Message>
<RequestId>42FC23E88023DF18</RequestId>
<HostId>
t2MxRJ5NvQETZkyZncKqQ+Mq4J2aJ+fsI1N2WIrk6ly+U0XHykCuoJKTQTcAqecrBZIF6Enwukc=
</HostId>
</Error>

So... the build seems to be failing because the openjdk7 package is missing from Heroku's S3 account or otherwise disabled.

The app is running on Cedar 14 which was slated for EOL on May 1, 2020... but the EOL deadline has been extended to Nov 2, 2020 due to Covid, so deploys should still be possible until then.

Here's the full output from my build, if you're curious:

iMac-Retina:~/Sites/beekman (master) $ push heroku master
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 480 bytes | 240.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Rails plugin injection
remote: -----> Using Ruby version: ruby-1.8.7
remote: -----> Installing dependencies using 1.6.3
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Using sunspot_solr 2.1.0
remote:        Using open4 1.1.0
remote:        Using multi_json 1.3.6
remote:        Using Platform 0.4.0
remote:        Using pr_geohash 1.0.0
remote:        Using highline 1.6.20
remote:        Using has_scope 0.5.1
remote:        Using geokit 1.6.0
remote:        Using fssm 0.2.7
remote:        Using rdiscount 1.6.8
remote:        Using exifr 1.0.6
remote:        Using eventmachine 1.0.3
remote:        Using chunky_png 1.2.1
remote:        Using rake 0.8.7
remote:        Using bundler 1.6.3
remote:        Using clearance 0.8.8
remote:        Using session 3.2.0
remote:        Using rack 1.1.2
remote:        Using haml 3.1.2
remote:        Using daemons 1.1.9
remote:        Using dotenv 0.7.0
remote:        Using activesupport 2.3.10
remote:        Using mime-types 1.16
remote:        Using unidecode 1.0.0
remote:        Using pg 0.14.1
remote:        Using rakismet 0.4.2
remote:        Using nokogiri 1.5.10
remote:        Using will_paginate 2.3.15
remote:        Using responders 0.4.8
remote:        Using geocoder 1.1.2
remote:        Using fattr 2.2.2
remote:        Using sass 3.1.7
remote:        Using cancan 1.6.5
remote:        Using xml-simple 1.1.0
remote:        Using json 1.7.5
remote:        Using builder 3.2.2
remote:        Using POpen4 0.1.4
remote:        Using rush 0.6.8
remote:        Using thin 1.6.2
remote:        Using activerecord 2.3.10
remote:        Using activeresource 2.3.10
remote:        Using indefinite_article 0.2.0
remote:        Using actionpack 2.3.10
remote:        Using inherited_resources 1.0.6
remote:        Using options 2.3.0
remote:        Using compass 0.11.5
remote:        Using rsolr 1.0.9
remote:        Using aws-s3 0.6.2
remote:        Using sitemap_generator 3.2.1
remote:        Using airbrake 4.0.0
remote:        Using yui-compressor 0.9.6
remote:        Using paperclip 2.3.10
remote:        Using actionmailer 2.3.10
remote:        Using progress_bar 1.0.0
remote:        Using fancy-buttons 1.1.2
remote:        Using html5-boilerplate 1.0.0
remote:        Using sunspot 2.0.0
remote:        Using jammit 0.6.3
remote:        Using rails 2.3.10
remote:        Using delayed_job 1.7.0 from git://github.com/mokolabs/delayed_job.git (at master)
remote:        Using sunspot_rails 2.0.0
remote:        Your bundle is complete!
remote:        Gems in the groups development and test were not installed.
remote:        It was installed into ./vendor/bundle
remote:        Bundle completed (0.32s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing JVM: openjdk7-latest
remote:  !
remote:  !     Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 http://heroku-jdk.s3.amazonaws.com/openjdk7-latest.tar.gz -s -o - | tar zxf - ' failed unexpectedly:
remote:  !     
remote:  !     gzip: stdin: unexpected end of file
remote:  !     tar: Child returned status 1
remote:  !     tar: Error is not recoverable: exiting now
remote:  !
remote: /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/shell_helpers.rb:49:in `run!': Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 http://heroku-jdk.s3.amazonaws.com/openjdk7-latest.tar.gz -s -o - | tar zxf - ' failed unexpectedly: (LanguagePack::Fetcher::FetchError)
remote: 
remote: gzip: stdin: unexpected end of file
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/fetcher.rb:24:in `fetch_untar'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:349:in `block (2 levels) in install_jvm'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:348:in `chdir'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:348:in `block in install_jvm'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:40:in `yield_with_block_depth
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/base.rb:51:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/base.rb:47:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:336:in `install_jvm'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:574:in `post_bundler'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:95:in `block (2 levels) in compile'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:685:in `call'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:685:in `allow_git'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:92:in `block in compile'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:40:in `yield_with_block_depth
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/base.rb:51:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/base.rb:47:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/ruby.rb:83:in `compile'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/rails2.rb:49:in `block in compile'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:40:in `yield_with_block_depth
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/base.rb:51:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/base.rb:47:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/rails2.rb:47:in `compile'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/bin/compile:16:in `block (2 levels) in <main>'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/base.rb:128:in `log'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/bin/compile:15:in `block in <main>'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:35:in `call'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:35:in `block in trace'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:40:in `yield_with_block_depth
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:17:in `block in instrument'
remote:     from /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:16:in `instrument'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/lib/language_pack/instrument.rb:35:in `trace'
remote:     from /app/tmp/buildpacks/7c42fc595fad206dd795b5b06a67571a279653cf8819d1c7e8d91f6371b282b9f1edd5778f234520ff5bd86a7418be6f394fdbc70fffde0f5f5018b610fbb72a/bin/compile:11:in `<main>'
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to beekman.
remote: 
To https://git.heroku.com/beekman.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/beekman.git'
schneems commented 4 years ago

The S3 bucket got deleted as part of an unrelated AWS consolidation effort. We don't have access to the prior contents. The original Cedar 14 deprecation date is months past. We've only extended it due to COVID. If it weren't for that you would be prevented from deploying to Cedar-14 at all. The last change to that branch is 5 years ago. It was intended to be a stop-gap solution to allow people to temporarily use older rubies while they work to upgrade their apps.

While the deleting of this bucket was not intentional I do not plan on restoring this functionality.

Actually looking at the failure mode. We do have similar contents this might work:

$ curl -I https://lang-jvm.s3.amazonaws.com/jdk/cedar-14/openjdk1.7-latest.tar.gz
HTTP/1.1 200 OK

If you fork the buildpack branch and test it out on your app (update the lib/language_pack/helpers/jvm_installer.rb) to point at the new location, I could accept a PR to that branch to continue providing support for the next few months until the hard cedar-14 sunset.

mokolabs commented 4 years ago

Thanks for the response, @schneems. I really appreciate it.

I figured something like that happened with the missing download. I was just dealing with the dangers of AWS bucket cleanups on another project. You can never truly know for sure what's in use and what can be safely deleted.

I've already patched this and successfully redeployed our app with the fix, so I will go ahead and submit that PR now. 👍