Thibaud
05/22/2023, 8:51 AMimran
05/22/2023, 10:26 AMGOWRAV TATA
05/22/2023, 10:45 AMKanishk
05/22/2023, 1:07 PMHuw Ringer
05/22/2023, 2:01 PMkasteph
05/22/2023, 3:15 PMJustin Trautmann
05/22/2023, 4:12 PMPedro Machado
05/22/2023, 4:45 PMprefect worker start
command seems to be ignoring the queue. The worker starts and polls Prefect Cloud, but it seems to be connecting the default queue.
I am starting the worker with prefect worker start --pool local-pool --work-queue ingest-tracker
Has anyone else run into this?Simon
05/22/2023, 6:20 PMDeployment.build_from_flow
, am setting is_schedule_active=ENV == "production"
based upon whether the env is production, or not. This is determined by an import from another file:
from common.config import ENV
and in that file is:
# have also tried dotenv.find_dotenv() without success
dotenv_path = os.path.abspath(os.path.join(__file__, "../../../.env"))
if not os.path.isfile(dotenv_path):
raise RuntimeError(dotenv_path)
This loads happily in a local ipython shell. But when run as a prefect flow, the folder structure appears to be different:
Flow could not be retrieved from deployment.
Traceback (most recent call last):
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/private/var/folders/d8/sqvg_pms3pd0xvcl2tvvxhqr0000gn/T/tmp8e6a8h47prefect/prefect_daily_internal_metric.py", line 9, in <module>
from common.config import ENV
File "/private/var/folders/d8/sqvg_pms3pd0xvcl2tvvxhqr0000gn/T/tmp8e6a8h47prefect/common/config.py", line 9, in <module>
raise RuntimeError(dotenv_path)
RuntimeError: /private/var/folders/d8/sqvg_pms3pd0xvcl2tvvxhqr0000gn/T/.env
Meyy
05/22/2023, 8:03 PMpsycopg2.ProgrammingError: no results to fetch
The flow has bunch of tasks which shares redshift connection across the tasks and it fails in the first task. Any idea why this could happen?Pedro Machado
05/22/2023, 8:32 PMRobert Esteves
05/22/2023, 9:10 PMRafał Bielicki
05/22/2023, 9:13 PMSoami Charan
05/23/2023, 3:00 AMNitin Bansal
05/23/2023, 3:17 AMSoami Charan
05/23/2023, 3:45 AMDeployment-1
.
Step 3: Prefect Server is killed/stopped.
Step 4: After some time, restarted Prefect Server.
So the flow run for Deployment-1
stuck in running status and its neither CRASH
or CANCEL
.
So how to handle such scenarios??Nitin Bansal
05/23/2023, 9:04 AMdef setdatabaseconnection():
connector = SqlAlchemyConnector(
connection_info=ConnectionComponents(
driver=SyncDriver.POSTGRESQL_PSYCOPG2,
username="postgres",
password="",
host="localhost",
port=5432,
database="claimshero_dev",
)
)
connector.save("CH_DATABASE_CONNECTION")
Error : pydantic.error_wrappers.ValidationError: 2 validation errors for BlockDocumentCreate
name
name must only contain lowercase letters, numbers, and dashes (type=value_error)
root
Names must be provided for block documents. (type=value_error)Soami Charan
05/23/2023, 9:14 AMGiacomo Chiarella
05/23/2023, 1:08 PMAndré Dias
05/23/2023, 2:52 PMcontainerDefinition
inside my task_definition
field. I created the Deployment from:
deployment = Deployment.build_from_flow(
flow=template_local_flow,
name="staging",
infrastructure=ECSTask.load("staging"),
work_queue_name="staging",
path="/opt/prefect/flows",
output='staging-deployment.yaml'
)
My docker image looks like this:
FROM prefecthq/prefect:2-python3.10
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get autoremove -y
COPY --from=golang:latest /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
RUN apt-get install -y python3 python3-dev python3-pip git
RUN cd /opt && \
git clone <https://github.com/zmap/zdns> && \
cd zdns && \
go build && \
ln -s /opt/zdns/zdns /usr/local/bin
RUN mkdir -p /opt/prefect/flows
ADD . /opt/prefect/flows
RUN pip3 install -r /opt/prefect/flows/requirements.txt
WORKDIR /opt/prefect/flows
ENV PYTHONPATH "${PYTHONPATH}:/opt/prefect/flows"
My deployment.yaml
specifies:
storage: null
path: /opt/prefect/flows
entrypoint: flow.py:template_local_flow
But when I run and trigger a flow in the UI, all my container outputs is the PREFECT
message. Can anyone help please?Ouail Bendidi
05/23/2023, 2:52 PM--runtime nvidia
but I don't see that option anywhere ?John O'Farrell
05/23/2023, 3:15 PMFREQ=HOURLY;INTERVAL=1;WKST=MO;BYDAY=MO,TU,WE,TH,FR;BYMINUTE=30
but instead of generating one flow each for 9:30, 10:30, 11:30 etc it seems like it creates multiple flows for these hours. Was wondering if there was a way I could solve this without having to manually adjust the PREFECT_API_SERVICES_SCHEDULER_MIN_RUNS
valueRoman
05/23/2023, 3:38 PMGiacomo Chiarella
05/23/2023, 4:17 PM16:12:02.611 | ERROR | asyncio - Exception in callback SubprocessStreamProtocol.pipe_data_received(1, b'\x1b[0m16:1...m in 0.12s]\n')
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: handle: <Handle SubprocessStreamProtocol.pipe_data_received(1, b'\x1b[0m16:1...m in 0.12s]\n')>
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: Traceback (most recent call last):
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: self._context.run(self._callback, *self._args)
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: File "/usr/lib/python3.9/asyncio/subprocess.py", line 73, in pipe_data_received
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: reader.feed_data(data)
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: File "/usr/lib/python3.9/asyncio/streams.py", line 472, in feed_data
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: assert not self._eof, 'feed_data after feed_eof'
May 23 16:12:02 ip-172-30-1-204 start_agent.sh[1481686]: AssertionError: feed_data after feed_eof
prefect 2.10.10Giacomo Chiarella
05/23/2023, 4:21 PMOshri
05/23/2023, 4:29 PMConstantino Schillebeeckx
05/23/2023, 5:01 PMnew_state
variable including new_state.message
, new_state.result
and even new_state.___getstate___()
- however none of those state attributes gets me anything meaningful. All I can ever find is "'Some reference tasks failed.'"Nathan Low
05/23/2023, 6:03 PMYufei Li
05/23/2023, 6:07 PMpip install prefect-sendgrid
, I ran to an issue. Any suggestions for that?
ERROR: Could not find a version that satisfies the requirement prefect-sendgrid (from versions: none)
ERROR: No matching distribution found for prefect-sendgrid
Alec Taggart
05/23/2023, 7:09 PMbitbucket_repository_block = BitBucketRepository.load("prefect-bitbucket-repo")
deployment = Deployment.build_from_flow(
flow = test_flow,
name = "test_deployment",
work_pool_name = "default-agent-pool",
storage = bitbucket_repository_block,
path = "/tmp/prefect/",
entrypoint = "flows/test.py:test_flow",
tags=["DEV"]
)
deployment.apply()
However when I deploy this and start a run, the agent generates this error:
12:48:47.460 | INFO | Flow run 'cornflower-leopard' - Downloading flow code from storage at '/tmp/prefect/'
12:48:48.987 | ERROR | Flow run 'cornflower-leopard' - Flow could not be retrieved from deployment.
...
...
distutils.errors.DistutilsFileError: cannot copy tree '/tmp/prefect': not a directory
Any ideas?