eucuepo / vagrant-kafka

Vagrant config to setup a partitioned Apache Kafka installation with clustered Apache Zookeeper
103 stars 89 forks source link

Can't run scripts to create or list topics #5

Closed caddac closed 7 years ago

caddac commented 7 years ago

I've succesfully ssh'd into one of the brokers, but when trying to run the script (or any of the scripts) /vagrant/scripts/create_topic.sh I get the error -bash: /vagrant/scripts/create_topic.sh: /bin/bash^M: bad interpreter: No such file or directory

I'm running this on Windows 10 in Powershell, but I've also tried in Cmd. Looks like a line ending issue?

caddac commented 7 years ago

I ran sed -i -e 's/\r$//' /vagrant/scripts/create_topic.sh and it fixed the issue.

bash-my-script-bin-bashm-bad-interpreter-no-such-file-or-directory

imarios commented 7 years ago

@caddac, it does sound like Windows vs Linux line feed difference. Glad you figured out a solution to this. Be careful when you edit files in Windows and then run them on Linux, and vice versa.

caddac commented 7 years ago

@imarios I didn't edit them beyond running the sed command to fix the issue. Seems like vagrant-kafka targets a linux host? I guess when I cloned the repo initially I changed the line endings in the files.

imarios commented 7 years ago

@caddac I only tried this on a Mac. You are right, the way we test it right now, it might not be fully windows compatible.