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

[BUG] The order of the options loaded from config/node.options and NODE_OPTIONS differs between Windows and non-Windows #3502

Closed
AMoo-Miki opened this issue Feb 28, 2023 · 1 comment · Fixed by #3508
Assignees
Labels
bug Something isn't working

Comments

@AMoo-Miki
Copy link
Collaborator

Describe the bug

On Windows

IF EXIST "%CONFIG_DIR%\node.options" (
for /F "eol=# tokens=*" %%i in (%CONFIG_DIR%\node.options) do (
If [!NODE_OPTIONS!] == [] (
set "NODE_OPTIONS=%%i"
) Else (
set "NODE_OPTIONS=!NODE_OPTIONS! %%i"
)
)
)
:: Include pre-defined node option
set "NODE_OPTIONS=--no-warnings --max-http-header-size=65536 %NODE_OPTIONS%"

On Windows, when opensearch-dashboards.bat is called, the options read in from config/node.options are appended to any NODE_OPTIONS that might have existed.

On others

if [ -f "${CONFIG_DIR}/node.options" ]; then
OSD_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)"
fi
NODE_OPTIONS="--no-warnings --max-http-header-size=65536 $OSD_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli/dist" ${@}

When opensearch-dashboards is called, the options read in from config/node.options are passed in and then NODE_OPTIONS is appended.

The difference is that on Windows, config/node.options override NODE_OPTIONS.

@AMoo-Miki AMoo-Miki added bug Something isn't working untriaged labels Feb 28, 2023
@kavilla kavilla removed the untriaged label Feb 28, 2023
@kavilla
Copy link
Member

kavilla commented Feb 28, 2023

Removing untriaged label as by definition since it is opened by a maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants