Fresh Heroku Install - failed to execute: `mysql`

Hi,

I am currently trying to get a fresh install of the current version of sharetribe on Heroku.

I have followed the instructions here: https://github.com/jarvisjohnson/sharetribe-stripe-connect/blob/master/heroku-deploy-gist/Deploying%20Sharetribe%20to%20Heroku.md
Including the advice about setting sphinx certs here: https://github.com/sharetribe/sharetribe/issues/2981

When I run: heroku run bundle exec rake db:structure:load

** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Starting the New Relic agent version 4.2.0.334 in "production" environment.
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : To prevent agent startup add a NEW_RELIC_AGENT_ENABLED=false environment variable or modify the "production" section of your newrelic.yml.
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Reading configuration from config/newrelic.yml (/app)
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] WARN : Agent is configured not to use SSL when communicating with New Relic's servers
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Environment: production
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : No known dispatcher detected.
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Application: Sharetribe
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : NewRelic::Agent::Samplers::DelayedJobSampler not available: No DJ worker present. Skipping DJ queue sampler
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Redis Instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing ActiveRecord 5 instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing DelayedJob instrumentation [part 1/2]
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Net instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Memcache instrumentation for dalli gem
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Rails 3+ middleware instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing ActiveJob instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing deferred Rack::Builder instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Rack::Builder middleware instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Rails 5 Action Cable instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Rails 5 view instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Installing Rails 5 Controller instrumentation
** [NewRelic][2018-02-26 04:30:06 +0000 run.* (4)] INFO : Finished instrumentation
rake aborted!
failed to execute: `mysql`
Please check the output above for any errors and make sure that `mysql` is installed in your PATH and has proper permissions.

/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/mysql_database_tasks.rb:144:in `run_cmd'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/mysql_database_tasks.rb:74:in `structure_load'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:223:in `structure_load'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:236:in `load_schema'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:255:in `block in load_schema_current'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:304:in `block in each_current_configuration'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:303:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:303:in `each_current_configuration'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/tasks/database_tasks.rb:254:in `load_schema_current'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.1/lib/active_record/railties/databases.rake:290:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/airbrake-6.1.2/lib/airbrake/rake.rb:19:in `execute'
/app/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.3.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => db:structure:load
(See full trace by running task with --trace)
** [NewRelic][2018-02-26 04:30:07 +0000 run.* (4)] INFO : Starting Agent shutdown

I overcame this problem by cloning the database. You can use the import/export function of a database management software like MySQL Workbench.

@nghiapham Thanks for the response.

I realise now this is actually what was said in the gist I cited in the op:

And initialize your database

heroku run bundle exec rake db:structure:load

I could not get this to work on Sharetribe v6.0.

Instead, I used Sequel Pro to connect to my local and ClearDB databases, and mysqldump’d the local, imported into the remote, with no problems Would love to hear if this worked out better for anyone else!

I have since moved the installation to AWS however would like to get it up and running on heroku. Any sharetribe devs care to weigh in on why this command fails?

This rake task simply invokes mysql command with extra options from your config/database.yml

mysql --execute "SOURCE db/structure.sql;" --database db_name --user db_user --port db_port

Since heroku does not have mysql binaries on the dynos, you could add a buildpack for that https://elements.heroku.com/search/buildpacks?q=mysql

But, actually you don’t need it, just do local mysqldump, connect to your ClearDB database and import sql dump there.