irods / irods_client_http_api

An iRODS C++ HTTP API using Boost.Beast
BSD 3-Clause "New" or "Revised" License
0 stars 8 forks source link

Error loading user mapping plugin in iRODS HTTP API 0.5 #377

Open sigau opened 1 day ago

sigau commented 1 day ago

Description:
We attempted to upgrade the iRODS HTTP API from version 0.3 to 0.5. After modifying the config.json file as per the new requirements and running the official Docker Hub image (irods/irods_http_api) or a manually built image, the server fails to load the user_claim plugin. The error persists in both scenarios.

Steps to Reproduce:

  1. Modify the config.json file according to the 0.5 version requirements.
  2. Run the Docker container using the following command:
    sudo docker run --rm --name irods_http_api \
       -v ./config.json:/config.json:ro \
       -p 9005:9005 \
       irods/irods_http_api

The following error appears in the logs:

[2024-12-02 10:04:02.232] [P:1] [trace] [T:1] load_user_mapping_plugin: Loading shared library at [/usr/lib/irods_http_api/user_mapping/libirods_http_api_plugin-user_claim.so].
Error: boost::dll::shared_library::load() failed (dlerror system message: /usr/lib/irods_http_api/user_mapping/libirods_http_api_plugin-user_claim.so: cannot open shared object file: No such file or directory): Bad file descriptor [generic:9]

Environment Details:

In the config.jsoon in the "user_mapping" parts we put :

"user_mapping": {
                    "plugin_path": "/usr/lib/irods_http_api/user_mapping/libirods_http_api_plugin-user_claim.so",
                    "configuration": {
                        "irods_user_claim": "claim_to_map_user"
                    }
                },

Troubleshooting Steps Taken:

  1. Verified the config.json syntax (passed validation successfully).
  2. Attempted using both the official Docker image and a manually built image.
  3. Checked the /usr/lib/irods_http_api/user_mapping/ directory inside the container — the required shared library is missing.

Questions:

  1. Is the libirods_http_api_plugin-user_claim.so library expected to be included in the official image?
  2. Are there additional steps required to configure or load the plugin?
  3. Could this be a missing dependency in the irods/irods_http_api:latest image?

Let us know if further information, such as the complete config.json, is needed for debugging.

korydraughn commented 1 day ago

Does it work if you change the plugin_path to the following?

/usr/lib/irods_http_api/plugins/user_mapping/libirods_http_api_plugin-user_claim.so
trel commented 1 day ago

https://github.com/irods/irods_client_http_api/blob/3824a09215a4b9b7e934178f2a7aa77b9654aa87/plugins/CMakeLists.txt

If the suggested path works, we'll need to update the README.md in at least two places.

sigau commented 1 day ago

Thank you for your quick response ! It turns out the issue was indeed with the incorrect path.

trel commented 1 day ago

Excellent.