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

rails upgrade and failed to deploy #114

Open
igorkasyanchuk opened this issue Nov 25, 2019 · 6 comments
Open

rails upgrade and failed to deploy #114

igorkasyanchuk opened this issue Nov 25, 2019 · 6 comments

Comments

@igorkasyanchuk
Copy link

igorkasyanchuk commented Nov 25, 2019

Hello, I'm having an issue with deploying an app. We have upgraded Rails to 6 and now I've this bug.
If I do --full-index or bundle update railties it doesn't help.
Same time with:

set :bundle_path, nil
set :bundle_jobs, 4
set :bundle_without, nil
set :bundle_flags, nil

I can deploy.

Log of failed build below. Please advise.

'''
INFO [d58c3933] Finished in 0.261 seconds with exit status 0 (successful).
INFO [d6d60231] Running /usr/bin/env ln -s /home/deployer/sga/shared/public/ckeditor_assets /home/deployer/sga/releases/20191125102415/public/ckeditor_assets as deployer@192.168.240.42
INFO [d6d60231] Finished in 0.269 seconds with exit status 0 (successful).
INFO [833d676a] Running /usr/bin/env ln -s /home/deployer/sga/shared/public/assets /home/deployer/sga/releases/20191125102415/public/assets as deployer@192.168.240.42
INFO [833d676a] Finished in 0.272 seconds with exit status 0 (successful).
INFO [d41ec5cb] Running ~/.rvm/bin/rvm 2.6.3 do bundle install --path /home/deployer/sga/shared/bundle --jobs 4 --without development test --deployment --quiet as deployer@192.168.240.42
#<Thread:0x000000000234bf78@/usr/local/rvm/gems/ruby-2.5.5/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
1: from /usr/local/rvm/gems/ruby-2.5.5/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:11:in block (2 levels) in execute' /usr/local/rvm/gems/ruby-2.5.5/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:15:in rescue in block (2 levels) in execute': Exception while executing as deployer@192.168.240.42: bundle exit status: 34 (SSHKit::Runner::ExecuteError)
bundle stdout: Nothing written
bundle stderr: Warning, new version of rvm available '1.29.9', you are using older version '1.29.8'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Downloading railties-6.0.1 revealed dependencies not in the API or the lockfile
(rake (>= 0.8.7), thor (>= 0.20.3, < 2.0), method_source (>= 0)).
Either installing with --full-index or running bundle update railties should
fix the problem.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deployer@192.168.240.42: bundle exit status: 34
bundle stdout: Nothing written
bundle stderr: Warning, new version of rvm available '1.29.9', you are using older version '1.29.8'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Downloading railties-6.0.1 revealed dependencies not in the API or the lockfile
(rake (>= 0.8.7), thor (>= 0.20.3, < 2.0), method_source (>= 0)).
Either installing with --full-index or running bundle update railties should
fix the problem.

Caused by:
SSHKit::Command::Failed: bundle exit status: 34
bundle stdout: Nothing written
bundle stderr: Warning, new version of rvm available '1.29.9', you are using older version '1.29.8'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Downloading railties-6.0.1 revealed dependencies not in the API or the lockfile
(rake (>= 0.8.7), thor (>= 0.20.3, < 2.0), method_source (>= 0)).
Either installing with --full-index or running bundle update railties should
fix the problem.

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deployer@192.168.240.42: bundle exit status: 34
bundle stdout: Nothing written
bundle stderr: Warning, new version of rvm available '1.29.9', you are using older version '1.29.8'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Downloading railties-6.0.1 revealed dependencies not in the API or the lockfile
(rake (>= 0.8.7), thor (>= 0.20.3, < 2.0), method_source (>= 0)).
Either installing with --full-index or running bundle update railties should
fix the problem.
'''

@mattbrictson
Copy link
Member

Hmm, I've never seen this error before. My only guess based on the error message is that your Gemfile.lock is incomplete. Have you run bundle install locally, committed and pushed your Gemfile.lock to git?

You might more troubleshooting ideas by looking for similar issue reports in the bundler repo: https://github.com/bundler/bundler/search?q=revealed+dependencies+not+in+the+API+or+the+lockfile&type=Issues

@igorkasyanchuk
Copy link
Author

Yes, I did everything that it asked me, and only:

set :bundle_path, nil
set :bundle_without, nil
set :bundle_flags, nil

helped me. Not sure why putting gems into "shared" making it fail.

Just regular "bundle install" works when I'm in releases/XXXXX folder.

@mattbrictson
Copy link
Member

I wonder if set :bundle_flags, nil is actually the important difference? Normally we pass the --deployment flag which tells Bundler to fail if there are any gems specified in the Gemfile that are missing from Gemfile.lock. This prevents you from deploying dependencies that aren't completely specified. More info here: https://bundler.io/v2.0/man/bundle-install.1.html#DEPLOYMENT-MODE

@jasonivers
Copy link

After updating to bundler version 2.1, I see this messages on deployment:

 DEBUG [e0e96756] 	[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set deployment 'true'`, and stop using this flag
 DEBUG [e0e96756] 	[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '/my/app/path/shared/bundle'`, and stop using this flag
 DEBUG [e0e96756] 	[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'development test'`, and stop using this flag

I don't have any particular bundler configurations present in my deploy file, I'm just using the defaults. Should the gem be setting these things, or should I be doing them myself? Either way, the gem should probably not be using deprecated flags.

@mattbrictson
Copy link
Member

@jasonivers can you create a new issue? You are right: capistrano-bundler should not be using these bundle install flags. We need to avoid using flags so that we are forward-compatible with Bundler 3 and so that users don't see these deprecation warnings.

@jasonivers
Copy link

Done

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

3 participants