trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: Nested `requirements.txt`of `pythonExtension()` fails during build of deployment + requirements warning

Open luap2703 opened this issue 9 months ago • 3 comments

Provide environment information

  System:
    OS: macOS 15.2
    CPU: (12) arm64 Apple M2 Pro
    Memory: 99.23 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.0 - /opt/homebrew/bin/node
    Yarn: 4.5.1 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /opt/homebrew/bin/npm

Describe the bug

When deploying to production using pythonExtension and a nested requirements.txt, the build fails with following logs:

#11 DONE 82.8s
#12 [base 2/6] RUN apt-get update && apt-get install -y --no-install-recommends               python3 python3-pip python3-venv &&               apt-get clean && rm -rf /var/lib/apt/lists/*
#12 CACHED
#13 [base 3/6] RUN python3 -m venv /opt/venv
#13 CACHED
#14 [base 4/6] COPY ./packages/core/core-analytics/python/requirements.txt .
#14 DONE 0.1s
#15 [base 5/6] RUN pip install --no-cache-dir -r ./packages/core/core-analytics/python/requirements.txt
#15 0.278 ERROR: Could not open requirements file: [Errno 2] No such file or directory: './packages/core/core-analytics/python/requirements.txt'
#15 ERROR: process "/bin/sh -c pip install --no-cache-dir -r ./packages/core/core-analytics/python/requirements.txt" did not complete successfully: exit code: 1
------
> [base 5/6] RUN pip install --no-cache-dir -r ./packages/core/core-analytics/python/requirements.txt:
#15 0.278 ERROR: Could not open requirements file: [Errno 2] No such file or directory: './packages/core/core-analytics/python/requirements.txt'
------
Error: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r ./packages/core/core-analytics/python/requirements.txt" did not complete successfully: exit code: 1

Using the exact same requirements.txt in the root folder works as expected.

Also, a warning stating...

▲ [WARNING] [pythonExtension] Both options.requirements and options.requirementsFile are specified. requirements will be ignored.

...occurs although no requirements: [] is present.

Reproduction repo

https://github.com/SilkHubCo/python-crawl4ai

To reproduce

We initialized the basic python crawl example and moved the requirements.txt to the python folder.

Additional information

No response

luap2703 avatar Mar 28 '25 15:03 luap2703

I can confirm that requirements.txt in a nested folder (not the root) failed. I move mine to the root folder and now it's okay.

azlekov avatar Apr 15 '25 11:04 azlekov

I can confirm this and I'm facing the same issue. Moving it to the root fixed it as @azlekov mentioned.

emilshr avatar Aug 23 '25 09:08 emilshr

https://github.com/triggerdotdev/trigger.dev/pull/2470 fixed in this PR

julienvanbeveren avatar Sep 03 '25 08:09 julienvanbeveren