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

When attempting to install the pg gem, the local extensions won't build on EL9 #774

Closed
dschlenk opened this issue Sep 20, 2024 · 3 comments
Assignees

Comments

@dschlenk
Copy link
Contributor

πŸ—£οΈ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

πŸ‘» Brief Description

When attempting to use the postgresql_user resource, which requires the pg gem, the gem installation fails while building local extensions:

have_library: checking for PQconnectdb() in -lpq... -------------------- no
 "gcc -o conftest -I/opt/cinc/embedded/include/ruby-3.1.0/x86_64-linux -I/opt/cinc/embedded/include/ruby-3.1.0/ruby/backward -I/opt/cinc/embedded/include/ruby-3.1.0 -I. -I/usr/include -I/opt/cinc/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe -I/opt/cinc/embedded/include   -I/opt/cinc/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector -O3 -g -pipe -fPIC conftest.c  -L. -L/opt/cinc/embedded/lib -Wl,-rpath,/opt/cinc/embedded/lib -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/cinc/embedded/lib -Wl,-rpath,/opt/cinc/embedded/lib -L. -Wl,-rpath,/opt/cinc/embedded/lib -L/opt/cinc/embedded/lib -fstack-protector-strong -L/opt/cinc/embedded/lib  -Wl,-rpath,/opt/cinc/embedded/lib -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed     -Wl,-rpath,/opt/cinc/embedded/lib -L/opt/cinc/embedded/lib -lruby -lpq  -lm  -lc"
/bin/ld: /usr/lib64/libldap.so.2: undefined reference to `EVP_md2@OPENSSL_3.0.0'
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <libpq-fe.h>
 4:
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13:
14:   return !!argv[argc];
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return !p; }
/* end */

This occurs whether using repo or os as the installation source.

πŸ₯ž Cookbook version

11.10.3

πŸ‘©β€πŸ³ Chef-Infra Version

18.5.0

🎩 Platform details

EL 9 x86_64, specifically oracle but also tested on centos stream 9
Using cinc-workstation 24.8.1068

Steps To Reproduce

Steps to reproduce the behavior:

  1. Attempt to converge a recipe in a cookbook that depends on postgresql that contains:
postgresql_install 'postgres' do
  source 'os'
  action %i(install init_server)
end

%w(127.0.0.1/32 ::1/128).each do |h|
  postgresql_access "postgresql #{h} host access" do
    type 'host'
    database 'all'
    user 'all'
    address h
    auth_method 'md5'
  end
end

postgresql_service 'postgresql' do
  action %i(enable start)
end

postgresql_user user do
  unencrypted_password 'one2three'
end
  1. Attempt to converge
  2. See error when the pg gem attempts to build native extensions

πŸš“ Expected behavior

The pg gem installs successfully.

βž• Additional context

I tracked it back to the openldap package in el9 building with MD2 support even though it isn't provided by libcrypto.so.3(OPENSSL_3.0.0) anymore and filed RHEL-59715 / MR26 but I guess I'm curious if anyone has any ideas for a workaround while waiting for errata? The pg gem will install in the system ruby but I assume that's due to some of the many, many patches they do to the openssl gem that their ruby comes with.

@dschlenk
Copy link
Contributor Author

ah, I didn't realize chef/cinc shipped its own libcrypto.so.3, which seems to be built without MD2, so this would be more of a chef bug I guess. I'll file a bug there also.

@damacus damacus self-assigned this Oct 8, 2024
@damacus
Copy link
Member

damacus commented Nov 1, 2024

Excellent thanks for that. I was trying to figure out what was going on with it. I had a PR waiting to fix this (I think I have). But it those changes shouldn't be needed.

@damacus
Copy link
Member

damacus commented Nov 4, 2024

You'll probably need libpq or something similar to that. Closed as part of #778

@damacus damacus closed this as completed Nov 4, 2024
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

2 participants