Symmetry factor of a loop diagram with gauge-bosons I have learnt in the lecture that the symmetry factor of the following diagram is 1/2:

where the line corresponds to a gluon. But why is this the case? 
We get 1/2 from 2nd order in pertubation theory. Then we get a factor of 2 for the interchangeability of the internal vertices, a factor of 3*3 for the connection of the external lines with one of the internal lines of the corresponding vertex and a factor of 2 for the connection of the internal lines, which are left. Therefore, I would get a symmetry factor of 18. 
 A: The Feynman rule for each of the vertices, in its usual writing, is a sum of 3 terms of the form
$$
g\,f^{abc}\,[\eta^{\mu\nu}(p-k)^{\sigma}+\cdots]
$$
(hence of 6 terms in total, separately counting each momentum). In the QCD action, these 6 terms are not present: the action only actually contains one of them, which is then re-written for 6 times and symmetrized in order to account for the symmetries with respect to the color and Lorentz indices. Therefore for each of these vertices you must count in a factor of $1/6$. Since in this case you have two of them, you must multiply your diagram by a factor of $1/36$. When multiplied by the factor of 18 that you derived, you obtain $1/2$.
A: *

*Note that a symmetry factor of a Feynman diagram is conventionally the reciprocal of what OP calls a symmetry factor.


*Concretely, the symmetry factor of OP's Feynman diagram
$$ J \times \rule[.5ex]{5mm}{.2mm}\bigcirc\rule[.5ex]{5mm}{.2mm}\times J$$
in the source picture is $S=4$. This is because of the $\mathbb{Z}_2$-symmetry of the loop legs and the $\mathbb{Z}_2$-symmetry of the external legs.


*Alternatively, the symmetry factor $S=4$ can be deduced "by differentiation of sources", cf. eq. (3) in my Phys.SE answer here. Schematically, the calculation goes as follows:
$$ \underbrace{\frac{1}{2!}}_{\text{from exp}}\times \underbrace{\left(\frac{1}{3!}\right)^2}_{\text{from vertices}} \times \underbrace{18}_{\text{combinations}} ~=~\frac{1}{4}.$$


*Now, the lectures were presumably talking about the self-energy, which is an amputated 2-pt vertex. Conventionally, the $\mathbb{Z}_2$-symmetry of the external legs is here discarded, so the symmetry factor is then $S=2$, cf. e.g. my Phys.SE answer here.
