[Python] Prefect deployment triggered via API fails with FileNotFoundError: Missing directory,...

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    we have an api endpoint where a user makes a request from the api and it triggers prefect deployment using the deployment id and gives the request to the deployed flow to process it anytime it gets triggered the deployment crashes Failed due to a(n) FileNotFoundError caused by missing directory 'features/xxx'. Further investigation needed to ensure the correct directory path is provided. But mind you its in the right directory my project structure

    ` -- .env
    |-- .gitignore
    |-- .gitmodules
    |-- .prefectignore
    |-- .python-version
    |-- README.md
    |-- __init__.py
    |-- database.log
    |-- features
    |-- __init__.py
    |-- xxx .py
    |-- xxx-data -- git submodule
    `


    This is my yaml file
    prefect.yaml (for local development)
    name: xxxx-prefect
    prefect-version: 3.2.15

    No need for build/push if working locally
    build: null
    push: null

    pull:
    prefect.deployments.steps.set_working_directory:
    directory: .

    Deployment configuration
    deployments:
    name: xxxxx
    version: 1.0.0
    tags:
    story
    ai
    generation
    description: xxx
    entrypoint: features.xxx:x-flow
    parameters:
    request_id: "The ID of the request to process"
    work_pool:
    name: xxx-pool
    work_queue_name: default



    please i really need help with this

    i tried the above yaml file to trigger the deployed flow on prefect

    Continue reading...

Compartilhe esta Página