CRON JOB Issue - no terminal output

hi. I have setup a cron job, which is a wrapper script, which will in turn execute a number of python scripts.

the issue is, when I got to manually run the wrapper script, it says building and then states build failed, there is no output to the terminal, so I have no idea where to even start to resolve.

much appreciated.

P.

Hi,

One possibility is that the Python version being used by Render is not compatible with the packages you’re attempting to install. If that’s the case, you can try updating the Python version by setting the environment variable PYTHON_VERSION to a version that you know works or matches your local environment.

Regards,

Keith
Render Support, UTC+10 :australia:

hi, I started to trouble shoot by simply creating a hello world cron job, however this also failed to build, so I think its something basic in the setup. but without any output from the terminal.

I have now debugged as much as possible. I can get a basic hello world script to run, so this part of the setup is correct. However when the script requires python packages installing this is when the build fails. The 2) below works when I install packages with my web server, however it doesn’t as a cron job.

I have tried the following two Build Commands:

  1. pip ipip install -r requirements.txt
  2. pip install --upgrade pip && pip install -r requirements.txt

this is the error output, when running.

==> Using Node version 20.9.0 (default)

Nov 30 04:54:03 PM==> DOCS ON SPECIFYING A NODE VERSION: HTTPS://RENDER.COM/DOCS/NODE-VERSION

Nov 30 04:54:05 PM==> RUNNING ‘PYTHON FI_2_DAILYPRICE_CLASS_PROD.PY’

Nov 30 04:54:05 PMTRACEBACK (MOST RECENT CALL LAST):

Nov 30 04:54:05 PM FILE “FI_2_DAILYPRICE_CLASS_PROD.PY”, LINE 12, IN

Nov 30 04:54:05 PM IMPORT REQUESTS

Nov 30 04:54:05 PMMODULENOTFOUNDERROR: NO MODULE NAMED ‘REQUESTS’

thoughts appreciated.

P.

**EDIT, I also note that it says NODE version… This is very odd, as there is nothing in my code relating to Node.

Hi there,

Looking at the last failure of your hello cron job, I see:

pip._vendor.pep517.wrappers.BackendUnavailable

Upgrading pip should fix this, so use pip install --upgrade pip && pip install -r requirements.txt

Regards,

Keith
Render Support, UTC+10 :australia:

hi. I note above, I have already tried this. The upgrade pip point works fine with the web server app, but when trying it with a cron job, this is the error:

==> Using Node version 20.9.0 (default)

Dec 1 12:35:36 AM==> DOCS ON SPECIFYING A NODE VERSION: HTTPS://RENDER.COM/DOCS/NODE-VERSION

Dec 1 12:35:43 AM==> RUNNING ‘PYTHON FI_2_DAILYPRICE_CLASS_PROD.PY’

Dec 1 12:35:43 AMTRACEBACK (MOST RECENT CALL LAST):

Dec 1 12:35:43 AM FILE “FI_2_DAILYPRICE_CLASS_PROD.PY”, LINE 12, IN

Dec 1 12:35:43 AM IMPORT REQUESTS

Dec 1 12:35:43 AMMODULENOTFOUNDERROR: NO MODULE NAMED ‘REQUESTS’

this is my current Build Command: pip install --upgrade pip && pip -r requirements.txt

and this is the Command: python fi_2_dailyprice_CLASS_PROD.py

thoughts appreciated.

P.

Hi there,

You are missing install from your pip command: pip install --upgrade pip && pip -r requirements.txt should be pip install --upgrade pip && pip install -r requirements.txt . To be fair, I’ve seen us reply with this before and customers have said it worked, but your last build (not run where you see your above error) had this output:

Nov 30 08:10:34 PM ==> Running build command 'pip install --upgrade pip && pip -r requirements.txt'...Nov 30 08:10:35 PM Collecting pipNov 30 08:10:35 PM Downloading https://files.pythonhosted.org/packages/47/6a/453160888fab7c6a432a6e25f8afe6256d0d9f2cbd25971021da6491d899/pip-23.3.1-py3-none-any.whl (2.1MB)Nov 30 08:10:35 PM Installing collected packages: pipNov 30 08:10:35 PM Found existing installation: pip 19.2.3Nov 30 08:10:36 PM Uninstalling pip-19.2.3:Nov 30 08:10:36 PM Successfully uninstalled pip-19.2.3Nov 30 08:10:38 PM Successfully installed pip-23.3.1Nov 30 08:10:38 PM Nov 30 08:10:38 PM Usage:Nov 30 08:10:38 PM pip <command> [options]Nov 30 08:10:38 PM Nov 30 08:10:38 PM no such option: -rNov 30 08:10:38 PM ==> Build failed

This makes sense seeing -r is an option of the install command, not pip itself.

Get a clean build then try triggering a new run.

Regards,

Keith
Render Support, UTC+10 :australia:

my bad. Thanks Keith, I missed the additional install in the pip install -r requirements.txt

. I see the cron job calling the API now, so looks like it’s running. thanks for the help. much appreciated.

until the next drama! ;-).

P.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.