hashicorp / hashicorp/vault-helm

Installing the Oracle Client for the Oracle Plugin

Open
#391 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
1.3k
Forks
898
Avg merge
3d 1h
Merged PRs (30d)
1

Description

I am trying to install the Oracle Client via init containers so I can use the Oracle database plugin. Without it I get the following

```
vault write database/config/my-oracle-database plugin_name=oracle-database-plugin connection_url="{{username}}/{{password}}@//oracle.url:1521/database" allowed_roles="*" username="" password=""
Error writing data to database/config/my-oracle-database: Error making API request.

URL: PUT https:///v1/database/config/my-oracle-database
Code: 400. Errors:

* error creating database object: fork/exec /usr/local/libexec/vault/oracle: no such file or directory
```

The extraInitContainers in my values.yaml looks like this

```
extraInitContainers:
- name: oracle
image: "alpine"
command: [sh, -c]
args:
- cd /tmp &&
wget https://releases.hashicorp.com/vault-plugin-database-oracle/0.2.1/vault-plugin-database-oracle_0.2.1_linux_amd64.zip -O oracle.zip &&
unzip oracle.zip &&
mv vault-plugin-database-oracle /usr/local/libexec/vault/oracle &&
chmod +x /usr/local/libexec/vault/oracle &&
mkdir /opt/oracle &&
cd /opt/oracle &&
wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-basic-linux.x64-19.8.0.0.0dbru.zip?xd_co_f=6ef738b0-f1fe-446f-8068-727ddce848ab -O oracle-client.zip &&
ls -al /opt/oracle &&
unzip oracle-client.zip &&
rm oracle-client.zip &&
chmod +x /opt/oracle/instantclient_19_8/
volumeMounts:
- name: plugins
mountPath: /usr/local/libexec/vault
- name: oracle-client
mountPath: /opt
```

After downloading the client and installing it in /opt/oracle, I get the following errors when trying to access all of the libraries needed for the Oracle plugin
```
ldd /usr/local/libexec/vault/oracle
/lib64/ld-linux-x86-64.so.2 (0x7f8929aea000)
libclntsh.so.19.1 => /opt/oracle/instantclient_19_8/libclntsh.so.19.1 (0x7f8925a20000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f8929aea000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f8929aea000)
libnnz19.so => /opt/oracle/instantclient_19_8/libnnz19.so (0x7f89252d6000)
libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f8929aea000)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f8929aea000)
Error loading shared library libnsl.so.1: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntsh.so.19.1)
librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f8929aea000)
Error loading shared library libaio.so.1: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntsh.so.19.1)
Error loading shared library libresolv.so.2: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntsh.so.19.1)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntsh.so.19.1)
libclntshcore.so.19.1 => /opt/oracle/instantclient_19_8/libclntshcore.so.19.1 (0x7f8924d35000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /opt/oracle/instantclient_19_8/libnnz19.so)
Error loading shared library libnsl.so.1: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntshcore.so.19.1)
Error loading shared library libaio.so.1: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntshcore.so.19.1)
Error loading shared library libresolv.so.2: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntshcore.so.19.1)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /opt/oracle/instantclient_19_8/libclntshcore.so.19.1)
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: canonicalize_file_name: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: __dn_expand: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: getcontext: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: __res_nsearch: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: bindresvport: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: __dn_skipname: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: __finite: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: __res_nclose: symbol not found
Error relocating /opt/oracle/instantclient_19_8/libclntsh.so.19.1: __res_ninit: symbol not found
```

Is there a way to use init containers to install the Oracle client and have it be usable by the Oracle plugin?

Contributor guide

Open the contributing guide

Research direction

Start with the chart's values.yaml and the extraInitContainers configuration shown in the issue, then trace the plugins and oracle-client volume mounts. Check how the Oracle plugin binary and its shared-library dependencies are made available to the Vault container. Done means the documented configuration lets the Oracle plugin load successfully and create its database configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, shell
Domain
database, devops
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.