Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
spwntr opened this issue Feb 13, 2013 · 3 comments
Open

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

spwntr opened this issue Feb 13, 2013 · 3 comments
Assignees
Labels

Comments

@spwntr
Copy link

spwntr commented Feb 13, 2013

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
Copy link
Collaborator

mccc commented Feb 13, 2013

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.

@mccc mccc closed this as completed Feb 13, 2013
@ghost ghost assigned mccc Feb 13, 2013
@spwntr
Copy link
Author

spwntr commented Feb 13, 2013

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 mccc reopened this Feb 13, 2013
@mccc
Copy link
Collaborator

mccc commented Feb 13, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants