Troubleshooting / Known issues
Help! My function isn’t working! All I get is a 404/blank page!
Here is a checklist of things that are easy to get wrong, while we are still working on integrating better error feedback into the CLI itself.
- Check the error message reported by our runtime, with
sfn function status.- State is stuck in creating: If
sfn function deploydid not report any specific error, this is likely a bug in our platform. Please report the issue to us! - “Knative error: “RevisionMissing: Configuration “…” does not have any ready Revision.“”: The runtime tried to run your function but failed to do so. Check the following points.
- State is stuck in creating: If
- Check for any log message from your function, with
sfn function logs. - Try running the function locally, using
sfn function buildfollowed bysfn function run. If the function runs into errors while starting up, the STACKIT runtime would never be able to forward requests to it.- To run the function locally with a memory limit, set the
cli.functions.stackit.cloud/local-memory-limit-mbannotation in yourrevision.yamlconfig to match the plan you are using. This can help debug out-of-memory issues.
- To run the function locally with a memory limit, set the
- Make sure you supply valid registry pull credentials. Otherwise, the STACKIT Functions won’t be able to pull your image. See also, Registry access.
- If you are using a custom-build container, ensure you specify a non-root numeric user in your OCI image specification (e.g. using
USER 1001in your Dockerfile). Also, ensure it is built for thelinux/amd64platform.
If you still don’t know why your function is failing to start, please get in touch!
Deploying a function results in a 502 Bad Gateway error
This means that the STACKIT Functions runtime was unable to read your OCI image’s metadata from the OCI Registry.
Ensure you have registered the registry pull-secret of your images registry Registry credentials. Otherwise, the runtime won’t be able to access the image.
I’m getting a dependency-related error when building an image
Please report the issue to us–it’s possible that we have missed an issue in the template / build process that needs ironing out for your use-case.
Consider building your images with Dockerfile if the supplied buildpacks fail to work for you.
My Java-based function builds way too slowly
The technology stack used for building Java images (LibericaNIK, through the Paketo Buildpacks) includes a relatively slow native compilation step. While that step ensures the final image runs a lot faster and with much less memory, it can increase build times by 2 minutes or more, depending on your machine.
Optimize the build for speed
You can optimize the native compilation step for build time instead of using the default optimization level. In our experience, this results in slightly larger OCI images, and may have runtime performance implications.
To set the optimization level you can configure the BP_NATIVE_IMAGE_BUILD_ARGUMENTS build environment variable in your revision.yaml config, as follows:
# .stackit-functions/revision.yaml
...
metadata:
annotations:
cli.functions.stackit.cloud/runtime: quarkus # or springboot
cli.functions.stackit.cloud/build-env/BP_NATIVE_IMAGE_BUILD_ARGUMENTS: '-Ob' # Optimize for build time
...
Disable native image building
If native image building still takes too long for your taste, you can disable it completely and use the Java Runtime Environment (JRE) instead. Note that you may need to use a larger plan for your function if you do that. In our experience, prebuilt native images use about 50% less memory and start ~300ms faster compared to their JRE equivalent.
To disable native image building set the BP_NATIVE_IMAGE and BP_MAVEN_ACTIVE_PROFILES build environment variables in your revision.yaml config, as follows:
# .stackit-functions/revision.yaml
...
metadata:
annotations:
cli.functions.stackit.cloud/runtime: quarkus # or springboot
cli.functions.stackit.cloud/build-env/BP_NATIVE_IMAGE: 'false' # Disable native image building
cli.functions.stackit.cloud/build-env/BP_MAVEN_ACTIVE_PROFILES: '' # Clear out the "native" maven profile set by default
...
What does state active mean?
The state represents the synchronization progress of a single function. An active state does not mean that the function is actively running as a pod in the cluster but that the cluster is aware of the functions existence.