hashicorp / faas-nomad

OpenFaaS plugin for Nomad
https://www.openfaas.com
MIT License
254 stars 46 forks source link

Unexpected status: 502 when deploying function #28

Closed rogerwelin closed 6 years ago

rogerwelin commented 6 years ago

What are the steps to reproduce this issue?

  1. faas-cli deploy -f ./gofunction.yml

What happens?

_Deploying: gofunction.

Unexpected status: 502, message:_

No error message is given except the empty message. Hints on how to debug this further would be very welcome

What versions of software are you using?

Operating System: Fedora 26 OpenFaaS Version: functions/gateway:0.6.14 & faas-nomad:0.2.16 faas-cli Version: 0.6.2 Nomad Version: 0.7.0

Function file: provider: name: faas gateway: http://10.48.4.59:8080

functions: gofunction: lang: go handler: ./gofunction/handler image: rogerw/gofunction

nicholasjackson commented 6 years ago

Hey, so the 502 is coming from the Gateway which delegates the deployment to the Nomad provider. The gateway is returning a 502 because the provider has reported a problem when trying to start the function but it is not returning why.

If you look at the logs for the Nomad provider docker logs [faas-nomad id] this should give more info, could you also give the latest provider a go v0.2.22. I know the gateway changed the way that deployments happened which I fixed in version v0.2.22 however I can't remember which gateway version it was either .14 or .15

alexellis commented 6 years ago

Good luck.. would be curious to find out what's in the log too. Nic we have 0.7.0 of the gateway available now with some performance improvements.

rogerwelin commented 6 years ago

@nicholasjackson thanks for the quick response! I can confirm faas-cli worked with version 0.2.22 of faas-nomad and gateway 0.6.14. However the log output of nomad logs [alloc-id] nomadd only logs the following at startup and then nothing more:

2018-02-15T10:09:48.594Z [INFO ] nomadd: Using StatsD server:10.48.4.59:9125 2018-02-15T10:09:48.594Z [INFO ] nomadd: Started version: 0.2.22

nicholasjackson commented 6 years ago

I think it logs the main output to StdErr, glad you got this working, there was an update in the gateway which added support for rolling updates which is super cool. I had to add a new handler to the Nomad provider. I will give 0.7.0 a test with the latest provider tonight and if all is well, will update the default job files.