mina-deploy / mina

Blazing fast deployer and server automation tool

Home Page:https://rubygems.org/gems/mina

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArgumentError: invalid byte sequence in US-ASCII when deploying using GitLab CI with Docker

Quintasan opened this issue · comments

Hi, I'm trying to deploy using mina on GitLab CI but I get the following error. It appears there is a problem with the locale on the server but I can deploy just fine using the same configuration from my local machine. Any tips on how to debug this?

$ bundle exec mina deploy --trace
** Invoke deploy (first_time)
** Execute deploy
** Invoke remote_environment (first_time)
** Execute remote_environment
** Invoke rbenv:load (first_time)
** Execute rbenv:load
** Invoke git:clone (first_time)
** Execute git:clone
** Invoke deploy:link_shared_paths (first_time)
** Execute deploy:link_shared_paths
** Invoke bundle:install (first_time)
** Execute bundle:install
** Invoke rails:db_migrate (first_time)
** Execute rails:db_migrate
** Invoke rails:assets_precompile (first_time)
** Execute rails:assets_precompile
** Invoke deploy:cleanup (first_time)
** Execute deploy:cleanup
#<Thread:0x0000563b862f6a58@/builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/runner/pretty.rb:19 run> terminated with exception (report_on_exception is true):
/builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/helpers/output.rb:6:in `===': invalid byte sequence in US-ASCII (ArgumentError)
	from /builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/helpers/output.rb:6:in `print_line'
	from /builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/runner/pretty.rb:21:in `block (2 levels) in run'
#<Thread:0x0000563b862f68c8@/builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/runner/pretty.rb:25 run> terminated with exception (report_on_exception is true):
/builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/runner/pretty.rb:26:in `gets': stream closed in another thread (IOError)
	from /builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/runner/pretty.rb:26:in `block (2 levels) in run'
mina aborted!
ArgumentError: invalid byte sequence in US-ASCII
/builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/helpers/output.rb:6:in `==='
/builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/helpers/output.rb:6:in `print_line'
/builds/kea/backend/vendor/ruby/2.5.0/gems/mina-1.2.3/lib/mina/runner/pretty.rb:21:in `block (2 levels) in run'
Tasks: TOP => deploy
       Warning: Permanently added 'b.kea.apploversoftware.com,116.203.19.52' (ECDSA) to the list of known hosts.

-----> Creating a temporary build path
-----> Loading rbenv
-----> Fetching new git commits
       remote: Enumerating objects: 9, done.        
       remote: Counting objects:  11% (1/9)           
remote: Counting objects:  22% (2/9)           
remote: Counting objects:  33% (3/9)           
remote: Counting objects:  44% (4/9)           
remote: Counting objects:  55% (5/9)           
remote: Counting objects:  66% (6/9)           
remote: Counting objects:  77% (7/9)           
remote: Counting objects:  88% (8/9)           
remote: Counting objects: 100% (9/9)           
remote: Counting objects: 100% (9/9), done.        
       remote: Compressing objects:  20% (1/5)           
remote: Compressing objects:  40% (2/5)           
remote: Compressing objects:  60% (3/5)           
remote: Compressing objects:  80% (4/5)           
remote: Compressing objects: 100% (5/5)           
remote: Compressing objects: 100% (5/5), done.        
       remote: Total 5 (delta 4), reused 1 (delta 0)        
       Unpacking objects:  20% (1/5)   
Unpacking objects:  40% (2/5)   
Unpacking objects:  60% (3/5)   
Unpacking objects:  80% (4/5)   
Unpacking objects: 100% (5/5)   
Unpacking objects: 100% (5/5), done.
       From git.applover.pl:kea/backend
        + 1c2a8a8...25dbbed master     -> master  (forced update)
-----> Using git branch 'master'
       Cloning into '.'...
       done.
-----> Using this git commit
ERROR: Job failed: exit code 1

I figured it out myself. The Docker image has the locale set to POSIX by default which Ruby translates to US-ASCII. The only way is to change the locale manually in the container to C.UTF-8.