<@ULVA73B9P> Why do I get State Message Submission...
# ask-marvin
m
@Marvin Why do I get State Message Submission failed. ValidationError: 1 validation error for Process command value is not a valid list (type=type_error.list) When I try to run flow in prefect UI. I dont have any parameters, it's a test function it just prints "hello"
m
It seems like you are encountering a common issue where there's a type-validation error triggered by passing an argument that is not interpreted as a list. This issue is most frequently encountered when dealing with infrastructure block specifics or parameter overrides in Prefect. ### Steps to Resolve ValidationError: not a valid list 1. Check the
deployment.yaml
File
: Ensure any parameters requiring lists are specified correctly. For example:
Copy code
yaml
    parameters:
      my_list_param:
        - value1
        - value2
2. Use Quotes When Specifying Lists in CLI: When you deploy via CLI, wrap your list values in quotes to ensure they are interpreted correctly.
Copy code
shell
   prefect deployment build ./flow.py:flow_function -n my_deploy -p '{"my_list_param": ["value1", "value2"]}'
3. Ensure Correct Flow Definition: Ensure your flow and task definitions are correctly set to handle parameter values passed.
Copy code
python
   from prefect import flow, task

   @task
   def say_hello():
       print("Hello")

   @flow
   def my_flow():
       say_hello()

   if __name__ == "__main__":
       my_flow()
4. Validate Parameter Types: Validate that parameters meet the expected types, particularly for infrastructure blocks like Kubernetes jobs where list and dictionary structures are required. 5. Check the Prefect Version and Known Issues: Confirm your Prefect version is up-to-date and review known issues which might affect function validations. For more details, you can refer to: - Prefect Flow Concepts - Kubernetes Job Block details (Prefect Issue #7911) If none of these resolve your issue, consider sharing more specific parts of your code or setup so we can investigate further.
m
@Marvin This is my main.py @flow(name="Price Scrapper") def run_spider(): print("TestING") def main(): run_spider() def serve(): run_spider.serve("price-scrap") if name == "__main__": main() it works when I run locally, output it 191014.138 | INFO | prefect.engine - Created flow run 'frisky-foxhound' for flow 'Price Scrapper' TestING 191014.245 | INFO | Flow run 'frisky-foxhound' - Finished in state Completed()
m
It appears there isn't a direct solution provided in the available documentation or GitHub issues for the exact message you're encountering. However, based on common practices and similar issues, here's an action plan you can try to resolve the issue: ### Debugging Steps 1. Flow Script Review: Ensure there are no hidden parameters or system configurations expecting lists.
Copy code
python
    from prefect import flow

    @flow(name="Price Scrapper")
    def run_spider():
        print("TestING")

    def main():
        run_spider()

    if __name__ == "__main__":
        main()
2. Review Deployment and Execution: - When creating and running deployments, make sure to use correct commands especially around parameter passing. A common source of issues is incorrect parameter formatting. 3. Check Prefect Version Compatibility: Ensure all components of Prefect (SDK, UI, etc.) are compatible and up to date. - You can check the current Prefect version using:
Copy code
shell
      prefect version
4. CLI Command Formatting: - If using CLI for deployment, ensure list parameters are correctly formatted. CLI commands can sometimes misinterpret JSON parameters.
Copy code
shell
    prefect deployment build ./__main__.py:run_spider -n my_deploy -p '{"list_param": ["value1", "value2"]}'
5. Check Worker Configuration: - Ensure your workers are configured correctly and accepting task runs. Mismatched worker configurations can cause unexpected errors. ### Additional Resources - Prefect Documentation: Flow Concepts - GitHub Issues and Examples: Check for code snippets and example flows Prefect GitHub Issues If the issue persists, consider sharing more details on your workflow configuration or any custom infrastructure blocks.