Egg: MariaDB
File: database/sql/mariadb/egg-maria-d-b.json
Issue Description:
When trying to start the MariaDB container (any version) on an ARM64 host (e.g., Oracle Cloud ARM), the server fails to initialize properly and throws multiple LD_PRELOAD errors, followed by an access denied error for the container user.
Error logs
ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libnss_wrapper.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
[...]
ERROR 1698 (28000): Access denied for user 'container'@'localhost'
FATAL ERROR: Upgrade failed
The Cause
The entrypoint script or environment configuration hardcodes the architecture path for libnss_wrapper.so to /usr/lib/x86_64-linux-gnu/libnss_wrapper.so. On ARM64 systems, this library is located at /usr/lib/aarch64-linux-gnu/libnss_wrapper.so. Because the file cannot be loaded, the user permissions are not mapped correctly, leading to the database connection being denied.
Proposed Solution
The start script should dynamically detect the architecture (for example, by using uname -m) and set the LD_PRELOAD path accordingly, or simply check which of the two directories exists before exporting the variable.
Example:
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ]; then
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libnss_wrapper.so
else
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libnss_wrapper.so
fi
Egg: MariaDB
File: database/sql/mariadb/egg-maria-d-b.json
Issue Description:
When trying to start the MariaDB container (any version) on an ARM64 host (e.g., Oracle Cloud ARM), the server fails to initialize properly and throws multiple LD_PRELOAD errors, followed by an access denied error for the container user.
Error logs
ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libnss_wrapper.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
[...]
ERROR 1698 (28000): Access denied for user 'container'@'localhost'
FATAL ERROR: Upgrade failed
The Cause
The entrypoint script or environment configuration hardcodes the architecture path for libnss_wrapper.so to /usr/lib/x86_64-linux-gnu/libnss_wrapper.so. On ARM64 systems, this library is located at /usr/lib/aarch64-linux-gnu/libnss_wrapper.so. Because the file cannot be loaded, the user permissions are not mapped correctly, leading to the database connection being denied.
Proposed Solution
The start script should dynamically detect the architecture (for example, by using uname -m) and set the LD_PRELOAD path accordingly, or simply check which of the two directories exists before exporting the variable.
Example:
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ]; then
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libnss_wrapper.so
else
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libnss_wrapper.so
fi