I'm currently trying to create an app to enable automatic deployment with Capistrano.
While referring to the article below, we are proceeding with the introduction, all the work items have been completed,
bundle exec cap production deploy
When I ran the command, an error occurred.
How to install automatic deployment tool (Capistrano)
Error status Terminal (local)nakayakouyuu @ nakayakouyuunoMacBook-Pro smot% bundle exec cap production deploy
[Deprecation Notice] Future versions of Capistrano will not load the Git SCM
plugin by default. To silence this deprecation warning, add the following to
your Capfile after `require" capistrano/deploy "`:
require "capistrano/scm/git"
install_plugin Capistrano :: SCM :: Git
00:00 git: wrapper
01 mkdir -p/tmp
✔ 01 [email protected] 0.239s
Uploading /tmp/git-ssh-smot-production-nakayakouyuu.sh 100.0%
02 chmod 700 /tmp/git-ssh-smot-production-nakayakouyuu.sh
✔ 02 [email protected] 0.291s
00:00 git: check
01 git ls-remote [email protected]: nakaya-kousuke/smot.git HEAD
01 5e943870f1583d9775b045f3c40d418324d8ad8a HEAD
✔ 01 [email protected] 2.098s
00:02 deploy: check: directories
01 mkdir -p/var/www/smot/shared/var/www/smot/releases
✔ 01 [email protected] 0.132s
00:03 deploy: check: linked_dirs
01 mkdir -p/var/www/smot/shared/log/var/www/smot/shared/tmp/pids/var/www/smot/shared/tmp/cache/var/www/smot/shared/tmp/sockets/var/www/smot/sha…
✔ 01 [email protected] 0.224s
00:03 git: clone
The repository mirror is at/var/www/smot/repo
00:03 git: update
01 git remote set-url origin [email protected]: nakaya-kousuke/smot.git
✔ 01 [email protected] 0.237s
02 git remote update --prune
02 Fetching origin
✔ 02 [email protected] 2.093s
00:06 git: create_release
01 mkdir -p/var/www/smot/releases/20201103133334
✔ 01 [email protected] 0.226s
02 git archive master |/usr/bin/env tar -x -f --- C/var/www/smot/releases/20201103133334
02 fatal: not a valid object name: master02 tar:
02 This doesn't seem to be a tar archive
02 02
02 tar:
02 Exit with failure status due to previous error
02 02
#<Thread: [email protected]/Users/nakaya-kousuke/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb: 10 run>terminated with exception (report_on_exception is true):
Traceback (most recent call last):
1: from /Users/nakaya-kousuke/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/Users/nakaya-kousuke/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as [email protected]: git exit status: 2 (SSHKit :: Runner :: ExecuteError)
git stdout: Nothing written
git stderr: fatal: not a valid object name: master
tar: This doesn't seem to be a tar archive
tar: exit with failure status due to previous error
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit :: Runner :: ExecuteError: Exception while executing as [email protected]: git exit status: 2
git stdout: Nothing written
git stderr: fatal: not a valid object name: master
tar: This doesn't seem to be a tar archive
tar: exit with failure status due to previous error
Caused by:
SSHKit :: Command :: Failed: git exit status: 2
git stdout: Nothing written
git stderr: fatal: not a valid object name: master
tar: This doesn't seem to be a tar archive
tar: exit with failure status due to previous error
Tasks: TOP =>git: create_release
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: git exit status: 2
git stdout: Nothing written
git stderr: fatal: not a valid object name: master
tar: This doesn't seem to be a tar archive
tar: exit with failure status due to previous error
What I checked
When I googled "tar: This doesn't seem to be a tar archive", I found the following article:
[Terraform + capistrano + itamae] A memorandum when deploying a Rails application to aws ②
It says "The branch name to deploy specified in =>Capfile was different."
Since the branch name is not written in Capfile, is it the branch name of deploy.rb? I thought, I checked it, but it was definitely described.
require "capistrano/setup"
require "capistrano/deploy"
require'capistrano/rbenv'
require'capistrano/bundler'
require'capistrano/rails/assets'
require'capistrano/rails/migrations'
require'capistrano3/unicorn'
Dir.glob ("lib/capistrano/tasks/*. rake"). each {| r | import r}
deploy.rb
# config valid only for current version of Capistrano
Described the version of #capistrano. Continue to use the fixed version and prevent troubles due to version change
lock '3.14.1'
Used to display # Capistrano logs
set: application,'smot'
# Specify from which repository I want to pull your app
set: repo_url,'[email protected]: nakaya-kousuke/smot.git'
#Specify a directory to be referenced in common even if the version changes
set: linked_dirs, fetch (: linked_dirs, []). push ('log','tmp/pids','tmp/cache','tmp/sockets','vendor/bundle','public/system',' public/uploads')
set: rbenv_type,: user
set: rbenv_ruby, '2.5.1' # If i follow the curriculum, it's 2.5.1 or 2.3.1.
#Which public key to use for deployment
set: ssh_options, auth_methods: ['publickey'],
keys: ['~/.ssh/smot.pem']
#Location of the file containing the process number
set: unicorn_pid,->{"# {shared_path} /tmp/pids/unicorn.pid"}
# Unicorn configuration file location
set: unicorn_config_path,->{"# {current_path} /config/unicorn.rb"}
set: keep_releases, 5
# Description for restarting Unicorn after the deployment process is finished
after'deploy: publishing','deploy: restart'
namespace: deploy do
task: restart do
invoke'unicorn: restart'
end
end
I would like to know what kind of error this is and how to resolve the error.
-
Answer # 1
Related articles
- ruby on rails - rails routing error
- ruby on rails 5 - about lint/syntax error of rubocop
- ruby on rails - test code causes error when product information input is successful
- ruby on rails 6 - [error] nomethoderror in communitiescontroller # create undefined method `published?'for # <community: 0x0
- ruby on rails - i want to download a file with rails, s3 and carrierwave, but i get an error
- ruby on rails - i want to resolve rails name error
- ruby on rails - unknown action error when trying to post a comment
- ruby on rails - syntax error cannot be resolved
- error in building environment of ruby on rails
- ruby on rails 6 - [error] nomethoderror in communities # index undefined method `following?'for nil: nilclass
- ruby on rails 5 - i want to get an error message when i enter the user id in full-width in url
- ruby on rails - i get a template is missing error in render
- ruby on rails 6 - [error] nomethoderror in followscontroller # destroy undefined method `destroy'for nil: nilclass
- ruby on rails - i don't understand the content of the error
- ruby on rails - i get an error with rails db: create
- ruby on rails - i get an error in a program that changes over time
- ruby on rails - nomethoderror in itemscontroller # new error
- ruby on rails - i get an error without being created
- ruby on rails 6 - [error] nomethoderror in followscontroller # create undefined method `follows' for nil: nilclass
- i should have written the process of embedding a video in html with the youtube player api, but the video is no longer displayed
- github - when deploying to heroku, i get error: failed to push some refs to, but i can't resolve it
- ruby on rails - time out when connecting with deployment using ec2, rds
- ruby - [rails] i want to deploy a rails application using elastic beanstalk
- ruby - sass :: syntaxerror on rails s
- ruby - deployment error on heroku
- ruby on rails - the link between the model created by devise and the model originally created does not work
- ruby on rails - i want to know the settings of auto scaling for automatic server recovery (maintaining the number of instances)
- ruby - when deploying on capistrano, i get the error "access denied for user'ec2-user' @'localhost' (using password: no)&qu
- ruby on rails - create a chat feature with action cable on ec2 on rails aws
Has the master branch on github been renamed to the main branch?
If so
Try adding the following to deploy.rb.
I'm fine with this.