EricssonResearch / calvin-base

Calvin is an application environment that lets things talk to things, among other things.
Apache License 2.0
282 stars 91 forks source link

problem with executing csruntime --host localhost hello.calvin #84

Closed samsimsim closed 7 years ago

samsimsim commented 7 years ago

Hi, I'm trying to execute this code $ csruntime --host localhost hello.calvinin the mini tutorial, but I get this:

2017-09-08 16:51:28,040 ERROR 2286-calvin.calvin.utilities.runtime_credentials: get_domain: error while trying to read domain from Calvin config, err=argument of type 'NoneType' is not iterable 2017-09-08 16:51:28,040 INFO 2286-calvin.calvin.runtime.north.calvincontrol: Control API trying to listening on: localhost:5001 DEPLOY STATUS 200, OK Deployed application 38835e32-a853-449c-9aeb-1c402e5561c5 2017-09-08 16:51:30,965 INFO 2286-calvin.calvin.runtime.north.calvin_node: All done, exiting 2017-09-08 16:51:30,980 INFO 2286-calvin.calvin.runtime.north.calvin_node: Quitting node "['calvinip://localhost:5000']"

I suppose to get something like this: Deployed application 922a2096-bfd9-48c8-a5a4-ee900a180ca4 2016-07-11 08:20:34,667 INFO 11202-calvin.Log: Hello, world 2016-07-11 08:20:35,667 INFO 11202-calvin.Log: Hello, world

Any help would be appreciated. Thanks!

persquare commented 7 years ago

2017-09-08 16:51:28,040 ERROR 2286-calvin.calvin.utilities.runtime_credentials: get_domain: error while trying to read domain from Calvin config, err=argument of type 'NoneType' is not iterable

This is actually OK. It just means that Calvin's security isn't configured on your machine and it will fall back to running with security disabled. The log message should really be changed to something more informative.

2017-09-08 16:51:28,040 INFO 2286-calvin.calvin.runtime.north.calvincontrol: Control API trying to listening on: localhost:5001 DEPLOY STATUS 200, OK Deployed application 38835e32-a853-449c-9aeb-1c402e5561c5

This is actually confirmation that your example is running...

2017-09-08 16:51:30,965 INFO 2286-calvin.calvin.runtime.north.calvin_node: All done, exiting 2017-09-08 16:51:30,980 INFO 2286-calvin.calvin.runtime.north.calvin_node: Quitting node "['calvinip://localhost:5000']"

...and this is the runtime quitting as it is supposed to do when started like this.

However, the default is for the runtime to quit after 3s (!) when started with a file argument. I suspect that your runtime simply didn't have enough time to produce output. Try changing the keep-alive time to 10s or perhaps even longer

csruntime --host localhost --keep-alive 10 hello.calvin

and see if that helps.

The ability to add a script to the csruntime command is just convenience to allow quick testing of a script, the "normal" way to start a runtime is to start it without a script argument, in which case it will keep on running forever and you feed it applications using the cscontrol command.

samsimsim commented 7 years ago

Thank you! It works now.