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

Git commit message with non ASCII character raises error #68

Closed
fuadsaud opened this issue Nov 13, 2012 · 21 comments
Closed

Git commit message with non ASCII character raises error #68

fuadsaud opened this issue Nov 13, 2012 · 21 comments

Comments

@fuadsaud
Copy link
Contributor

Running deploy with the last git commit message containing a non ASCII character throws:

invalid byte sequence in US-ASCII

@rstacruz
Copy link
Member

If anyone can help debug this, that'd be swell. I'd like to see the entire error message if there's more to it.

@sethvargo
Copy link

@rstacruz add this to the top of all the files:

# encoding: utf-8

Or at least all files that accept varying input.

@sethvargo
Copy link

Lol I was just about to suggest a fix... when I realized that I already did haha.

@mikong mikong closed this as completed in f217d11 Jul 7, 2013
@fmartingr
Copy link

This is happening to me as I'm trying to setup a simple deploy with mina, but the character is not in the commit message but in my name.

Via Shell:

$ git --no-pager log --format="%aN (%h):%n> %s" -n 1
Felipe Martín (c26bb7b):
> Blog.Entry allow admin filter by draft status

Via mina deploy --trace:

-----> Using this git commit

       $ git --no-pager log --format="%aN (%h):%n> %s" -n 1
mina aborted!
invalid byte sequence in US-ASCII

@constantm
Copy link

Just had this issue again due to @henrebotha's name having an é in it.

@gabskoro
Copy link
Member

Hi @fmartingr and @constantm please update the gem to the new version, this bug is fixed :)

@constantm
Copy link

Awesome thanks!

@fmartingr
Copy link

Thank you, will take a look :)

@constantm
Copy link

Nope, still an issue on 0.3.1

-----> Using this git commit

       $ git --no-pager log --format='%aN (%h):%n> %s' -n 1 
mina aborted!                 
ArgumentError: invalid byte sequence in US-ASCII
/usr/local/opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mina-0.3.1/lib/mina/output_helpers.rb:23:in `print_str'
/usr/local/opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mina-0.3.1/lib/mina/output_helpers.rb:41:in `print_char'
/usr/local/opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mina-0.3.1/lib/mina/exec_helpers.rb:29:in `block (2 levels) in pretty_system'
/usr/local/opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mina-0.3.1/lib/mina/exec_helpers.rb:104:in `stream_stdout'
/usr/local/opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mina-0.3.1/lib/mina/exec_helpers.rb:29:in `block in pretty_system'

@gabskoro
Copy link
Member

gabskoro commented Nov 3, 2014

Hmm, I added some characters in my git name and tested it again.

$ git --no-pager log --format='%aN (%h):%n> %s' -n 1
Gabrijel adéoío (44c9c84):
> test adéoío

@constantm
Copy link

Weird. Any ideas how I can help debug this?

@gabskoro
Copy link
Member

gabskoro commented Nov 3, 2014

Can you please write down your full name, and your last commit message?

@constantm
Copy link

➜ git --no-pager log --format='%aN (%h):%n> %s' -n 1
Henré Botha (03552a0):
> test

@gabskoro
Copy link
Member

gabskoro commented Nov 3, 2014

Wait, wait, I totally forgot that this error appears on your server :) Can you check your locales?

http://perlgeek.de/en/article/set-up-a-clean-utf8-environment

@constantm
Copy link

Aaaaaah. Okay, quick question - does Mina use the default shell for root (eg. Zsh), or does it use Bash?

@gabskoro
Copy link
Member

gabskoro commented Nov 3, 2014

As I know mina uses the default shell :)

@constantm
Copy link

Okay in that case setting the locales didn't fix the issue. I've added the exports to .zshrc, and the only thing is changes is LC_ALL and LANGUAGE. The rest were at en_US.UTF-8 already. Running locales as root shows the following:

➜  ~  whoami
root
➜  ~  locale 
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Deploys still don't work. :/

@gabskoro
Copy link
Member

gabskoro commented Nov 3, 2014

Ok, can you please add it to .bashrc just to test it?

This are my locales, I'm using .bashrc with legacy user

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

@constantm
Copy link

Added locales to .bashrc to root with no luck. I'm just going to change the name for now. Will comment here if I ever figure out what causes the issue.

@omer-clustox
Copy link

any update on this issue ? My name and commit message has no special character. Still I am getting this message.
screenshot 2016-10-27 15 31 24

@omer-clustox
Copy link

omer-clustox commented Oct 27, 2016

Got it resolved. Issue was due to missing local on my local pc. I run following on my terminal

export LC_ALL="en_US.UTF-8"
locale

mina deploy works fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants