The problem is that a pipeline separates commands where each has its own file descriptors, thus the redirect at the end only applies to the gawk command. This means, if the rake command has some output to standard error it doesn’t get redirected into cron.log anymore but instead causes a cron email. Only the rake output to standard output is piped into standard input of gawk…
Even worse: the percent sign “%” has special meaning in a crontab. crontab(5):
The “sixth” field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or a “%” character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the cronfile. A “%” character in the command, unless escaped with a backslash (\), will be changed into newline characters, and all data after the first % will be sent to the command as standard input.
In other words: the % is converted to a newline causing the cronjobs to fail with:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
So basically all cronjobs in /etc/cron.d/foreman are broken…