-
Notifications
You must be signed in to change notification settings - Fork 216
When validate=true, Map state machines in DISTRIBUTED mode incorrectly throw a yaml validation error #540
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
Comments
Here is an example using |
Hi, i encountered the same issue. When deploying with |
Glad to hear it's replicatable! Do you have any idea where the schema is being pulled from to validate it, and why it's failing @Yitzchak-SB ? |
I'm facing the same issue. It replicable because the current release do not support the latest changes from Step Functions. I turned off the validation for now. Here's the info of the currently supported attributes from AWS. |
@Yitzchak-SB @akshaydk Error: ServerlessError: State machine [workflow] is malformed. Please check the README for more info. ValidationError: "validate" is not allowed My Configuration: Edit: This issue was fixed after updating my serverless version |
As of 3.13.1 it is still failing validations. I am still getting an issue trying to include
|
I believe this is working on
But the problem was in me setting Looking at what was actually created in AWS, it looks correct "SomeMap": {
"Type": "Map",
"ItemsPath": "$.Response",
"ItemProcessor": {
"ProcessorConfig": {
"Mode": "DISTRIBUTED",
"ExecutionType": "STANDARD"
},
"StartAt": "SomeTask",
"States": {
"SomeTask": {
"Type": "Pass",
"Result": "$$.Execution.Input",
"End": true
}
}
},
"End": true
}
} |
This is a (Bug Report / Feature Proposal)
Description
Attempting to deploy a state machine with Map in Distributed mode:
https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html
serverless.yml
This fails:
However, when I turn the validator off and let it try to update on AWS cloudformation, it succeeds:
$ sls deploy Running "serverless" from node_modules Deploying semler-measurement-quality to stage dev (us-east-1) ✔ Service deployed to stack semler-measurement-quality-dev (121s)
Notes
It's important to realize that when in distributed map state, "
Iterator
" must be replaced with "ItemProcessor
"https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html#map-state-distributed-additional-fields
I'm assuming the validator here in this plugin
serverless-step-functions/lib/deploy/stepFunctions/compileStateMachines.js
Line 120 in 42bd423
just pulls
calls the main serverless validator function here
https://github.com/serverless/serverless/blob/906ea319dd1486f79d6e088a999fd5634526c4bc/lib/classes/config-schema-handler/index.js#L77
which somehow compares the known schema to something (pulled from AWS?).
That's as far as I was able to dig into the code. I couldn't find where the schema for the "
ItemProcessor
" yaml section was being defined, perhaps on AWS cloud or perhaps I just couldn't find it in the code.But regardless, it seems that the validator expects only
Iterator
instead ofItemProcessor
and therefore will not allow the user to use the map in distributed mode.Additional Data
$ sls --version Running "serverless" from node_modules Framework Core: 3.24.1 (local) 3.24.1 (global) Plugin: 6.2.2 SDK: 4.3.2
cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
(Error messages provided above)
The text was updated successfully, but these errors were encountered: