The moduli stack $\mathcal{M}_g$ of genus $g$ curves is one of the deepest objects in mathematics, so of course you wonder to what extent you can construct an (Artin?) stack parametrising algebraic surfaces.
Recall how to construct a moduli space $\mathcal{M}$ containing a curve $X$ using deformation theory (reference is Hartshorne's book):
- Representability. To construct the formal neighbourhood $D_{\mathcal{M},X}$ of $X$ in $\mathcal{M}$, note that if $\text{Spec}A$ is a fat point (i.e. $A$ is Artinian) then maps into $\mathcal{M}$ correspond to flat families of schemes over $\text{Spec}A$ with central fibre $X$. Then use Artin representability to show (under conditions) that this functor $$F\ :\ \text{Artin rings} \ \to \ \text{Sets/Groupoids}$$ sending $$A\ \mapsto\ \{\text{flat families of schemes over }\text{Spec}A \text{with central fibre }X\}$$ is represented by a formal scheme/stack $D_{\mathcal{M},X}$.
- Algebraicity. To construct an open neighbourhood of $X$, we need to show that $D_{\mathcal{M},X}$ can be “algebraised” to a scheme/stack $U_{\mathcal{M},X}$. This can be done using Artin algebraicity, under conditions. A stronger condition is that $H^2(X,\mathcal{O}_X)=0$.
Question: (edit: answered in comments below) Let $X$ be an algebraic surface. I have not seen a general definition of a moduli stack of algebraic surfaces containing $X$. So I assume either 1 or 2 does not work—which is it, and why? If $F$ is not represented by the formal completion of some stack, is there no hope of building a moduli stack for $X$?
tl;dr what (if anything) fails when you try to use deformation theory to build a moduli stack of surfaces near $X$?
Edit:
Edited question: What is the obstruction to the existence of the analytic moduli stacks $\mathcal{M}$? Do they always exist?
There are other questions, e.g. Results about moduli of surfaces, but it is unclear how many problems there come from not working with stacks, and also it is unclear what is expected to be true.