You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory #5
I tried to run CREATE EXTENSION postgis; on the image mdillon/postgis:9.4 from the docker hub. It complained that it couldn't find the file /usr/share/postgresql/9.4/extension/postgis.control
running bash inside the container reveals that in fact this file exists!
I already tried the following things:
building from this repository
changing ownership of /usr/share/postgresql/9.4/extension/ to the postgres user (RUN chown -R postgres:postgres /usr/share/postgresql/9.4/extension/)
I can't see anything there that would affect whether or not the extension control file would be found or readable by the Postgres process.
Any chance you could post the exact error you get back when you run fig run app rake db:migrate? You may also want to look at what fig logs db has to say after the failure.
== 20140418190245 CreateFeatures: migrating ===================================
-- enable_extension("postgis")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedFile: ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "postgis"/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `block in exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/usr/local/bundle/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `enable_extension'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:656:in `block in method_missing'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:648:in `method_missing'
/usr/src/app/db/migrate/20140418190245_create_features.rb:3:in `change'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:602:in `exec_migration'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:585:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:584:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:759:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:959:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `each'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:814:in `up'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:792:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "postgis"
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `block in exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/usr/local/bundle/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `enable_extension'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:656:in `block in method_missing'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:648:in `method_missing'
/usr/src/app/db/migrate/20140418190245_create_features.rb:3:in `change'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:602:in `exec_migration'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:585:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:584:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:759:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:959:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `each'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:814:in `up'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:792:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
PG::UndefinedFile: ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `block in exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/usr/local/bundle/gems/activesupport-4.1.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `exec_no_cache'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `enable_extension'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:656:in `block in method_missing'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:628:in `say_with_time'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:648:in `method_missing'
/usr/src/app/db/migrate/20140418190245_create_features.rb:3:in `change'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:602:in `exec_migration'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:586:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:585:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:584:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:759:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `block in ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:1044:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:959:in `block in migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `each'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:955:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:814:in `up'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/migration.rb:792:in `migrate'
/usr/local/bundle/gems/activerecord-4.1.9/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
and fig logs db
...
db_1 | LOG: received smart shutdown request
db_1 | LOG: autovacuum launcher shutting down
db_1 | LOG: shutting down
db_1 | LOG: database system is shut down
db_1 | LOG: database system was shut down at 2015-02-14 00:01:24 UTC
db_1 | LOG: autovacuum launcher started
db_1 | LOG: database system is ready to accept connections
db_1 | ERROR: could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory
db_1 | STATEMENT: CREATE EXTENSION IF NOT EXISTS "postgis"
And you said you were able to confirm that /usr/share/postgresql/9.4/extension/postgis.control exists with that exact path? Could you provide the output of docker exec $CONTAINERID ls -l /usr/share/postgresql/9.4/extension/postgis.control?
BTW, you probably don't want that ports: "5432". That's exposing your container Postgres on the Docker host's IP with a random port. The linked container will work directly with port 5432 inside the container with the ports declaration.
It seems fig doesn't recognize changes in the fig yml. Earlier I had image: postgres and now it starts the postgres image :| After I changed the name of the db to postgis fig recognized the different image. It now works
Activity
md5 commentedon Feb 13, 2015
How did you run the
CREATE EXTENSIONstatement? Did you connect to the container withpsqlor did you do something else?ubergesundheit commentedon Feb 13, 2015
I am using fig (http://fig.sh) for running a ruby on rails app which uses postgis. When I am running
fig run app rake db:migraterails tries to create the posgis extension withCREATE EXTENSION postgis;which then fails.md5 commentedon Feb 13, 2015
I just tested this successfully:
md5 commentedon Feb 13, 2015
Can you post your
fig.yml? It might also be relevant to find out what version of Fig you're using, but probably not.ubergesundheit commentedon Feb 13, 2015
fig --versionreturnsfig 1.0.0my fig.yml is
the dockerfile for the
appinstallspostgresql-clientmd5 commentedon Feb 13, 2015
I can't see anything there that would affect whether or not the extension control file would be found or readable by the Postgres process.
Any chance you could post the exact error you get back when you run
fig run app rake db:migrate? You may also want to look at whatfig logs dbhas to say after the failure.ubergesundheit commentedon Feb 14, 2015
the error rails produces:
and
fig logs dbmd5 commentedon Feb 14, 2015
And you said you were able to confirm that
/usr/share/postgresql/9.4/extension/postgis.controlexists with that exact path? Could you provide the output ofdocker exec $CONTAINERID ls -l /usr/share/postgresql/9.4/extension/postgis.control?md5 commentedon Feb 14, 2015
BTW, you probably don't want that
ports: "5432". That's exposing your container Postgres on the Docker host's IP with a random port. The linked container will work directly with port 5432 inside the container with theportsdeclaration.ubergesundheit commentedon Feb 14, 2015
It seems fig doesn't recognize changes in the fig yml. Earlier I had
image: postgresand now it starts the postgres image :| After I changed the name of the db to postgis fig recognized the different image. It now worksSorry I've bothered you :( This is a flaw in fig.
md5 commentedon Feb 14, 2015
Glad you figured it out. Since we took the time to debug it, it may be worth seeing if the issue has been reported at https://github.com/docker/fig