UI Scheduled Cron Job failing with unusual errors (Speedtests)

Gizmokid2005

Cadet
Joined
Mar 11, 2021
Messages
1
I've been beating my head against this for a few months, and after my initial foray into it I put it on the backburner until I recently upgraded to TrueNAS 12U4.

I'm currently using speedtest-cli to run regular speedtests to keep track of my internet connection from my NAS.

I have the following script setup that I am trying to run via cron setup via UI (note the printenv is only a test line I've been using to try and track down any weird environment issues that could be related - output attached as well).

Code:
#!/bin/csh
date >> /mnt/freenas-data/Shared/Speedtest/speedtest.log
printenv >> /mnt/freenas-data/Shared/Speedtest/env.log
/usr/local/bin/python /root/speedtest-cli/speedtest.py --server 16620 --simple >> /mnt/freenas-data/Shared/Speedtest/speedtest.log
echo " " >> /mnt/freenas-data/Shared/Speedtest/speedtest.log


If I execute this code logged in via ssh as the root user it works as expected, I get the desired output in the desired location and there are no issues. It *also* works if I use the "Run now" option via the UI. However, if I let it run on on its schedule I get varying errors that it was unsuccessful.

1626289559629.png


The current error I get is:
ERROR: No matched servers: 16620

However this runs fine manually, whether via the script or just executing the speedtest.py script on its own.

Environment that is provided when run via cron UI:

Code:
LANG=en_US.UTF-8
IOCAGE_DEBUG=TRUE
MAIL=/var/mail/$
http_proxy=
https_proxy=
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
PWD=/root
HOME=/root
TZ=America/Los_Angeles
MM_CHARSET=UTF-8
LC_ALL=en_US.UTF-8
RC_PID=34
BLOCKSIZE=K
HOSTTYPE=FreeBSD
VENDOR=amd
OSTYPE=FreeBSD
MACHTYPE=x86_64
SHLVL=1
LOGNAME=root
USER=root
GROUP=wheel
HOST=freenas.<redacted>
EDITOR=vi
PAGER=less


At this point I'm at a loss as to what could be causing the issue - there's nothing obvious to me that would be causing errors - I have verified that the paths are all running the same thing, there's no other copies of speedtest.py on the system that I can find.

Please let me know if I can provide other info, I'd love to be able to solve this issue.
 
Top