Perfect foresight simulations: Matrix is singular to working precision

Dear Professor Pfeifer,
My model perfectly works with stochastic simulation. Now I would like to try some permanent shocks and perfect foresight simulations by providing initval; endval; (both steady state) and

perfect_foresight_setup(periods=1000);
options_.simul.robust_lin_solve=2;
perfect_foresight_solver(stack_solve_algo =0);

the model is non-linear and I have external SS finder. the size of shock is very small. Unfortunately, the solver fails and I have this error:

Warning: Matrix is singular to working precision.
Initial bicgstab failed, trying alternative start point.
Alternative start point also failed with bicgstab, trying gmres.
Initial gmres failed, trying alternative start point.
Alternative start point also failed with gmres, using the (SLOW) Moore-Penrose Pseudo-Inverse.

I also tried: model_diagnostics(M_,options_,oo_)
MODEL_DIAGNOSTICS: No obvious problems with this mod-file were detected.

what could be the potential mistake in my model?
Thank you so much in advance.
Leo.

Without seeing the codes it is impossible to tell.