Release command failing but there are not logs

Hello,

We’re trying to add a database migration step into the release command into our toml file - its failing at the moment, but we can’t see why as it doesn’t seem to be included in the logs.

The app is: ten-staging

Thanks,
Matt

Can you share your fly.toml and paste logs from the deploy?

# fly.toml file generated for ten-staging on 2021-07-09T12:14:35+03:00

app = "ten-staging"

kill_signal = "SIGINT"
kill_timeout = 90

[env]

[mounts]
  source="ten_staging_volume"
  destination="/code/public"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 3000
  protocol = "tcp"
  script_checks = []

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 6
    timeout = "2s"

[deploy]
  release_command = "bundle exec rake db:migrate"

Will grab the logs.

It looks like the last release command worked fine. It ran about 40 minutes ago.

Hello, sorry for late response. Below are the logs from last deploy…

flyctl deploy -c fly-ten-staging.toml --app ten-staging --verbose
Deploying ten-staging
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 3000
Remote builder fly-builder-green-forest-7235 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.8 linux x86_64
Sending build context to Docker daemon  59.79MB
Step 1/14 : FROM ruby:2.7.3
 ---> bde251a6c494
Step 2/14 : ARG ssh_prv_key
 ---> Using cache
 ---> 1023b8adfdf7
Step 3/14 : ARG ssh_pub_key
 ---> Using cache
 ---> 0e0748637480
Step 4/14 : RUN apt-get update -y
 ---> Using cache
 ---> 48d55646bcac
Step 5/14 : RUN apt-get install -y libfreeimage-dev
 ---> Using cache
 ---> a20f2f904636
Step 6/14 : RUN mkdir -p /root/.ssh &&     chmod 0700 /root/.ssh &&     ssh-keyscan github.com > /root/.ssh/known_hosts
 ---> Using cache
 ---> ed9e7c9a4234
Step 7/14 : RUN echo "$ssh_prv_key" > /root/.ssh/id_rsa &&     echo "$ssh_pub_key" > /root/.ssh/id_rsa.pub &&     chmod 600 /root/.ssh/id_rsa &&     chmod 600 /root/.ssh/id_rsa.pub
 ---> Using cache
 ---> f618151fc8f9
Step 8/14 : WORKDIR /code
 ---> Using cache
 ---> 1ff7e4f83b10
Step 9/14 : COPY . /code
 ---> b68ac21a5003
Step 10/14 : RUN gem install bundler:2.1.4
 ---> Running in 02d6d3966d45
Successfully installed bundler-2.1.4
1 gem installed
 ---> 610c280c7892
Step 11/14 : RUN bundle install --jobs 4 --retry 3
 ---> Running in a007b11699ab
