cloudfoundry / ruby-buildpack

Cloud Foundry buildpack for Ruby, Sinatra and Rails
http://docs.cloudfoundry.org/buildpacks/
Apache License 2.0
65 stars 160 forks source link

/src/ruby/supply/supply.go captures all output from rake secret instead of the last line. #105

Closed innov8d closed 6 years ago

innov8d commented 6 years ago

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

min_cli_version: "6.23.0" min_recommended_cli_version: "6.23.0" api_version": "2.98.0" cf version 6.26.0+9c9a261fd.2017-04-06

What version of the buildpack you are using?

https://github.com/cloudfoundry/ruby-buildpack/releases/tag/v1.7.18

If you were attempting to accomplish a task, what was it you were attempting to do?

Deploy an jruby rails application to CF using ruby buildpack. The app displays logging output when the command bundle exec rake secret is run and it is being included in profile.d/0_ruby.sh. Right now that just causes non-fatal errors to be displayed when container is started, but this could be used by a developer to inject arbitrary commands into the profile.d/0_ruby.sh.

Example profile.d file: 0_java.txt Example errors when additional text is captured: error.txt Source file with issue: /src/ruby/supply/supply.go

What did you expect to happen?

Expect profile.d/0_ruby.sh to run without errors during container startup. Expect parsing of bundle exec rake secret to only use the last line of the output.

What was the actual behavior?

Errors are displayed due to log text from bundle exec rake secret being included in profile.d/0_ruby.sh

Please confirm where necessary:

cf-gitbot commented 6 years ago

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

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

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

astrieanna commented 6 years ago

@innov8d 👍

Ben16 commented 6 years ago

@innov8d We tried today to reproduce this behavior, but were unable to. We used this fixture, modified to use rails 4.1, and the latest buildpack (1.7.18).

What version of rake did you use to get this behavior? We used rake 12.3.1.

ameyer-pivotal commented 6 years ago

@innov8d Closing due to inactivity, but feel free to re-open if you're still seeing this.

@sclevine Does this sound like something you'd like us to address, if it does become reproducible?