openfaas / of-watchdog

Reverse proxy for STDIO and HTTP microservices
MIT License
259 stars 115 forks source link

Error deploying node8-express template to raspberrypi #19

Closed gaurangdave closed 5 years ago

gaurangdave commented 6 years ago

I tried to create sample express app from :

https://github.com/openfaas-incubator/node8-express-template

But I see the following error in logs after deployment. I am new to docker/openfaas so sincere apologies if this is due to some setup issue on my end.

faas-node-express.1.dp85hxbcd6i3@pi03    | Forking - node [index.js]
faas-node-express.1.dp85hxbcd6i3@pi03    | 2018/06/07 03:54:17 Started logging stderr from function.
faas-node-express.1.dp85hxbcd6i3@pi03    | 2018/06/07 03:54:17 Started logging stdout from function.
faas-node-express.1.dp85hxbcd6i3@pi03    | 2018/06/07 03:54:17 Error reading stdout: EOF

Expected Behaviour

Current Behaviour

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment

JohnOllhorn commented 5 years ago

I have exactly the same problem. it's my second function, the first one which is actually very similar runs error free.

I've also read this article here but I don't understand the solution... https://github.com/openfaas-incubator/of-watchdog/issues/26

alexellis commented 5 years ago

Which template did you both use?

You need to use ones which end armhf - in fact you're best using the template store for this where you can filter the platform

faas-cli template store list --platform=armhf

NAME                    SOURCE             DESCRIPTION
go-armhf                openfaas           Official Golang armhf template
python-armhf            openfaas           Official Python 2.7 armhf template
python3-armhf           openfaas           Official Python 3.6 armhf template
node10-express-armhf    openfaas-incubator NodeJS 10 Express armhf template
python3-flask-armhf     openfaas-incubator Python 3.6 Flask armhf template
node8-express-armhf     openfaas-incubator NodeJS 8 Express armhf template
golang-http-armhf       openfaas-incubator Golang HTTP armhf template
golang-middleware-armhf openfaas-incubator Golang Middleware armhf template
alexellis commented 5 years ago

@JohnOllhorn that issue you referenced is unrelated.

alexellis commented 5 years ago

You should only need to type in:

faas template store pull node8-express-armhf
faas-cli new --lang node8-express-armhf --prefix=alexellis2 alex-node-armhf
faas-cli up -f alex-node-armhf.yml

From there edit the handler.js to change the result you return depending on your needs and add any npm modules you want to consume too.

alexellis commented 5 years ago

I have no issues at all accessing my new function on an RPi:

Forking - node [index.js]
2019/01/13 09:41:10 Started logging stdout from function.
2019/01/13 09:41:10 Started logging stderr from function.
2019/01/13 09:41:10 OperationalMode: http
2019/01/13 09:41:10 Writing lock-file to: /tmp/.lock
2019/01/13 09:41:12 stdout: OpenFaaS Node.js listening on port: 3000

2019/01/13 09:41:20 GET / - 200 OK - ContentLength: 25

It seems like the template is still working as designed, so I would suggest you both join the Slack community and send a message there with your GitHub repo so the community can help you.

https://docs.openfaas.com/community