Hi! I’ve been encountering below error with self-hosted prefect server. Have verified worker was dep...
c

Christine Chen

11 months ago
Hi! I’ve been encountering below error with self-hosted prefect server. Have verified worker was deployed to the same namespace. Any ideas? Prefect version: 3.0.4 Server/worker chart version: 2024.10.1175730
Failed to submit flow run '46744906-60cd-410c-a04c-12d7a80917cf' to infrastructure.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/prefect/workers/base.py", line 985, in _submit_run_and_capture_errors
    await self._give_worker_labels_to_flow_run(flow_run.id)
  File "/usr/local/lib/python3.11/site-packages/prefect/workers/base.py", line 1232, in _give_worker_labels_to_flow_run
    await self._client.update_flow_run_labels(flow_run_id, labels)
  File "/usr/local/lib/python3.11/site-packages/prefect/client/orchestration/__init__.py", line 2950, in update_flow_run_labels
    response = await self._client.patch(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1933, in patch
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1540, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 355, in send
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 163, in raise_for_status
    raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '404 Not Found' for url '<http://prefect-server>.{namespace}.svc.cluster.local:4200/api/flow_runs/46744906-60cd-410c-a04c-12d7a80917cf/labels'
Response: {'detail': 'Not Found'}
1
Hi all, after successfully utilizing an ecs:push workpool with my own provisioned AWS infrastructure...
m

mira

about 2 years ago
Hi all, after successfully utilizing an ecs:push workpool with my own provisioned AWS infrastructure to deploy my flow to and run it on the ecs cluster, I was curious about the new feature to let prefect provision the infrastructure 😃 Unfortunately, it doesn't work as expected. I created the ecs: push work pool as suggested (https://github.com/PrefectHQ/prefect/pull/11267) and after that I deployed my flow to it as usually, but without job-variables (since I don't have to ingest the AWS infrastructure and role arns now). I want to push the flow image to my ecr repo, so I give this with the name of the image to my Deployment like this:
flow.deploy(
    ...
    image=DeploymentImage(
        name=os.getenv("ECR_REPO_URL", ""),
        tag=os.getenv("IMAGE_TAG"),
        dockerfile=cfd / "Dockerfile",
    ),
    ...
)
But then I get the error: Flow run could not be submitted to infrastructure: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Fargate requires task definition to have execution role ARN to support ECR images. Why do I still have to provision the deployment with an execution role, shouldn't it (or the work pool) create one? Or is it because it is a my own ECR Repo? Where do you usually push / save the flow image to run it on the ecs cluster (especially in the frame of the ecs:push work pool with infra provisioning)? Thank you and best regards!
🤔 1
1
Hello , I am trying to run a prefect in docker. I looked in this community. But it seems that there ...
o

omiakif

about 1 year ago
Hello , I am trying to run a prefect in docker. I looked in this community. But it seems that there is no proper docker compose file for prefect. I was trying to use this for the prefect docker compose. I am very new to docker. So, I tried to write a docker compose to up and prefect. I am also learning prefect very recently. I tried to write the docker compose below following this example. Is there any proper docker compose.yml file that I can use to create nodes for prefect and view the prefect dashboard? The dashboard is not showing. I am looking for docker-compose.yml for prefect v3. Thank you in advance for any assistance. https://github.com/PrefectHQ/prefect-background-task-examples/blob/main/chaos-duck/docker-compose.yaml But I seem to be encountering this issue in the docker compose logs.
prefect  | During handling of the above exception, another exception occurred:
prefect  | 
prefect  | Traceback (most recent call last):
prefect  |   File "/usr/local/bin/prefect", line 8, in <module>
prefect  |     sys.exit(cli())
prefect  |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
prefect  |     return self.main(*args, **kwargs)
prefect  |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1055, in main
prefect  |     rv = self.invoke(ctx)
prefect  |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
prefect  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
prefect  |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
prefect  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
prefect  |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
prefect  |     return ctx.invoke(self.callback, **ctx.params)
prefect  |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 760, in invoke
prefect  |     return __callback(*args, **kwargs)
prefect  |   File "/usr/local/lib/python3.7/site-packages/prefect/cli/server.py", line 674, in start
prefect  |     ["docker-compose", "down"], cwd=compose_dir_path, env=env
prefect  |   File "/usr/local/lib/python3.7/subprocess.py", line 411, in check_output
prefect  |     **kwargs).stdout
prefect  |   File "/usr/local/lib/python3.7/subprocess.py", line 488, in run
prefect  |     with Popen(*popenargs, **kwargs) as process:
prefect  |   File "/usr/local/lib/python3.7/subprocess.py", line 800, in __init__
prefect  |     restore_signals, start_new_session)
prefect  |   File "/usr/local/lib/python3.7/subprocess.py", line 1551, in _execute_child
prefect  |     raise child_exception_type(errno_num, err_msg, err_filename)
prefect  | FileNotFoundError: [Errno 2] No such file or directory: 'docker-compose': 'docker-compose'
My docker-compose.yml
services:

  postgres:
    image: postgres:16
    restart: always
    environment:
      POSTGRES_USER: prefect
      POSTGRES_PASSWORD: password
      POSTGRES_DB: prefect
    volumes:
      - postgres-data:/var/lib/postgresql/data
    networks:
      - prefect-net

  prefect:
    image: prefecthq/prefect:latest
    container_name: prefect
    restart: always
    environment:
      PREFECT_HOME: /data
      PREFECT_API_DATABASE_CONNECTION_URL: <postgresql+asyncpg://prefect:password@postgres/prefect>
    command: prefect server start
    ports:
      - "4200:4200"
    volumes:
      - prefect-data:/data
    depends_on:
      - postgres
    networks:
      - prefect-net

volumes:
  postgres-data:
  prefect-data:

networks:
  prefect-net: