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

tr: Illegal byte sequence #2

Closed
jbw976 opened this issue Jun 19, 2018 · 7 comments
Closed

tr: Illegal byte sequence #2

jbw976 opened this issue Jun 19, 2018 · 7 comments
Assignees
Labels
bug Something isn't working portability

Comments

@jbw976
Copy link
Collaborator

jbw976 commented Jun 19, 2018

When running commit 27c3304 on my Mac, I see the following messages from tr as the first output of make up. The installation completes and the Kubernetes cluster seems functional, so this may not be a big issue.

jared@Jareds-MacBook-Pro ~/dev/k8s-vagrant-multi-node (master)
> make up -j4
tr: Illegal byte sequence
tr: Illegal byte sequence
vagrant up
VAGRANT_VAGRANTFILE=Vagrantfile_nodes NODE=1 vagrant up
VAGRANT_VAGRANTFILE=Vagrantfile_nodes NODE=2 vagrant up
Bringing machine 'node1' up with 'virtualbox' provider...
Bringing machine 'node2' up with 'virtualbox' provider...
Bringing machine 'master' up with 'virtualbox' provider...
...
@galexrt galexrt self-assigned this Jun 19, 2018
@galexrt
Copy link
Owner

galexrt commented Jun 20, 2018

@jbw976 Could you check if 6a1720d fixed these tr error messages?

@jbw976
Copy link
Collaborator Author

jbw976 commented Jun 20, 2018

Seems to work OK now:

> make token
> cat .vagrant/KUBETOKEN
lgypb9.19zafgyfcgk5678o

@galexrt
Copy link
Owner

galexrt commented Jun 20, 2018

Thanks for verifying! That is the "correct" output now.
Fix is now in master will tag it soon.

@galexrt galexrt closed this as completed Jun 20, 2018
@galexrt galexrt added the bug Something isn't working label Jun 20, 2018
@damianoneill
Copy link

damianoneill commented Mar 8, 2019

I'm see similar issue with current master / head

commit e65032e881877d39dbd652561f6ec061fc5f2241 (HEAD -> master, origin/master, origin/HEAD)
Author: Alexander Trost <[email protected]>
Date:   Mon Mar 4 18:36:33 2019 +0100

    Removed mentions of unused vagrant-plugin-vagrant-reload plugin

    Use Google DNS servers for Ubuntu as the "default" ones are sometimes
    broken causing the whole environment install to fail.

    Signed-off-by: Alexander Trost <[email protected]>

Using vagrant version;

$ vagrant version
Installed Version: 2.2.4
Latest Version: 2.2.4

You're running an up-to-date version of Vagrant!

Running the following command.

$ NODE_MEMORY_SIZE_GB=3 NODE_CPUS=2 NODE_COUNT=3 make up -j4
tr: Illegal byte sequence
tr: Illegal byte sequence
tr: Illegal byte sequence
tr: Illegal byte sequence
if !(vagrant box list | grep -q generic/fedora29); then \
		vagrant \
			box \
			add \
			--provider=virtualbox \
			generic/fedora29; \
	else \
		vagrant box update --box=generic/fedora29; \
	fi
==> box: Loading metadata for box 'generic/fedora29'
    box: URL: https://vagrantcloud.com/generic/fedora29

Host info

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G1815

@damianoneill
Copy link

@galexrt on my specific version of OSX the issue can be fixed by using LC_ALL rather than LC_CTYPE, see below.

Also note in the makefile there is an if statement that is being written to console, added an @ to silence.

$ git diff
diff --git a/Makefile b/Makefile
index 94ce364..a9ade67 100644
--- a/Makefile
+++ b/Makefile
@@ -54,7 +54,7 @@ token: ## Generate a kubeadm join token, if needed (token file is `DIRECTORY_OF_
        fi
        @if [ ! -f "$(MFILECWD)/.vagrant/KUBETOKEN" ]; then \
                if [ -z "$(KUBETOKEN)" ]; then \
-                       echo "$(shell LC_CTYPE=C tr -cd 'a-z0-9' < /dev/urandom | fold -w 6 | head -n 1).$(shell cat /dev/urandom | LC_CTYPE=C tr -cd 'a-z0-9' < /dev/urandom | fold -w 16 | head -n 1)" > "$(MFILECWD)/.vagrant/KUBETOKEN"; \
+                       echo "$(shell LC_ALL=C tr -cd 'a-z0-9' < /dev/urandom | fold -w 6 | head -n 1).$(shell cat /dev/urandom | LC_ALL=C tr -cd 'a-z0-9' < /dev/urandom | fold -w 16 | head -n 1)" > "$(MFILECWD)/.vagrant/KUBETOKEN"; \
                else \
                        echo "$(KUBETOKEN)" > "$(MFILECWD)/.vagrant/KUBETOKEN"; \
                fi; \
@@ -119,7 +119,7 @@ kubectl: ## Configure kubeconfig context for the cluster using `kubectl config`
        @echo

 pull: ## Add and download, or update the box image on the host.
-       if !(vagrant box list | grep -q $(shell grep "^\$$box_image.*=.*'.*'\.freeze" "$(MFILECWD)/vagrantfiles/$(BOX_OS)/common" | cut -d\' -f2)); then \
+       @if !(vagrant box list | grep -q $(shell grep "^\$$box_image.*=.*'.*'\.freeze" "$(MFILECWD)/vagrantfiles/$(BOX_OS)/common" | cut -d\' -f2)); then \
                vagrant \
                        box \
                        add \

@galexrt
Copy link
Owner

galexrt commented Mar 9, 2019

@damianoneill I see, thanks for debugging this!

Do you want to open a PR with this fix?

damianoneill pushed a commit to damianoneill/k8s-vagrant-multi-node that referenced this issue Mar 9, 2019
@damianoneill
Copy link

@galexrt see #36

galexrt added a commit that referenced this issue Mar 9, 2019
update to #2 fix for osx

Co-authored-by: null <[email protected]>
galexrt added a commit that referenced this issue Jun 12, 2020
Signed-off-by: Alexander Trost <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working portability
Projects
None yet
Development

No branches or pull requests

3 participants