It seems your questions is more on "How to debug that error" than on the error itself. If you wish me to look into the error specifically, I will do this, I promise :).
Otherwise, it is great to learn from your own mistakes and to learn how to debug yourself.
The best way to debug a lammps script is to use the command:
at the beggining of the ...