maschinenmensch / edifice

A database of the built environment in Chicago
5 stars 1 forks source link

setup_edifice.py on ubuntu 12.10 asks for a password #20

Open spwntr opened 11 years ago

spwntr commented 11 years ago

on ubuntu 12.10 with all prerequisites ran:

python setup_edifice.py --create_template

output:

Initializing postgres with a basic PostGIS template using the postgres superuser. db_names is ['postgres', 'template0'] EDIFICE_DB is edifice createdb -U postgres -h localhost -T template0 -E UTF8 base_postgis Password:

thanks.

mccc commented 11 years ago

Your postgres superuser has a password enabled, so createdb (run as superuser) is asking for a password. Unless we write our own little password wrapper, the setup_edifice script (especially in --create_template mode) will prompt you for postgres superuser passwords a few times. On the other hand the --create mode should only need permissions for the 'edifice' non-superuser.

spwntr commented 11 years ago

after setting a password for "postgres" it accepted one for --create_template but still gave errors:

Initializing postgres with a basic PostGIS template using the postgres superuser. db_names is ['bug', 'postgres', 'template0'] EDIFICE_DB is edifice createdb -U postgres -h localhost -T template0 -E UTF8 base_postgis Password: psql -U postgres -h localhost -d base_postgis -c CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public; Password for user postgres: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/postgis.control": No such file or directory psql -U postgres -h localhost -d postgres -c UPDATE pg_database SET datistemplate='true' WHERE datname='base_postgis'; Password for user postgres: UPDATE 1 psql -U postgres -h localhost -d base_postgis -c GRANT ALL ON geometry_columns TO PUBLIC; Password for user postgres: ERROR: relation "geometry_columns" does not exist psql -U postgres -h localhost -d base_postgis -c GRANT ALL ON geography_columns TO PUBLIC; Password for user postgres: ERROR: relation "geography_columns" does not exist psql -U postgres -h localhost -d base_postgis -c GRANT ALL ON spatial_ref_sys TO PUBLIC; Password for user postgres: ERROR: relation "spatial_ref_sys" does not exist psql -U postgres -h localhost -d base_postgis -c CREATE USER edifice; Password for user postgres: CREATE ROLE psql -U postgres -h localhost -d base_postgis -c ALTER USER edifice createdb; Password for user postgres: ALTER ROLE

and without setting an "edifice" password, --create still asked for a password:

Setting up edifice database from scratch. dropdb -U edifice -h localhost --interactive edifice Database "edifice" will be permanently removed. Are you sure? (y/n) y Password: dropdb: could not connect to database postgres: FATAL: password authentication failed for user "edifice" FATAL: password authentication failed for user "edifice" createdb -U edifice -h localhost -T base_postgis edifice Password: createdb: could not connect to database postgres: fe_sendauth: no password supplied psql -U edifice -h localhost -d edifice -f sql_init_scripts/pins_master.sql Password for user edifice: psql: fe_sendauth: no password supplied psql -U edifice -h localhost -d edifice -f sql_init_scripts/edifice_initialization_script.sql Password for user edifice: psql: fe_sendauth: no password supplied psql -U edifice -h localhost -d edifice -c CREATE SCHEMA dataportal IF NOT EXISTS; Password for user edifice: psql: fe_sendauth: no password supplied Fetching pins.dump... wget -O downloads/pins.dump http://dl.dropbox.com/u/14915791/pins.dump --2013-02-12 23:16:12-- http://dl.dropbox.com/u/14915791/pins.dump Resolving dl.dropbox.com (dl.dropbox.com)... 54.243.103.62, 54.243.118.43, 107.21.253.161, ... Connecting to dl.dropbox.com (dl.dropbox.com)|54.243.103.62|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 69817910 (67M) [application/octet-stream] Saving to: `downloads/pins.dump'

100%[====================================================================================================>] 69,817,910 1.24M/s in 54s

2013-02-12 23:17:08 (1.23 MB/s) - `downloads/pins.dump' saved [69817910/69817910]

Loading property pins... pg_restore -U edifice -h localhost -O -c -d edifice downloads/pins.dump Password:

mccc commented 11 years ago

According to this:

http://blog.gmane.org/gmane.comp.gis.postgis/month=20121001

Ubuntu does not have a simple install for PostGIS.

This seems like the current canonical page for getting it working:

http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1204src

Try to follow these instructions, and you can stop before the header 'Spatially enabling a database' because that is what setup_edifice.py --create_template should do for you.