Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot submit function : handler value is invalid #254

Open
JesusTheHun opened this issue Sep 13, 2023 · 1 comment
Open

Cannot submit function : handler value is invalid #254

JesusTheHun opened this issue Sep 13, 2023 · 1 comment

Comments

@JesusTheHun
Copy link

I'm trying to deploy a serverless function using this code :

const provider = new scaleway.Provider('scaleway-par-2', {
  region: 'fr-par',
});

const coreApiFunctionNamespace = new scaleway.FunctionNamespace('coreApi', undefined, { provider });
const coreApiFunction = new scaleway.Function(
  'mainFunction',
  {
    description: 'Core API',
    namespaceId: coreApiFunctionNamespace.id,
    runtime: 'node20',
    handler: 'function.handle',
    privacy: 'public',
    maxScale: 5,
    deploy: true,
    zipFile: lambda.zipFilePath,
    zipHash: lambda.zipFileHash,
  },
  { provider }
);

Which ends up with this error :

scaleway-sdk-go: http error 400 Bad Request: function name must consist of lower case alphanumeric characters or '-', starts and ends with an alphanumeric character

So I tried to rename my function file to handler.js and used handle for the handler property, which got me this error :

scaleway-sdk-go: http error 400 Bad Request: handler value is invalid

The function works fine locally and the archive is valid.
I uploaded the exact same archive with function.handle as a handler from the Scaleway dashboard, and it works just fine, the deployment is ok and I've got a response when I invoke the function.

Versions:

@pulumi/pulumi: 3.82.0
@lbrlabs/pulumi-scaleway: 1.7.0

I don't use version 1.10.0 because it's broken. See #250 #251 #252.

@benjick
Copy link

benjick commented Oct 14, 2023

Nice workaround with 1.7.0, too bad Cockpit isn't available on that version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants