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

Redmine: REDMINE_DATA_TO_PERSIST without ${REDMINE_CONF_DIR}/... is not working #76111

Open
kiblik opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
redmine tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@kiblik
Copy link

kiblik commented Jan 8, 2025

Name and Version

bitnami/redmine:6.0.1-debian-12-r1

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Configure the environment variable REDMINE_DATA_TO_PERSIST with the value files plugins public/plugin_assets. This excludes ${REDMINE_CONF_DIR}/configuration.yml and ${REDMINE_CONF_DIR}/database.yml from the default persistence settings.
  2. Launch the Redmine instance and allow it to fully initialize.
  3. Restart the instance. You'll notice that it fails to start properly.

Explanation of the Issue

During the first start, the instance creates all necessary configuration files (in ${REDMINE_CONF_DIR} and other directories like files and plugins). It also sets up and migrates the database.

On subsequent starts, the redmine_initialize function checks the app's status using is_app_initialized. It detects a non-empty $persist_dir (due to the existing files directory) and proceeds to the else part of the initialization logic.


is_app_initialized() {
local -r app="${1:?missing app}"
local -r persist_dir="${BITNAMI_VOLUME_DIR}/${app}"
if ! is_mounted_dir_empty "$persist_dir"; then
true
else
false
fi
}

This process assumes that configuration.yml and database.yml are already set up and tries to use them automatically. However, this assumption leads to a failure.

What is the expected behavior?

The desired outcome was to deploy an instance that doesn't persist configuration files on the volume (for security reasons). Instead, it should generate configuration.yml and database.yml based on the latest environment variables during each boot.

What do you see instead?

While the first boot appears successful, all subsequent restarts fail with errors:

redmine 22:28:17.88 INFO  ==> Restoring persisted Redmine installation
redmine 22:28:17.94 INFO  ==> Trying to connect to the database server
redmine 22:28:17.94 DEBUG ==> Getting production.host from Redmine configuration
redmine 22:28:17.99 DEBUG ==> Getting production.port from Redmine configuration
redmine 22:28:18.00 DEBUG ==> Getting production.database from Redmine configuration
redmine 22:28:18.01 DEBUG ==> Getting production.username from Redmine configuration
redmine 22:28:18.03 DEBUG ==> Getting production.password from Redmine configuration
redmine 22:28:18.04 DEBUG ==> Getting production.adapter from Redmine configuration
/opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
redmine 22:28:18.11 DEBUG ==> Executing SQL command:
SELECT 1
/opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
Unknown suffix 'n' used for variable 'port' (value 'null'). Legal suffix characters are: K, M, G, T, P, E
/opt/bitnami/mysql/bin/mysql: Error while setting value 'null' to 'port'
/opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead

Additional information

The original plan was to migrate an old deployment to Helm, using an external database and custom persistent storage for files. The intention was to move the database to a new external location and transfer data to the new custom persistent storage. However, because the data migration created a files directory in the expected location, redmine_initialize didn't attempt to create a new database.yml. The presence of the files directory caused redmine_initialize to return true, assuming the app was already initialized.

@kiblik kiblik added the tech-issues The user has a technical issue about an application label Jan 8, 2025
@github-actions github-actions bot added the triage Triage is needed label Jan 8, 2025
@carrodher
Copy link
Member

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redmine tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants