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

Compose file './docker-compose.yml' invalid #29583

Closed
3 tasks done
F041 opened this issue Jul 13, 2024 · 7 comments
Closed
3 tasks done

Compose file './docker-compose.yml' invalid #29583

F041 opened this issue Jul 13, 2024 · 7 comments
Assignees
Labels
install:docker Installation - docker container

Comments

@F041
Copy link

F041 commented Jul 13, 2024

Bug description

I followed https://superset.apache.org/docs/installation/docker-compose/ and I got this

~/superset$ docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.db.env_file contains {"path": "docker/.env", "required": true}, which is an invalid type, it should be a string
services.superset.env_file contains {"path": "docker/.env", "required": true}, which is an invalid type, it should be a string
services.superset-init.env_file contains {"path": "docker/.env", "required": true}, which is an invalid type, it should be a string
services.superset-node.env_file contains {"path": "docker/.env", "required": true}, which is an invalid type, it should be a string
services.superset-tests-worker.env_file contains {"path": "docker/.env", "required": true}, which is an invalid type, it should be a string
services.superset-worker.env_file contains {"path": "docker/.env", "required": true}, which is an invalid type, it should be a string
services.superset-worker-beat.env_file contains {"path": "docker/.env", "required": true}, which is an invalid type, it should be a string

on an ubuntu ARM machine

How to reproduce the bug

I followed https://superset.apache.org/docs/installation/docker-compose/

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the install:docker Installation - docker container label Jul 13, 2024
Copy link

dosubot bot commented Jul 13, 2024

Hey there, @F041! 👋 I'm here to help you with any bugs, questions, or contributions you have regarding the repository.

To resolve the error related to the docker/.env file being an invalid type when running docker-compose up for Apache Superset on an Ubuntu ARM machine, ensure that the .env file is correctly formatted and does not contain any syntax errors or unsupported characters. The provided .env file content appears to be correctly formatted. Here is the content for reference:

COMPOSE_PROJECT_NAME=superset

# database configurations (do not modify)
DATABASE_DB=superset
DATABASE_HOST=db
# Make sure you set this to a unique secure random value on production
DATABASE_PASSWORD=superset
DATABASE_USER=superset

EXAMPLES_DB=examples
EXAMPLES_HOST=db
EXAMPLES_USER=examples
# Make sure you set this to a unique secure random value on production
EXAMPLES_PASSWORD=examples
EXAMPLES_PORT=5432

# database engine specific environment variables
# change the below if you prefer another database engine
DATABASE_PORT=5432
DATABASE_DIALECT=postgresql
POSTGRES_DB=superset
POSTGRES_USER=superset
# Make sure you set this to a unique secure random value on production
POSTGRES_PASSWORD=superset
#MYSQL_DATABASE=superset
#MYSQL_USER=superset
#MYSQL_PASSWORD=superset
#MYSQL_RANDOM_ROOT_PASSWORD=yes

# Add the mapped in /app/pythonpath_docker which allows devs to override stuff
PYTHONPATH=/app/pythonpath:/app/docker/pythonpath_dev
REDIS_HOST=redis
REDIS_PORT=6379

FLASK_DEBUG=true
SUPERSET_ENV=development
SUPERSET_LOAD_EXAMPLES=yes
CYPRESS_CONFIG=false
SUPERSET_PORT=8088
MAPBOX_API_KEY=''

# Make sure you set this to a unique secure random value on production
SUPERSET_SECRET_KEY=TEST_NON_DEV_SECRET

ENABLE_PLAYWRIGHT=false
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
BUILD_SUPERSET_FRONTEND_IN_DOCKER=true

Ensure that the file is saved with the correct .env extension and does not contain any hidden characters or formatting issues that might cause Docker to misinterpret it. If the issue persists, try the following steps:

  1. Check for Hidden Characters: Ensure there are no hidden characters or BOM (Byte Order Mark) at the beginning of the file. You can use a text editor like vim or nano to check and remove any hidden characters.

  2. File Encoding: Ensure the file is saved with UTF-8 encoding without BOM.

  3. Line Endings: Ensure the file uses Unix-style line endings (\n). You can convert the line endings using a tool like dos2unix:

    dos2unix docker/.env
  4. Permissions: Ensure the file has the correct permissions to be read by Docker:

    chmod 644 docker/.env

After verifying and correcting these potential issues, try running docker-compose up again [1].

To continue talking to Dosu, mention @dosu.

@mistercrunch
Copy link
Member

I just tried to upgrade to latest docker-compose (ob my macbook pro M2 from 2.25.0 to 2.28.1) and fired $ docker-compose up without issues, what version are you on?

@F041
Copy link
Author

F041 commented Jul 17, 2024

docker-compose version 1.29.2, before running

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose

# Verify the installation
docker-compose version

then I got
docker-compose version 1.29.2, build unknown
and same error

@mistercrunch
Copy link
Member

mistercrunch commented Jul 17, 2024

Time to upgrade your docker-compose, the version you use appears to be 3+ years old

@mistercrunch
Copy link
Member

Adding this utility, it should help people set up dev environments -> #29609

@F041
Copy link
Author

F041 commented Jul 21, 2024

Solved doing something I feared:
**sudo rm /usr/local/bin/docker-compose**
and ofc then

sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

now I got v2.29

It took over 10 minutes to complete the docker-compose up, though (ARM, 4VCPU)
then I had the problem solved here #17076
quite heavy RAM usage btw, around 3GB

@alephpt
Copy link

alephpt commented Jul 29, 2024

In case anyone else ends up here as a result of SUPERSET_SECRET_KEY=TEST_NON_DEV_SECRET and you are looking in config.py, constants.py, superset_config.py .. don't forget to check /docker/.env and /docker/.env_non_dev if you are having issues with these settings.

I spent quite a while chasing down the location of that env over-ride, before realizing where it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install:docker Installation - docker container
Projects
None yet
Development

No branches or pull requests

3 participants