Counter cache columns are all gone in foreman-1.15.3-2 or newer. It is impossible to hit this SQL error. If we run into deadlocks, it's a different BZ. VERIFIED
[root@zzzap ~]# rpm -q foreman katello
foreman-1.15.3-2.el7sat.noarch
katello-3.4.4-2.el7sat.noarch
Comment 6Satellite Program
2018-02-21 16:51:07 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
>
> For information on the advisory, and where to find the updated files, follow the link below.
>
> If the solution does not work for you, open a new bug report.
>
> https://access.redhat.com/errata/RHSA-2018:0336