Skip to content

Error “Time is before epoch” error due to old object timestamps (1970-01-01) #35

@Rub21

Description

@Rub21

We are attempting to generate a planet .osm.pbf file for OpenHistoricalMap using planet-dump-ng as an alternative to the current osmosis-based workflow, which sometimes missing data, OpenHistoricalMap/issues#1052 and OpenHistoricalMap/issues#1082

After trying tun run planet-dump-ng , I got an issue about the dates.

The issue:

root@staging-web-db-backup-job-29188292-pbgjn:/mnt/data# planet-dump-ng \
  --dump-file ohm-api-web-db-20250630-1439.dump \
  --pbf planet.osm.pbf
Starting thread with 24 bytes
Starting thread with 38779 bytes
Finishing thread with 38779 bytes
Finishing thread with 24 bytes
Starting thread with 1231835Starting thread with 24 bytes
 bytes
Finishing thread with 1231835 bytes
Finishing thread with 24 bytes
Starting thread with 24 bytes
Starting thread with 12771340 bytes
Finishing thread with 12771340 bytes
Finishing thread with 24 bytes
Starting thread with 24 bytes
Starting thread with 68681097 bytes
Finishing thread with 68681097 bytes
Finishing thread with 24 bytes
Starting thread with 178956984 bytes
....
Finishing thread with 178956984 bytes
Finishing thread with 178956984 bytes
Starting thread with 178956984 bytes
Finishing thread with 178956984 bytes
Starting thread with 178956984 bytes
Starting thread with 178956984 bytes
Finishing thread with 178956984 bytes
Starting thread with 178956984 bytes
Finishing thread with 178956984 bytes
Finishing thread with 178956984 bytes
Starting thread with 178956984 bytes
Starting thread with 24 bytes
Starting thread with 18874776 bytes
Finishing thread with 18874776 bytes
Finishing thread with 178956984 bytes
Finishing thread with 24 bytes
Finishing thread with 24 bytes
EXCEPTION: Throw location unknown (consider using BOOST_THROW_EXCEPTION)
Dynamic exception type: boost::wrapexcept<boost::exception_detail::error_info_injector<std::runtime_error> >
std::exception::what: Error during archive dump to disk database.
[(anonymous namespace)::tag_table_name*] = nodes
[boost::errinfo_nested_exception_*] =
  extract_kv.cpp(95): Throw in function int {anonymous}::app_item::operator()(int, const boost::posix_time::ptime&) const
  Dynamic exception type: boost::wrapexcept<std::runtime_error>
  std::exception::what: Time is before epoch.


The error suggests that some objects in the database have timestamps earlier than the Unix epoch (1970-01-01), which planet-dump-ng cannot handle. It seems that during the import or restoration, these objects ended up with the date 1970-01-01 01:00:01.

Image

https://www.openhistoricalmap.org/node/1871360104

Image

Is there a way to skip these dates that are causing the error during the creation process?

cc. @danrademacher @batpad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions