Correctable? "Block offset not in sequential order"

I’m trying to do my first load of the US portion of planet, with the 5 segments downloaded in .pbf format from, extraction date 03JA14.

Osm2pgsql (v0.81.0) fails while trying to read up the midwest segment with “block_offset not in sequential order: 24880”. I’m not sure why it has to be in sequential order, given that it’s going into a database, but so be it.

Since I got the same failure yesterday with the osm.bz2 download I did from the 25DE13 extract, the problem is evidently located in planet and probably won’t be corrected soon.

So my questions are: is this correctable with an editor; will it be obvious what to do when I have the file open in an editor; and where can I find an editor that will run under XP (I run freebsd 9.2 and xp, but haven’t been able to install ubuntu because it chokes and falls down when it tries to install grub2, and the “linux compatibility” under freebsd is good for games but not much else)

Many thanks in advance.

Am I misinterpreting the error message? Because I got the identical message again, but for the next file (west): “block_offset not in sequential order: 24880”

Does that error also occur when using Osm2pgsql version 0.82 or 0.84 ?

Okay, that’s annoying. The problem is minimally the documentation and the switches: it implies that one can pass the list of files and it will understand that it’s doing a create on the first file, but appends on the rest. It doesn’t, though it should be smart enough to do that. What it does is a create on the first file (if you have the -c switch set) and then gets completely confused on the next file, failing with that error (maybe a different number).

So to make loading regions work, one must use the -c (and perhaps --unlogged, if you have a stable machine) and run it against the first file. Then comment out the -c and the --unlogged and add the -a switch so that it’ll append. Then you can run it against the rest of the regional files and it will tolerate out-of-order nodes just as it should, tho it complains about cache efficiency.

That error message should be “Trying to create (-c switch) with a non-zero counter. Use only the -a switch on 2nd and subsequent files”.

The docs also say “create” is the default, but that doesn’t seem to be true because if you don’t have the -c set, then it complains about --unlogged.

I don’t know - 0.81 is the version packaged in FreeBSD 9.2, which is what I’m running. But I solved the problem: it’s a doc and switches bug. Do the maintainers scour these threads to pick up bugs, or do I need to do something special?