Example project function-handler-java does not work out of the box
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with containers/function-handler-java, following README.md and the reported serverless deploy command. Inspect serverless.yml alongside the plugin's validateCredentials path and the directory versus registryImage configuration; done means credentials from config.yaml work and the example deploys from its directory without the registry-image error.
Written by the indexing model from the issue text.
Description
Hi there,
I would like to report my findings when using the example function-handler-java (in the containers folder).
Preparations
I followed the steps in Setup from the README.md. So I did the following steps:
- Install and configure Serverless Framework
- Install the Scaleway plugin
git clone git@github.com:scaleway/serverless-examples.git
cd serverless-examples/containers/function-handler-java
npm install
serverless deploy
Expectations
The example will deploy to the Scaleway cloud.
Actual Result
I got the stacktrace below.
Using credentials from /Users/boukenijhuis/.config/scw/config.yaml
Using credentials from /Users/boukenijhuis/.config/scw/config.yaml
Using credentials from /Users/boukenijhuis/.config/scw/config.yaml
Using credentials from /Users/boukenijhuis/.config/scw/config.yaml
Using credentials from /Users/boukenijhuis/.config/scw/config.yaml
Using credentials from /Users/boukenijhuis/.config/scw/config.yaml
Environment: darwin, node 20.19.5, framework 3.58.0
Docs: github.com/oss-serverless/serverless
Error:
TypeError: Cannot read properties of undefined (reading 'length')
at ScalewayDeploy.validateCredentials (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/serverless-scaleway-functions/shared/validate.js:163:30)
at ScalewayDeploy.tryCatcher (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/async.js:102:5)
at Async.drainQueues [as _onImmediate] (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/bluebird/js/release/async.js:15:14)
at process.processImmediate (node:internal/timers:483:21)
When you go the top item in the stacktrace, you will find this:
validateCredentials() {
if (
this.provider.scwToken.length !== 36 ||
this.provider.getScwProject().length !== 36
) {
After Googling 'scwToken' I found this example:
https://www.serverless.com/plugins/serverless-scaleway-serverless#general-configuration
This example shows that I have to add the following two keys:
- scwToken
- scwProject
I do not understand why I need these two keys. Especially because the output above states that it uses credentials from /Users/boukenijhuis/.config/scw/config.yaml. So this mechanism seems to be broken?
After adding the two keys above (scwToken & scwProject), I get the following error.
Using credentials from serverless.yml
Using credentials from serverless.yml
Using credentials from serverless.yml
Using credentials from serverless.yml
Using credentials from serverless.yml
Using credentials from serverless.yml
Updating container function-handler-java...
Environment: darwin, node 20.19.5, framework 3.58.0
Docs: github.com/oss-serverless/serverless
Error:
Error: image not found in scaleway container registry
at manageError (/Users/boukenijhuis/git/function-handler-java-clean/node_modules/serverless-scaleway-functions/shared/api/utils.js:53:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
So the credential logging is changed from a config.yaml to the serverless.yml as expected, but now serverless expects me to use a scaleway container registry, but the serverless.yml specifies that I want to use a directory.
I went down the rabbit hole to get everything working with a registry image, but I prefer to just use a directory.
So two questions:
- How do I get serverless to use my credentials from the config.yaml?
- How do I get serverless to work with a directory (instead of a registryImage)?
- Dominant language
- Go
- Stars
- 64
- Forks
- 14
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from scaleway/serverless-examples
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
scaleway/serverless-examples#110 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in scaleway/serverless-examples
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100