serverless-openwhisk icon indicating copy to clipboard operation
serverless-openwhisk copied to clipboard

Default Python template does not deploy

Open jthomas opened this issue 5 years ago • 2 comments

Report from OpenWhisk slack: serverless create --template openwhisk-python --path pyhton-test

serverless deploy -v
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Compiling Functions...
Serverless: Compiled Function (tryme): {"actionName":"pyhton-test-dev-tryme","overwrite":true,"action":{"exec":{"main":"tryme","kind":"python","code":"<hidden>"},"limits":{"timeout":60000,"memory":256,"concurrency":1},"parameters":[],"annotations":[]}}
Serverless: Compiling Packages...
Serverless: Compiling API Gateway definitions...
Serverless: Compiling Rules...
Serverless: Compiling Triggers & Feeds...
Serverless: Compiling Service Bindings...
Serverless: Deploying Functions...
Serverless: Deploying Function: pyhton-test-dev-tryme

  Serverless Error ---------------------------------------

  Failed to deploy function (pyhton-test-dev-tryme) due to error: PUT https://10.113.78.22:31001/api/v1/namespaces/_/actions/pyhton-test-dev-tryme?overwrite=true Returned HTTP 400 (Bad Request) --> "The request content was malformed:
kind 'python' not in Set(dotnet:2.2, go:1.11, nodejs:10, ballerina:0.990, ruby:2.5, nodejs:8, blackbox, java, swift:4.2, sequence, nodejs:6, nodejs:12, python:3, python:2, php:7.3)"

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     OS:                     linux
     Node Version:           6.17.1
     Serverless Version:     1.46.1

jthomas avatar Jul 02 '19 16:07 jthomas

The key here is serverless create template it may just be less confusing if the templates were python:2 python:3 or python:default

I always forget when coming back to issues later.

mjschmidt avatar Jul 02 '19 16:07 mjschmidt

For now the work around is after template creation to go in and change the runtime in serverless.yml and specify which python is being used. For example python 3 needs to be changed from

provider:
  name: openwhisk
  runtime: python

TO

provider:
  name: openwhisk
  runtime: python:3

mjschmidt avatar Jul 02 '19 16:07 mjschmidt