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

Incorrect CORS variable definition in docker.env #4974

Closed
zackkrida opened this issue Sep 23, 2024 · 2 comments · Fixed by #4992
Closed

Incorrect CORS variable definition in docker.env #4974

zackkrida opened this issue Sep 23, 2024 · 2 comments · Fixed by #4992
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: mgmt Related to repo management and automations

Comments

@zackkrida
Copy link
Member

Description

A user has reported an issue with our docker/es/env.docker file:

a issue i got after that was regarding
http.cors.allow-origin="/./"
in docker.env
it wasn't expecting "-" as valid string i have to change it to
http_cors_allow_origin=/.
/="/.*/"
then it was working fine

Note that this user is using WSL which could potentially be related. Otherwise it would seem that multiple of the values in our Elasticsearch docker.env file are invalid:

# Disable XPack
# https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docker.html#_security_note
xpack.security.enabled="false"
discovery.type="single-node"
http.cors.enabled="true"
http.cors.allow-origin="/.*/"
# Elasticsearch will reserve 50-60% of available system memory
# if left to its own devices. Setting this to half a GB is sufficient
# for local testing and prevent ES from hogging such a significant
# amount of system memory.
ES_JAVA_OPTS="-Xms512m -Xmx512m"

@zackkrida zackkrida added 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🛠 goal: fix Bug fix labels Sep 23, 2024
@openverse-bot openverse-bot moved this to 📋 Backlog in Openverse Backlog Sep 23, 2024
@dryruffian
Copy link
Contributor

error: Recipe `dc` failed on line 212 with exit code 15
env COMPOSE_PROFILES="api" docker compose -f docker-compose.yml up -d
failed to read /home/adtiya/OpenSource/openverse/docker/es/env.docker: line 8: unexpected character "-" in variable name "http.cors.allow-origin=\"/.*/\""

this is the error message popping up

@openverse-bot openverse-bot moved this from 📋 Backlog to 📅 To Do in Openverse Backlog Sep 25, 2024
@sarayourfriend sarayourfriend added 🟨 priority: medium Not blocking but should be addressed soon 💻 aspect: code Concerns the software code in the repository 🧱 stack: mgmt Related to repo management and automations and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Sep 25, 2024
@sarayourfriend
Copy link
Collaborator

This is a docker compose bug, which should be fixed by upgrading to the latest compose once it comes out: docker/compose#12123

I'm seeing this locally now after running ov init (not on WSL).

We can either:
0. Versionlock Docker compose to the version before this bug (flaky long-term)

  1. Convert this env.docker file to a real Elasticsearch configuration file
  2. Update all the environment variables to use Elasticsearch's actual environment variable rules, which are listed here: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-configuration-methods

The last option is the easiest, but ultimately hurts discoverability of what those options mean (much harder to search ES docs or the web), so I'd only consider it a stop-gap to using a regular Elasticsearch configuration file.

@sarayourfriend sarayourfriend added the 🟥 priority: critical Must be addressed ASAP label Sep 25, 2024
@openverse-bot openverse-bot moved this from 📅 To Do to 🏗 In Progress in Openverse Backlog Sep 25, 2024
@openverse-bot openverse-bot moved this from 🏗 In Progress to ✅ Done in Openverse Backlog Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: mgmt Related to repo management and automations
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants