superset: Running "docker-compose up" fails to compile successfully (Error on importing STR_NA_VALUES from pandas)

Running docker-compose up on version 1.3.2 (and 1.4.0rc3) fails to compile.

I understand that we are meant to use the non-dev build (i.e. docker-compose -f docker-compose-non-dev.yml up) in order to use the superset app when running via docker, but there are also times where we may want to make modifications which would require the docker-compose up command to be run?

How to reproduce the bug

  1. Go to release on the github, download the 1.3.2 zip (https://github.com/apache/superset/archive/refs/tags/1.3.2.zip) (edit: also happens on 1.4.0rc3, you can try it with that too)
  2. Extract the folder
  3. Enter the superset-1.3.2 folder in a terminal
  4. Run docker-compose up

Expected results

I would expect to be presented with the Superset login screen / welcome page when viewing on browser. image

I would expect it to compile successfully without error.

Actual results

Presented with stack trace of error when viewing in browser. image

The docker logs say this, or similar in most of the containers (app, worker, worker-beat):
ImportError: cannot import name 'STR_NA_VALUES' from 'pandas.io.parsers' (/usr/local/lib/python3.8/site-packages/pandas/io/parsers/__init__.py) in most containers.

More full logs here: https://0bin.net/paste/QaIy4jLo#n1g3eqjy3UCcxVj6OZ2VLYge32s-nN2aWqLNy7XCTNE

Environment

(please complete the following information):

  • docker: Docker version 20.10.12, build e91ed57
  • browser type and version: N/A (any / all), tested on ChromeVersion 97.0.4692.71 (Official Build) (64-bit)
  • superset version: 1.3.2 / Superset 0.0.0dev (according to running command in docker container)
  • python version: Python 3.8.12 (according to running command in docker container)
  • node.js version: OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "node": executable file not found in $PATH: unknown (according to running command in docker container)
  • any feature flags active: Unsure / Only default

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

Additional context

Here is the pip freeze on the superset app docker container: https://0bin.net/paste/aKKgpHJ3#uAUB7QBQyt7wpPXn6d3CPtjoFsnMZI0+oF7VymnAwbO

I see that pandas is on 1.3.4 but in the requirements base.txt it is 1.2.2, so I am not sure how it upgraded itself ( I haven’t checked if other packages are correct or not)

Might be related to this? https://github.com/apache/superset/pull/16400

Other user had an error here similar: https://github.com/apache/superset/issues/17333 but I didn’t understand how they fixed it.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Just ran into this trying to develop against 1.3, but I was able to resolve it by running docker build -t apache/superset:latest-dev ., which made sure I had the right versions of things in the docker image. An alternative workaround might be to find a suitable version here and pull it.

docker-compose.yml is configured to use apache/superset:latest-dev, which presumably is built from the master branch. So by building locally you can ensure you have the right versions of things for your branch.

The pull request from @ravimakhija #16400 does seem to fix it, if I set it to use pandas._libs.parsers instead of pandas.io.parsers in the superset/config.py

No need of this, docker build -t apache/superset:latest-dev . takes care of it too.

Oh wow that seems like a better option, thank you 😃

Cause: Git clone from any branch other than master, doesn’t build & get all the required files/folders for docker to run in development mode.

Solution: The below command should be ran first to get all the required files/folders for docker. docker build -t apache/superset:latest-dev .

Order of execution:

  1. Remove all the node modules in superset-frontend folder.
  2. delete all volumes in docker related to the existing container. ( docker-compose down -v )
  3. docker build -t apache/superset:latest-dev .
  4. docker-compose up
  5. Wait until superset-init & superset-node complete.

@jenseng thanks man! It helps.