Search code examples
openstreetmaposm2pgsql

osm2pgsql error Trying to import .osm to postGis on AWS


I'm trying to import osm data using osm2pgsql onto an aws rds instance. I get an error saying Osm2pgsql failed due to ERROR: Open failed for 'insights_poi': No such file or directory but I am providing all the necessary files.

Locally, I'm running osm2pgsql -c -d insights_poi -U insights_poi -H beta.cyrrprcqeykj.us-east-1.rds.amazonaws.com -S default.style austin_texas.osm.pbf -W insights_poi -r .pbf

and the default.style and the austin_texas.osm.pbf file are in the same folder I'm running this from. Why is it saying it can't find the file?

It actually gets pretty far after I run the command

enter image description here


Solution

  • For the -W, the docs specified -w forces password prompt which I treated as a parameter. so The error Osm2pgsql failed due to ERROR: Open failed for 'insights_poi': No such file or directory was a result of -W insights_poi since nothing was really expected after the -W, it was treating the insights_poi value as the name of a file there that didn't exist.

    In the end this did it, osm2pgsql -c -d insights_poi -U insights_poi -H beta.cyrrprcqeykj.us-east-1.rds.amazonaws.com -r .pbf -S default.style -W austin_texas.osm.pbf