Layer configuration error: 'xxx is not supported by layer'
This error indicates an incompatibility between the layer and the function's runtime. It can occur with custom, official public, and non-official public layers. This topic provides solutions for each case.
Symptoms
The following error message is reported:
InvalidArgument: code: 400, runtime: custom is not supported by layer:acs:fc:cn-hangzhou:official:layers/Java21/versions/1
Cause
The function's runtime is not included in the layer's list of compatible runtimes.
Solutions
Custom layers
Switch to a compatible layer, or republish the current one. To do so, create a new version of the layer and add the function's runtime to its list of compatible runtimes. For more information, see Create a custom layer.
Official public layers
View the list of official public layers supported by Function Compute to find compatible runtimes and usage instructions. You can then change the function's runtime or switch to a different official public layer. If no available official public layer meets your requirements, contact us.
The Function Compute documentation lists only the most common official public layers. For a complete list, see Public Layers.
Non-official public layers
Function Compute does not support or maintain non-official public layers. Contact the layer's provider to confirm its compatible runtimes and usage details.