Application of the Cartan Structure Equations seems to imply the Einstein-Palatini action is zero? The Einstein-Palatini action can be written as
$$ S = M_{pl}^2\int\varepsilon_{abcd}\left(e^a\wedge e^b\wedge R^{cd}\right), $$
where $e^a={e^a}_\mu\text{dx}^\mu$ is the basis one-form and $R^{ab}=\frac{1}{2}{R^{ab}}_{\mu\nu}\text{dx}^\mu\wedge\text{dx}^\nu$ is the Riemann curvature two-form. The Cartan Structure Equations for the torsion-less and metric-compatible connection of GR are
$$ R^{ab} = D\omega^{ab} = d\omega^{ab} + {\omega^a}_c \omega^{bc}, \quad 0 = De^a = de^a + {\omega^a}_be^b, $$
where $\omega^{ab}={\omega^{ab}}_\mu\text{dx}^\mu$ is the (antisymmetric) spin connection one-form.
Now, my confusion comes from the fact that if I apply the first structure equation, integrate by parts (neglecting boundary terms), and apply the structure second equation, the whole action seems to vanish.
\begin{align} 
S &= M_{pl}^2\int\varepsilon_{abcd}\left(e^a\wedge e^b\wedge D\omega^{cd}\right) \\
&= M_{pl}^2\int\varepsilon_{abcd}\left(-D(e^a\wedge e^b)\wedge\omega^{cd}\right) \\
&= M_{pl}^2\int\varepsilon_{abcd}\left(-De^a\wedge e^b\wedge\omega^{cd} + e^a\wedge De^b\wedge\omega^{cd}\right) \\
&= M_{pl}^2\int\varepsilon_{abcd}\left(0+0\right)=0
\end{align}
This obviously doesn't seem correct, so is there an error in my understanding somewhere? Is it incorrect to use the structure equations and integrate by parts in the action in this way?
 A: I found a reliable source that addresses my question (Appendix 4.1 - M. Gasperini, Theory of Gravitational Interactions; DOI 10.1007/978-88-470-2691-9), so I will present the resolution to my confusion here for posterity's sake. The issue is not with using the structure equations on-shell (indeed, this is purely a classical theory) and there is no error in my calculation. The problem is that the Palatini action is defined with a non-zero torsion and only corresponds to GR after the limit of vanishing torsion is taken after computing the equations of motion.
The Palatini formalism requires that we use the structure equation
$$ T^a = De^a = de^a + {\omega^a}_be^b , $$
where $T^a = \frac{1}{2}{T^a}_{\mu\nu}\text{dx}^\mu\wedge\text{dx}^\nu \neq 0$ is the torsion two-form. One can then integrate by parts to find
\begin{align}
S &= M_{pl}^2\int\varepsilon_{abcd}\left(e^a\wedge e^b\wedge D\omega^{cd}\right) \\
&= M_{pl}^2\int\varepsilon_{abcd}\left(-T^a\wedge e^b\wedge\omega^{cd} + e^a\wedge T^b\wedge\omega^{cd}\right) \neq 0 ,
\end{align}
which is a perfectly valid version of the Palatini action.
To make touch with GR (here with no matter sources for simplicity), we must vary the action with respect to the two independent fields in our theory, $e^a$ and $\omega^{ab}$, which yields the following EOMs.
$$\delta_e S = \varepsilon_{abcd}R^{ab}\wedge e^c = 0 , \quad \delta_\omega S = \varepsilon_{abcd}T^a\wedge e^b = 0 $$
These are the "Einstein-Cartan" equations, and after converting back to tensor component notation, is easy to see that the first gives precisely the Einstein equations of GR while the second gives an EOM for the torsion which is of course trivial after taking the limit $T^a \rightarrow 0$.
The short story is, the Palatini formalism does not reproduce GR if we simply set $T^a=0$ at the level of the action. The two theories only coincide once we take the limit of vanishing torsion at level of the EOMs.
A: This part of yours is incorrect:
$$
\begin{align} 
S &\sim \int\varepsilon_{abcd}\left(e^a\wedge e^b\wedge D\omega^{cd}\right) \\
&= \int\varepsilon_{abcd}\left(-De^a\wedge e^b\wedge\omega^{cd} + e^a\wedge De^b\wedge\omega^{cd}\right) 
\end{align}
$$
The correct derivation is:
$$
\begin{align} 
S &\sim \int\varepsilon_{abcd}\left(e^a\wedge e^b\wedge D\omega^{cd}\right) \\
&= \int\varepsilon_{abcd}\left(-(de^a + \frac{1}{2} {\omega^a}_k\wedge e^k)\wedge e^b\wedge\omega^{cd} + e^a\wedge (de^b+ \frac{1}{2} {\omega^b}_k\wedge e^k)\wedge\omega^{cd}\right) \\
\end{align}
$$
Obviously:
$$
de^a + \frac{1}{2} {\omega^a}_k\wedge e^k \neq De^a= de^a + {\omega^a}_k\wedge e^k
$$

Added note after discussion with @JeffK (the person who originally asks the question), since @JeffK opted to stand by the wrong calculation.
Moving covariant derivative $D$ between $\omega$ and $e$ is a bit tricky, because of the unique definition of $D\omega$.
One can arrive at the Einstein action by applying the zero torsion condition
$$
0 = De^a = de^a + {\omega^a}_be^b
$$
to the Einstein-Palatini action, via expressing $\omega$ as a function of $e$, effectively eliminating explicit dependence of the Einstein action on $\omega$.
The Einstein action is apparently not zero. I hope @JeffK can see the light and would avoid making similar mistakes in future study/research.
A: This whole discussion revolves around a common misconception due to the fact that some authors (for reasons unknown to me) like to abbreviate $d\omega^{ab}+\omega^a{}_c\wedge \omega^{cb}$ as $D\omega^{ab}$. As long as one understands that this is just notation things are fine. But then, people read this and assume that this is indeed an exterior covariant derivative. It is clear that exterior covariant derivatives do NOT act on connection 1-forms, rather only on forms whose components are tensors of some rank in the same way that usual covariant derivatives do NOT act on connection symbols, like the Christoffel symbols. What is of course correct is $\delta R^{ab}=D\delta\omega^{ab}$ as the difference of connection 1-forms does indeed transform in the Adjoint. Moreover, in the formalism of differential forms integration by parts should always be performed with the exterior derivative $d$ and not the covariant one, exactly as the generalized Stokes theorem dictates.
