Page MenuHomePhabricator

Cron job updating file running mysql fails with no output
Closed, InvalidPublic

Description

therefore I cannot find the root cause. .out and .err files are empty. Tried submitting without jsub (which works fine on interactive shell), but crontab knows better and modifies my cron job to

/usr/bin/jsub -N cron-tools.rillke-1 -once -quiet mysql --defaults-file=~/replica.my.cnf -h commonswiki.labsdb commonswiki_p < autopatrolled_candidates.sql > public_html/autopatrolled_candidates.tsv

(and nothing happens) where it was before

mysql --defaults-file=~/replica.my.cnf -h commonswiki.labsdb commonswiki_p < autopatrolled_candidates.sql > public_html/autopatrolled_candidates.tsv

(and the .tsv file was created).

Event Timeline

Rillke raised the priority of this task from to Needs Triage.
Rillke updated the task description. (Show Details)
Rillke added a project: Toolforge.
Rillke added a subscriber: Rillke.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Is it necessary to run the mysql client on the grid? It doesn't have to do any heavy processing work....

The problem is that piping won't work combined with jsub, try:

jsub -N autopatrolled_candidates -once -quiet -mem 1g -i ~/autopatrolled_candidates.sql -o ~/public_html/autopatrolled_candidates.tsv sql commonswiki_p

Fix the path to ~/autopatrolled_candidates.sql if necessary, the error log should be in ~/autopatrolled_candidates.err.

Rillke claimed this task.

The problem is that piping won't work combined with jsub, try:

jsub -N autopatrolled_candidates -once -quiet -mem 1g -i ~/autopatrolled_candidates.sql -o ~/public_html/autopatrolled_candidates.tsv sql commonswiki_p

Thanks. Looks like you tried it yourself. That's a magnificent service. 120m appear to be sufficient.

Fix the path to ~/autopatrolled_candidates.sql if necessary, the error log should be in ~/autopatrolled_candidates.err.

Still wondering whether it is intentional behaviour that absolutely nothing is written anywhere, including why the job didn't start or was immediately aborted.

mangled characters in output (?????) instead of user names --> I ended up writing a wrapper shell script due to T60784

#! /bin/bash

export LANG=en_US.UTF-8
export PATH=/usr/local/bin:/usr/bin:/bin:$PATH
mysql --defaults-file=~/replica.my.cnf -h commonswiki.labsdb commonswiki_p < ~/autopatrolled_candidates.sql > ~/public_html/autopatrolled_candidates.tsv

and then doing

jsub -N autopatrolled_candidates -once ~/sqltask.sh

the wrapper consumes 65M additionally memory.