https://prefect.io logo
Title
p

Patrick Alves

12/02/2022, 4:19 PM
Hi there, I have dozens of workflows on Prefect Orion (v2.6.5) All my workflows are executed as
KubernetesJobs
. I’ve experiencing an issue when I run workflows from UI. 1. I select a Flow -> RUN 2. It schedules a Flow for the next seconds. 3. But the flow keep on pending forever. 4. It actually creates another flow that runs (with no tags, see the images) On the image every squared are actually the same RUN created twice. The original never run, and it creates a new one that runs.
k

Khuyen Tran

12/02/2022, 4:50 PM
Do you happen to have a subflow with the name
cls-check-computers
?
p

Patrick Alves

12/02/2022, 4:51 PM
No, I don’t have any subflow in any flow
k

Khuyen Tran

12/02/2022, 4:52 PM
I never saw this before. Do you experience the same issue using other infrastructures such as Process?
p

Patrick Alves

12/02/2022, 4:52 PM
I have not tried
I will make a video soon showing each step and send here
k

Khuyen Tran

12/02/2022, 4:57 PM
Thank you! That would be very helpful
p

Patrick Alves

12/02/2022, 5:42 PM
@Khuyen Tran here is the demo
Also, here is the main part of the code used to create the flow and deployment:
@task
def get_secrets_task():
    return xxxx


@task
def get_computers(ad_server, ad_user, ad_pass, days_no_logon=100):
    logger = get_run_logger()
    <http://logger.info|logger.info>("Recuperando informações de usuários do Active Directory")

    <http://logger.info|logger.info>(f"filtrando computadores presentes no AD que não logan há {days_no_logon} dias")

    return xxxx


# ====== Create the workflow ====== #
VERSION = 'v1.2.2'

@flow(
    name="cis-check-computers",
    description="Verifica computadores no Active Directory sem eventos de login por mais de 100 dias.",
    version=VERSION)
def check_computers(days_no_logon: int = 100):

    logger = get_run_logger()
    set_global_logger(logger)

    xxxxx

# ========== Create Deployment for Kubernetes ========== #
check_computers_deployment = Deployment.build_from_flow(
    flow = check_computers,
    name = 'check-computers',
    tags = ['cis', 'bot','kubernetes'],
    infrastructure = settings.KUBERNETES_JOB_BLOCK,
    infra_overrides=dict(
        namespace='prefect',
        image=settings.DOCKER_IMAGE,
        command=['python', 'workflows/check_computers/flow.py'],
    ),
    # Every weekday at 7:00 am
    schedule=(CronSchedule(cron="0 7 * * 1-5", timezone="America/Belem"))
)


if __name__ == "__main__":
    check_computers()
@Anna Geller Any tips?
a

Anna Geller

12/04/2022, 10:46 PM
you don't seem to have a work queue attached to your deployment, without it the agent can't pick that up
p

Patrick Alves

12/21/2022, 7:08 PM
@Anna Geller Sorry for the huge delay to give you a feedback I’ve redeployed the agents and workflows with a ’’prod” queue. The results was the same, the issue still happen. =(
a

Anna Geller

12/21/2022, 7:31 PM