rerunning - Error: Dump file does not contain requested snapshot

I want to do a rerunning to calculate the Energy and Force of Interaction of two groups. The starting step in the dump file is 4,000,000, and I’m using these command for rerun:

you have missed to provide the most crucial information: which version of LAMMPS are you using and on what platform are you running?
there doesn’t seem to be a problem with the latest version (26 Oct 2015) on linux, since i can run the following input, which tries to emulate what you report, without a problem.

axel.

lattice fcc 0.8442
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 3.0 87287

pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0

fix 1 all nve

reset_timestep 4000000
dump id all atom 50 dump.melt
thermo 50
run 250
undump id

reset_timestep 10000
run 0
rerun dump.melt first 4000000 every 0 dump x y z box yes

Thank you for testing. This happens under:

Linux, lammps/15May15

I still don’t know what’s happening. Probably I should try the latest version.

Thank you for testing. This happens under:

Linux, lammps/15May15

I still don't know what's happening. Probably I should try the latest
version.

​for starters you should try and run the test script i posted. if that one
fails, too, then you *have* to upgrade to a newer version.
if it doesn't fail, then perhaps there is a different reason for the
failure that is caused by something that you haven't shown.​
​double checking with the latest development version is always a good idea,
because bugs will only be corrected in the development version.

axel.​

“Update”

Thank you Axel.
You code worked fine. However, I tried to imitate what I need to do, using your code, more exactly. i.e. first producing the files, and then doing the rerun in another job separately. I got the same error.
The problem was this part:

read_dump dump.lammpstrj 10000 x y z format native box yes scaled no wrapped yes

which should be this:

read_dump dump.lammpstrj 4000000 x y z format native box yes scaled no wrapped yes