Unable to solve linear system using PETSc Krylov solver

Please provide a minimal working example reproducing the error. (I also note that you have posted about this in multiple threads: How to solve variational problem by iteration methods - #7 by adamson-lkx
Please avoid duplicate posts.