The issue here was that GLPK does not support quadratics. I fixed the problem by using the Ipopt solver.