Fetching gem metadata from http://rubygems.org/.............
Fetching https://github.com/bitzesty/image_science.git
Fetching rake 13.0.3
Installing rake 13.0.3
Fetching concurrent-ruby 1.1.8
Fetching minitest 5.14.4
Fetching RedCloth 4.3.2
Installing minitest 5.14.4
Installing concurrent-ruby 1.1.8
Fetching zeitwerk 2.4.2
Installing zeitwerk 2.4.2
Fetching rack 2.2.3
Installing rack 2.2.3
Installing RedCloth 4.3.2 with native extensions
Fetching bigdecimal 1.4.4
Installing bigdecimal 1.4.4 with native extensions
Using bundler 2.1.4
Fetching builder 3.2.4
Fetching byebug 11.1.3
Fetching chronic 0.10.2
Installing builder 3.2.4
Installing byebug 11.1.3 with native extensions
Fetching coderay 1.1.3
Installing coderay 1.1.3
Installing chronic 0.10.2
Fetching dotenv 2.7.6
Fetching daemons 1.4.0
Fetching eventmachine 1.2.7
Installing daemons 1.4.0
Installing dotenv 2.7.6
Installing eventmachine 1.2.7 with native extensions
Fetching fastercsv 1.5.5
Fetching ffi 1.15.0
Installing ffi 1.15.0 with native extensions
Installing fastercsv 1.5.5
Fetching temple 0.8.2
Installing temple 0.8.2
Using image_science 1.3.2.1.alanjrogers from https://github.com/bitzesty/image_science.git (at main@f0b360e)
/usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:167: warning: conflicting chdir during another chdir block
Fetching tilt 2.0.10
Installing tilt 2.0.10
/usr/local/lib/ruby/2.7.0/rubygems/ext/builder.rb:175: warning: conflicting chdir during another chdir block
Fetching logger 1.4.3
Fetching mini_mime 1.1.0
Fetching json 2.5.1
Installing logger 1.4.3
Installing mini_mime 1.1.0
Installing json 2.5.1 with native extensions
Fetching method_source 1.0.0
Installing method_source 1.0.0
Fetching multi_json 1.15.0
Fetching ruby2_keywords 0.0.4
Installing multi_json 1.15.0
Installing ruby2_keywords 0.0.4
Fetching mysql2 0.5.3
Installing mysql2 0.5.3 with native extensions
Fetching yard 0.9.26
Installing yard 0.9.26
Fetching r18n-core 5.0.1
Fetching rack-ssl-enforcer 0.2.9
Installing r18n-core 5.0.1
Fetching rb-fsevent 0.10.4
Installing rb-fsevent 0.10.4
Installing rack-ssl-enforcer 0.2.9
Fetching redis 4.4.0
Fetching riddle 2.4.2
Installing riddle 2.4.2
Installing redis 4.4.0
Fetching ruby-ole 1.2.12.2
Fetching sequel 4.49.0
Installing ruby-ole 1.2.12.2
Fetching stripe 5.32.1
Installing sequel 4.49.0
Fetching timerizer 0.3.3
Installing stripe 5.32.1
Installing timerizer 0.3.3
Fetching xml-simple 1.1.8
Installing xml-simple 1.1.8
Fetching appsignal 2.11.5
Fetching passenger 6.0.10
Installing appsignal 2.11.5 with native extensions
Installing passenger 6.0.10 with native extensions
Fetching rack-protection 2.1.0
Fetching rack-test 1.1.0
Installing rack-protection 2.1.0
Installing rack-test 1.1.0
Fetching i18n 1.8.10
Installing i18n 1.8.10
Fetching tzinfo 2.0.4
Installing tzinfo 2.0.4
Fetching whenever 1.0.0
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Installing whenever 1.0.0
Fetching thin 1.8.1
Fetching haml 5.2.0
Installing thin 1.8.1 with native extensions
Installing haml 5.2.0
Fetching pry 0.13.1
Fetching mail 2.7.1
Installing pry 0.13.1
Installing mail 2.7.1
Fetching mustermann 1.1.1
Fetching paymill 0.4.0
Fetching redis-store 1.9.0
Installing mustermann 1.1.1
Installing redis-store 1.9.0
Fetching spreadsheet 1.2.8
Fetching racksh 1.0.0
Installing spreadsheet 1.2.8
Fetching activesupport 6.1.3.2
Installing activesupport 6.1.3.2
Installing racksh 1.0.0
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching haml-contrib 1.0.0.1
Fetching pry-byebug 3.9.0
Installing pry-byebug 3.9.0
Installing paymill 0.4.0
Fetching pry-doc 1.1.0
Fetching sinatra 2.1.0
Installing sinatra 2.1.0
Installing haml-contrib 1.0.0.1
Fetching redis-rack 2.1.3
Installing redis-rack 2.1.3
Fetching sass 3.7.4
Fetching sinatra-contrib 2.1.0
Installing sinatra-contrib 2.1.0
Installing sass 3.7.4
Fetching sinatra-flash 0.3.0
Fetching sinatra-r18n 5.0.2
Installing sinatra-r18n 5.0.2
Installing sinatra-flash 0.3.0
Installing pry-doc 1.1.0
Bundle complete! 40 Gemfile dependencies, 66 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

 ---> 47fb99a2d13b
Step 12/14 : RUN rm -rf /code/public
 ---> Running in 16ef6f9e1e4a
 ---> 2b5af5c49f01
Step 13/14 : EXPOSE 3000
 ---> Running in 02272b217726
 ---> 34eb93711e6d
Step 14/14 : CMD ["bundle", "exec", "passenger", "start", "-p", "3000", "--max-pool-size", "10", "--log-file", "/dev/stdout"]
 ---> Running in 3eaf90632984
 ---> 25bad681ff80
Successfully built 25bad681ff80
Successfully tagged registry.fly.io/ten-staging:deployment-1633938148
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/ten-staging]
f81a3c6e33b9: Pushed 
506971a7fc09: Pushed 
cde4c795d8eb: Pushed 
3b6d3dc7c2c1: Pushed 
5c0f2ae1c41e: Layer already exists 
eaf2e4fe8979: Layer already exists 
63391096951c: Layer already exists 
01a0f88970a1: Layer already exists 
5c83ef1b18ef: Layer already exists 
8a9d99c4fcf4: Layer already exists 
a052bdaeb97a: Layer already exists 
2ed0436a6584: Layer already exists 
cdc9dae211b4: Layer already exists 
7095af798ace: Layer already exists 
fe6a4fdbedc0: Layer already exists 
e4d0e810d54a: Layer already exists 
4e006334a6fd: Layer already exists 
deployment-1633938148: digest: sha256:88013223bcbbcea52de0f6a1d7de6d63957764cd976a2a2059aab1041917206a size: 3887
--> Pushing image done
Image: registry.fly.io/ten-staging:deployment-1633938148
Image size: 1.2 GB
==> Creating release
Release v107 created
Release command detected: this new release will not be available until the command succeeds.

You can detach the terminal anytime without stopping the deployment
==> Release command
Command: bundle exec rake db:migrate
	 Starting instance
	 Configuring virtual machine
	 Pulling container image
	 Unpacking image
	 Preparing kernel init
	 Setting up volume 'ten_staging_volume'

Error Release command failed, deployment aborted