Slackbot
10/25/2024, 1:27 AMMarvin
10/25/2024, 1:27 AMMy deployment's Docker doesn't have psycopg2 included. All my deployments fail, and when I look at the docker logs it's states such. I've included it in my prefect.yaml but I still get the same error. Why is this occurring? Here's my prefect.yaml file:```# Welcome to your prefect.yaml file! You can use this file for storing and managing # configuration for deploying your flows. We recommend committing this file to source # control along with your flow code. # Generic metadata about this project name: marketing prefect-version: 3.0.10 # build section allows you to manage and build docker images build: - prefect.deployments.steps.run_shell_script: id: get-commit-hash script: git rev-parse --short HEAD stream_output: false - prefect.deployments.steps.run_shell_script: id: get-prefect-version script: prefect --version stream_output: false - prefect_docker.deployments.steps.build_docker_image: requires: prefect-docker>=0.3.0 image_name: 10.10.4.100:5000/get_app_list_landing tag: '{{ get-prefect-version.stdout }}-{{ get-commit-hash.stdout }}' # TODO: Change this full directory before you check in to Git dockerfile: /home/myusername/development/marketing/src/p
Nate
10/25/2024, 1:30 AMNate
10/25/2024, 1:30 AMKlashe
10/25/2024, 1:32 AMNate
10/25/2024, 1:33 AMKlashe
10/25/2024, 1:36 AMFROM prefecthq/prefect:3.0.10-python3.10
ARG EXTRA_PIP_PACKAGES="psycopg2-binary"
RUN pip install $EXTRA_PIP_PACKAGES
And the error I receive is this:
File "/usr/local/lib/python3.12/site-packages/prefect/utilities/importtools.py", line 168, in load_script_as_module
raise ScriptError(user_exc=exc, path=path) from exc
prefect.exceptions.ScriptError: Script at 'src/etl/landing/vendor/get_app_list_landing_etl_prefect.py' encountered an exception: ModuleNotFoundError("No module named 'psycopg2'")
01:11:33.340 | ERROR | prefect.flow_runs.runner - Process for flow run 'stereotyped-skink' exited with status code: 1
01:11:33.396 | INFO | prefect.flow_runs.runner - Reported flow run '6c7ee467-1007-4131-a23b-d8abc80b6704' as crashed: Flow run process exited with non-zero status code 1.
01:11:33.639 | INFO | prefect.deployment - Cloned repository '<http://10.10.4.100:3302/me/marketing.git>' into 'marketing-main'
> Running git_clone step...
Klashe
10/25/2024, 1:41 AMprefect @ file:///opt/prefect/dist/prefect.tar.gz#sha256=35bc6e270751ee081b37857e67a73d9492a690534ed418d49370a5bc22658ed2
prefect-docker==0.6.1
prometheus_client==0.21.0
prompt_toolkit==3.0.47
protobuf==5.28.1
psutil==6.0.0
psycopg2-binary==2.9.9 <---------
Nate
10/25/2024, 2:30 AMKlashe
10/25/2024, 3:06 AM