ericis opened a new issue, #1301:
URL: https://github.com/apache/answer/issues/1301
## Describe the bug
Auto-installation fails due to a new `legal` entry in the `site_info` table
(`type=legal` and `content={"external_content_display": "always_display"}`.
According to the documentation, this new entry does not appear to have an
[environment variable override](https://answer.apache.org/docs/env/).
### To Reproduce
Steps to reproduce the behavior:
Run Apache Answer with a container and set the environment variables. For
example, using `docker compose` and the "docker-compose.yaml" file...
1. Set `AUTO_INSTALL: true` environment variables
```
environment:
ADMIN_EMAIL: "${ANSWER_ADMIN_EMAIL:[email protected]}"
ADMIN_NAME: "${ANSWER_ADMIN_NAME:-admin}"
ADMIN_PASSWORD: "${ANSWER_ADMIN_PASSWORD:-admin123}"
AUTO_INSTALL: "true" # if set to true, the installation will be
completed automatically by environment variable.
CONTACT_EMAIL: "${ANSWER_ADMIN_EMAIL:[email protected]}"
DB_HOST: "database:3306"
DB_NAME: "${ANSWER_DATABASE_NAME:-answer}"
DB_PASSWORD: "${ANSWER_DATABASE_ROOT_PASSWORD:-admin123}"
DB_TYPE: "mysql"
DB_USERNAME: "${ANSWER_DATABASE_USERNAME:-admin}"
EXTERNAL_CONTENT_DISPLAY: "always_display"
INSTALL_PORT: "80"
LANGUAGE: "en-US"
LOG_LEVEL: "INFO"
SITE_ADDR: "0.0.0.0:80"
SITE_NAME: "Answer"
SITE_URL:
"http://${ANSWER_WEBSITE_HOST:-localhost}:${ANSWER_WEBSITE_PORT:-3030}"
SWAGGER_ADDRESS_PORT: ":${ANSWER_WEBSITE_PORT:-3030}"
SWAGGER_HOST: "${ANSWER_WEBSITE_HOST:-localhost}"
```
2. Start the website and see the error: "[auto-install] try to init by env
fail: external_content_display is a required field"
### Expected behavior
Website starts successfully with reasonable defaults or a new, required
environment variable is introduced to properly configure the
`external_content_display` value.
### Logs
```
Container devex-answer-web Creating
Container devex-answer-web Created
Container devex-answer-web Starting
Container devex-answer-web Started
Container devex-answer-web Waiting
Waiting for the database to initialize...
Assuming the database is initialized.
If there are issues, search for the message "Database connection failed" in
the logs.
Creating Apache Answer startup configuration...
Successfully created the Apache Answer startup configuration.
[upload-dir] try to install...
[upload-dir] install success, upload directory is /data/uploads
[i18n] try to install i18n bundle...
[i18n] find i18n bundle 45
install all initial environment done
config file exists, try to read the config...
config file read successfully, try to connect database...
check table not exist
[auto-install] try to install by environment variable
[auto-install] try to init by env fail: external_content_display is a
required field
[SUCCESS] answer installation service will run at:
[http://localhost:80/install/](http://localhost/install/)
Container devex-answer-web Healthy
```
> [!ERROR]
> Notice that the "try to init by env fail" error message is output. \*The
container reports as healthy due to a simple healthcheck against the localhost
endpoint that ignores whether the site was properly installed / initialized.
### Platform
- Device: All, but Desktop
- OS: All, but Windows 11 Professional
- Browser and version: All
- Version:
docker.io/apache/answer:1.4.1@sha256:502a93836aef9627ed66eb84dafcbe8a92536ad763fd0671795c49df847cbb55
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]