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 migrate from Mastodon 3.1.4 to glitch-soc because cannot load tty-command #1365

Closed
1 of 2 tasks
gnu-lorien opened this issue Jun 28, 2020 · 9 comments
Closed
1 of 2 tasks

Comments

@gnu-lorien
Copy link

gnu-lorien commented Jun 28, 2020

I've set up a Mastodon instance using a pre-configured Droplet with Digital Ocean. I tried to migrate to glitch-soc today using the same repository in place following the instructions on https://glitch-soc.github.io/docs/. Everything was going fine until the initial migration step in which I received the following error.

I tried removing the Gemfile lock and bundle install again to the same effect.
I tried adding the gem tty-command to the same effect.

I'm not extremely familiar with how gems are managed and what might be the true source of this error, so I apologize if this is wrong to report directly to glitch-soc. I tried to search for this particular error in other bug reports and couldn't find anything.

RAILS_ENV=production SKIP_POST_DEPLOYMENT_MIGRATIONS=true bundle exec rails db:migrate --trace
rails aborted!
LoadError: cannot load such file -- tty-command
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:34:in `require'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
/home/mastodon/live/lib/tasks/digitalocean.rake:3:in `<top (required)>'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:285:in `block in load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:285:in `load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:656:in `block in run_tasks_blocks'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:656:in `each'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:656:in `run_tasks_blocks'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/application.rb:515:in `run_tasks_blocks'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:459:in `load_tasks'
/home/mastodon/live/Rakefile:6:in `<top (required)>'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:285:in `block in load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:285:in `load'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/rake/rake_command.rb:22:in `block in perform'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/command.rb:48:in `invoke'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.3/lib/rails/commands.rb:18:in `<top (required)>'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
bin/rails:4:in `<main>'

  • I searched or browsed the repo’s other issues to ensure this is not a duplicate.
  • This bugs also occur on vanilla Mastodon
@ClearlyClaire
Copy link

hm… curious… tty-command is a dependency we got rid of a while ago, I am not completely sure what could be causing this.

It seems that bootsnap may be trying to load it anyway because of a stale cache, although I have no idea why this would occur. In this case, removing tmp/cache and trying again could work.

@ClearlyClaire
Copy link

ClearlyClaire commented Jun 28, 2020

Also, please restore the Gemfile.lock from glitch-soc's repo, removing it will very likely cause issues.

@gnu-lorien
Copy link
Author

Thanks for the quick reply! I'll try it out.

@gnu-lorien
Copy link
Author

Removing tmp/cache did not work

@ClearlyClaire
Copy link

could you run grep -rF tty-command?

@gnu-lorien
Copy link
Author

grep -rF tty-command
lib/tasks/digitalocean.rake:require 'tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/bin/console:require 'tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/tty-command.gemspec:  spec.name          = "tty-command"
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/tty-command.gemspec:  spec.files        += Dir['{bin,tasks}/*', 'tty-command.gemspec']
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/tasks/console.rake:  require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.9.0]: https://github.com/piotrmurach/tty-command/compare/v0.8.2...v0.9.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.8.2]: https://github.com/piotrmurach/tty-command/compare/v0.8.1...v0.8.2
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.8.1]: https://github.com/piotrmurach/tty-command/compare/v0.8.0...v0.8.1
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.8.0]: https://github.com/piotrmurach/tty-command/compare/v0.7.0...v0.8.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.7.0]: https://github.com/piotrmurach/tty-command/compare/v0.6.0...v0.7.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.6.0]: https://github.com/piotrmurach/tty-command/compare/v0.5.0...v0.6.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.5.0]: https://github.com/piotrmurach/tty-command/compare/v0.4.0...v0.5.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.4.0]: https://github.com/piotrmurach/tty-command/compare/v0.3.3...v0.4.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.3.3]: https://github.com/piotrmurach/tty-command/compare/v0.3.2...v0.3.3
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.3.2]: https://github.com/piotrmurach/tty-command/compare/v0.3.1...v0.3.2
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.3.1]: https://github.com/piotrmurach/tty-command/compare/v0.3.0...v0.3.1
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.3.0]: https://github.com/piotrmurach/tty-command/compare/v0.2.0...v0.3.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.2.0]: https://github.com/piotrmurach/tty-command/compare/v0.1.0...v0.2.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/CHANGELOG.md:[v0.1.0]: https://github.com/piotrmurach/tty-command/compare/v0.1.0
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/spec/spec_helper.rb:require 'tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/buffer.rb:require_relative "../lib/tty-command"
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/pty.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/redirect_stderr.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/redirect_stdin.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/basic.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/bash.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/timeout.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/env.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/timeout_input.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/threaded.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/wait.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/output.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/stdin_input.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/redirect_stdout.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/examples/logger.rb:require_relative '../lib/tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[![Gem Version](https://badge.fury.io/rb/tty-command.svg)][gem]
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[![Build Status](https://secure.travis-ci.org/piotrmurach/tty-command.svg?branch=master)][travis]
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[![Code Climate](https://codeclimate.com/github/piotrmurach/tty-command/badges/gpa.svg)][codeclimate]
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[![Coverage Status](https://coveralls.io/repos/github/piotrmurach/tty-command/badge.svg)][coverage]
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[![Inline docs](http://inch-ci.org/github/piotrmurach/tty-command.svg?branch=master)][inchpages]
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[gem]: http://badge.fury.io/rb/tty-command
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[travis]: http://travis-ci.org/piotrmurach/tty-command
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[appveyor]: https://ci.appveyor.com/project/piotrmurach/tty-command
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[codeclimate]: https://codeclimate.com/github/piotrmurach/tty-command
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[coverage]: https://coveralls.io/github/piotrmurach/tty-command
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:[inchpages]: http://inch-ci.org/github/piotrmurach/tty-command
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:gem 'tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:    $ gem install tty-command
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:require 'tty-command'
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:Please see [lib/tty/command/printers/abstract.rb](https://github.com/piotrmurach/tty-command/blob/master/lib/tty/command/printers/abstract.rb) for a full set of methods that you can override.
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:Here's a slightly more elaborate example to illustrate how tty-command can improve on plain old shell scripts. This example installs a new version of Ruby on an Ubuntu machine.
vendor/bundle/ruby/2.6.0/gems/tty-command-0.9.0/README.md:Bug reports and pull requests are welcome on GitHub at https://github.com/piotrmurach/tty-command. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
vendor/bundle/ruby/2.6.0/specifications/tty-command-0.9.0.gemspec:# stub: tty-command 0.9.0 ruby lib
vendor/bundle/ruby/2.6.0/specifications/tty-command-0.9.0.gemspec:  s.name = "tty-command".freeze

@gnu-lorien
Copy link
Author

gnu-lorien commented Jun 28, 2020

It must've been the rakefile. I ran mv lib/tasks/digitalocean.rake ../ and then the migration command worked. I'm kind of surprised they interacted in this way.

@ClearlyClaire
Copy link

ClearlyClaire commented Jun 28, 2020

It was that rake file indeed, it's included in the DigitalOcean droplet thing for the initial setup, so you can safely remove it now.

As it's not in the repo, it's not maintained with it, and has not been updated when we removed the tty-command… I'll see if I can make bootsnap ignore it.

EDIT: there doesn't seem to be a way :/

@ClearlyClaire
Copy link

As I haven't found a way to exclude that file, and since upstream's recommendation for dealing with the same issue is removing the file, I'm gonna close this issue.

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