apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.5k stars 1.16k forks source link

kafka exception for Hello action #624

Closed lfzCarlosC closed 8 years ago

lfzCarlosC commented 8 years ago

clean up everything and re-run Hello case on June 10 . This is my log info:

$ uname -a MINGW64_NT-6.1 BPK1MZ87 2.5.0(0.295/5/3) 2016-03-31 18:47 x86_64 Msys

$ vagrant -v Vagrant 1.8.1

virtual box 5.0.10 r104061

$ rm -rf ~/.vagrant.d/ $ git clone --depth=1 https://github.com/openwhisk/openwhisk.git $ cd openwhisk/tools/vagrant/simple/ $ ./hello ......... ==> default: ++ bin/wsk action invoke /whisk.system/samples/echo -p message hello --blocking --result ==> default: { ==> default: "message": "hello" ==> default: } error: name 'C:' contains illegal characters (code 29) wsk failed, build might be broken try running ./resume_build

$vagrant ssh //to the vagrant vm

Then: create js file hello.js: function main() { return {payload: 'Hello world'}; }

wsk action create hello hello.js

wsk action invoke --blocking hello vagrant@vagrant-ubuntu-trusty-64:~$ error: org.apache.kafka.common.errors.NetworkException: The server disconnected before a response was received. (code 63)

wsk action invoke --blocking hello error: org.apache.kafka.common.errors.TimeoutException: Batch Expired (code 53)

looks like wsk is running but have connection issue on kafka I want to know how to deploy/restart the whisk system. Or any workround? otherwise ,each time I develop new things and when meeting this error ,I cannot restart and I can only do the clean and recreate a new vm and miss what I developed

csantanapr commented 8 years ago

Try updating VirtualBox and use custom instructions with a persisten DB like Cloudant or a remote CouchDB https://github.com/openwhisk/openwhisk/blob/master/tools/vagrant/custom/README.md

lfzCarlosC commented 8 years ago

I followed the guide to run the custom case but also error happens.

When running vagrant up : ==> default: +++ SCRIPTDIR=$'.\r' ==> default: +++ $'\r' ==> default: all.sh: line 4: $'\r': command not found The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.

I try it on windows platform and try windows cmd,git bash and cygwin terminal but the same issue.

lfzCarlosC commented 8 years ago

$uname -a MINGW64_NT-6.1 WIN-V8HMM9K0A63 2.5.0(0.295/5/3) 2016-03-31 18:47 x86_64 Msys

I think this problem is due to the lack of dos2unix command converting \r to unix format,but given all.sh is a file in vm not in the host machine ,I do not know the where and how to use this command to shell script ,or which shell scripts?

lfzCarlosC commented 8 years ago

$ vagrant -v Vagrant 1.8.3

chinuy commented 8 years ago

same issue to me. I can run testing after the first time deployment. But connection fail after couples of minute.

csantanapr commented 8 years ago

@chinuy You didn't restart the vagrant VM? Can you retry but this time increase the memory in the Vagrantfile? Change from 2GB to 4GB at the top of the file

lfzCarlosC commented 8 years ago

@csantanapr I think kafka issue was solved after mem param modification. But the issue error: name 'C:' contains illegal characters (code 29) still happens, any workaround?

case to reproduce: $ vagrant ssh -- wsk action invoke /whisk.system/samples/echo -p message hello --blocking --result error: name 'C:' contains illegal characters (code 70)

I setup up my open whisk in C:\workspace,in git bash command it is /c/workspace case which do not have the problem: $ vagrant ssh $ wsk action invoke /whisk.system/samples/echo -p message hello --blocking --result

{ "message": "hello" } => correct

csantanapr commented 8 years ago

Ah thanks @lfzCarlosC I will send a pull request to increase the mem to 4GB. I was hoping not require a high memory for the simple scenario. I think I'm going to merge both simple and custom, into a single one and always share the folder.

About error: name 'C:' contains illegal characters (code 70) I don't have workaround to get it vagrant ssh -- on your windows. but other have success like @dubeejw But have some questions for this specific error:

  1. Are you using simple or custom? or you getting the error on both?
  2. Are you saying that if you first vagrant ssh, and then run wsk from inside the VM it's correct, but running using the vagrant shortcut vagrant ssh -- is not correct?
  3. How did you setup ssh on windows that vagrant is using? native ssh, cygwin ssh, etc.. @dubeejw I know you use windows and ssh, and you install ssh, what ssh works for you?
  4. How you fix the problems with \r in linux scripts? I want to document how to setup git for windows users when using the share folder with linux
  5. Can you try to upgrade virtualbox to the latest version.

It looks like you have two workarounds:

  1. use wsk from inside the vm after vagrant ssh like you posted
  2. configure the outside wsk cli on windows with the apihost and key of the vagrant vm, maybe create a script to make it easy to swift from something like bluemix openwhisk and your VM running openwhisk.
lfzCarlosC commented 8 years ago

@csantanapr 1. When I execute the custom ,I got issue "symbolic link ‘wsk’ : protocol error" before I could ran wsk action command. So I do not know if the issue exists on custom.

  1. Yes, I would say the termnial would get error as presented above.
  2. I setup git bash or cygwin, the issue exists on both terminal.I just download installation file and then install on GUI, then I follow the openwhisk guide.

    For the 4th questions,I could provide some error info I encountered but I was blocked by the issue "symbolic link ‘wsk’ : protocol error".

  3. there are many scripts which has "command not found: \r ", to sole the issue,execute following command on your openwhisk directory: find ./ -name "_.sh" -print | xargs dos2unix
  4. after you solved the 1st issue, you will then get "Syntax error: invalid syntax " ,this is because various kind of script(gradle,python,java,....) has the format of ^M . execute following command on your openwhisk directory: a.txt find ./ -type f -name "_" -print | xargs sed -i 's/[ \t]*$//' Then comes the "symbolic link ‘wsk’ : protocol error" issue.

Also, we now want to use openwhisk command line to make our projects from cloud side also be runnable on local host environment. Do you think this Hello vm can suit this demand?

@dubeejw could you show your steps and all tools you use that you do on your windows paltform.

csantanapr commented 8 years ago

Fixed by #650