Skip to content

Still can't use this if PG extensions are in use #11

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

Closed
imajes opened this issue Oct 28, 2021 · 15 comments
Closed

Still can't use this if PG extensions are in use #11

imajes opened this issue Oct 28, 2021 · 15 comments

Comments

@imajes
Copy link

imajes commented Oct 28, 2021

e.g.:

ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR:  
could not open extension control file "/usr/lib/postgresql/13/share/extension/citext.control": 
No such file or directory

why can't these be shipped?

@joergschiller
Copy link
Contributor

We see a similar error with the hstore extension:

ERROR:  could not open extension control file "/usr/lib/postgresql/13/share/extension/hstore.control": No such file or directory
STATEMENT:  CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;

The documentation states:

When building from the source distribution, these components are not built automatically, unless you build the "world" target [...]

Per documentation it should also be possible to build them with cd contrib && make && make install.

@raphi
Copy link

raphi commented Oct 29, 2021

Same error for extension uuid-ossp

@JoseLion
Copy link

Any workarounds for the moment? This issue is blocking from updating to PostgreSQL v14 since there's no legacy image for v14 (circleci/postgres).

I tried adding the postgresql-contrib package, but it seems not to solve the problem. Any suggestions?

- run:
    name: Add postgresql-contrib package
    command: |
      sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
      wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
      sudo apt-get -y update
      sudo apt-get -y install postgresql-contrib

PS: Thank you @joergschiller for the PR! I hope it gets merged soon 🙂

@giannisp
Copy link

giannisp commented Nov 1, 2021

Same here for PG 10.18 and pgcrypto (default contrib extension).

postgres=# create extension pgcrypto;
ERROR:  could not open extension control file "/usr/lib/postgresql/10/share/extension/pgcrypto.control": No such file or directory

Thanks for looking into this @joergschiller.

@vietqhoang
Copy link

vietqhoang commented Nov 1, 2021

We are experiencing the same issues.

We have a Ruby build (for our Rails app) which uses cimg/postgres:11.13. Both this and postgis variant yielded the following error in regards to the missing CITEXT extension.

ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR:  could not open extension control file "/usr/lib/postgresql/11/share/extension/citext.control": No such file or directory

Prior to this we were using the non-convenience images (circleci/postgres:11.12) and it functioned with no issues. I am assuming it came packaged with the extensions.

Our set-up uses the following extensions. I can't confirm if these extensions are missing in the convenience image, but if the image doesn't come with any extensions, then it is reasonable to say the extensions don't exist with the image:

  • citext
  • fuzzystrmatch
  • pg_stat_statements
  • pg_trgm
  • pgcrypto
  • plpgsql

Please advise on the best path forward to address this. The roadblock is preventing us from updating to the new convenience images.

denis-yuen added a commit to dockstore/dockstore-ui2 that referenced this issue Nov 2, 2021
@twohlix
Copy link

twohlix commented Nov 2, 2021

Same here too. We're just trying to enable btree_gist for PostGIS if it doesn't exist for our tests. Specifically:

CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;

gets us:

ERROR:  could not open extension control file "/usr/lib/postgresql/10/share/extension/btree_gist.control": No such file or directory

So 👍 to needing this to move away from circleci/postgres*postgis to cimg/postgres:10.18-postgis

@raivil
Copy link

raivil commented Nov 2, 2021

Same issue here on version 11.13.
Failed on the first extension creation:

ERROR:  could not open extension control file "/usr/lib/postgresql/11/share/extension/hstore.control": No such file or directory

Those other extensions are also used:

  • pg_trgm
  • uuid-ossp

denis-yuen added a commit to dockstore/dockstore-ui2 that referenced this issue Nov 2, 2021
* migrate to browser-tools
* postgres blocked with  CircleCI-Public/cimg-postgres#11
@FelicianoTech
Copy link
Contributor

This is being worked on. Updated images will be rolled out soon.

@imajes
Copy link
Author

imajes commented Nov 3, 2021

This is being worked on. Updated images will be rolled out soon.

Great news, @FelicianoTech! One quick note: this was was raised in the beta-test thread in your forums months ago. Perhaps you can feed that back to a retro -- if you have community spaces like your forums, then please look at the feedback and act on it where appropriate!

@FelicianoTech
Copy link
Contributor

@imajes Correct. I just took a look and found your Discuss post on when this was mentioned. In that same thread I mentioned taking a look followed by the GA announcement. Clearly I dropped the ball there.

Thank you for reintroducing this here as we can see by the +1s, others are having this same issue.

@FelicianoTech
Copy link
Contributor

Images have been updated to include extensions that are part of the PostgreSQL Contrib package.

Can people confirm on your end that the errors went away?

@vietqhoang
Copy link

Images have been updated to include extensions that are part of the PostgreSQL Contrib package.

Can people confirm on your end that the errors went away?

Our postgres step completed without issue. I would say the extensions error went away.

Although I have now encountered a different issue with the convenience ruby image and the mismatch of major node versions between the deprecated and convenience images. But that's an issue for a different repo :)

Thanks for the quick turnaround!

@joergschiller
Copy link
Contributor

We also can confirm that the issue is resolved.

@JoseLion
Copy link

JoseLion commented Nov 3, 2021

@FelicianoTech extensions hstore and pgcrypto are working for me too, thanks! 🎉

PS: Now I have data to compare tests running on cimg/postgres:14 vs. circleci/postgres:13.4-ram. It seems like testing times have increased from ~15s to an average of ~23s. I can open a separate issue with more details if it makes sense. Maybe it is helpful to have a -ram variation of the image 🙂

@FelicianoTech
Copy link
Contributor

FelicianoTech commented Nov 4, 2021

Awesome. I'm going to consider this resolved at this point. I want to thank @joergschiller for the PR that brought in all the contrib extensions, thus solving this issue.

@JoseLion Yes please open an issue on this and share whatever data you may have. I'm also curious as to scenarios where maybe running in RAM can be a negative.

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

No branches or pull requests

9 participants