Incubator-superset: Failed testing Docker image

Created on 27 Sep 2018  Â·  7Comments  Â·  Source: apache/incubator-superset

Make sure these boxes are checked before submitting your issue - thank you!

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

Superset version

latest, followed https://superset.incubator.apache.org/installation.html

$ git show
commit 4c21c658244f995e76de027ec35d98ec7b173534 (HEAD -> master, origin/master, origin/HEAD)

Expected results

running docker instance and able to login

Actual results

work@735b8b78ea54:~/incubator-superset$ bash docker-init.sh failes:

  • Click version conflict:
    pkg_resources.ContextualVersionConflict: (Click 7.0 (/usr/local/lib/python3.6/site-packages), Requirement.parse('click==6.7'), {'Flask-AppBuilder'})

Solution for me:
$ pip3.6 install click==6.7 --user

  • permissions denied (1st):
    clean-webpack-plugin: /home/work/incubator-superset/superset/assets/dist has been removed. 95% emitting OptimizeCssAssetsWebpackPluginError: EACCES: permission denied, mkdir '/home/work/incubator-superset/superset/assets/dist'

  • permission denied (2nd):
    2018-09-27 07:13:29,300:ERROR:flask_appbuilder.security.sqla.manager:Creation of Permission View Error: (sqlite3.IntegrityError) UNIQUE constraint failed: ab_permission_view.permission_id, ab_permission_view.view_menu_id [SQL: 'INSERT INTO ab_permission_view (permission_id, view_menu_id) VALUES (?, ?)'] [parameters: (2, 5)] (Background on this error at: http://sqlalche.me/e/gkpj) 2018-09-27 07:13:29,311:ERROR:flask_appbuilder.security.sqla.manager:Add Permission to Role Error: Can't flush None value found in collection Role.permissions

  • connection refused to amqp://
    [2018-09-27 07:13:54,796: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused. Trying again in 2.00 seconds...

https://github.com/apache/incubator-superset/issues/5919 and https://github.com/apache/incubator-superset/issues/5916 do not help, I'm not able to change the permissions within the container:

$ chmod 777 /home/work/incubator-superset/superset/assets chmod: changing permissions of '/home/work/incubator-superset/superset/assets': Operation not permitted $ mkdir dist mkdir: cannot create directory ‘dist’: Permission denied

Consequences: login form is available, but login is not possible.

Steps to reproduce

follow https://superset.incubator.apache.org/installation.html:

git clone https://github.com/apache/incubator-superset/
cd incubator-superset
cp contrib/docker/{docker-build.sh,docker-compose.yml,docker-entrypoint.sh,docker-init.sh,Dockerfile} .
cp contrib/docker/superset_config.py superset/
bash -x docker-build.sh
docker-compose up -d
docker-compose exec superset bash
bash docker-init.sh

Docker host is Ubuntu 18.04.1 LTS, Kernel 4.15.0-34-generic

Most helpful comment

This is an issue related to click==6.7

To fix, I installed click==6.7 by editing the Docker file:

RUN pip install -e . --no-cache-dir  && pip install -r requirements-dev.txt --no-cache-dir 
#add this too
RUN pip install click==6.7

of course, The permanent solution is to edit requirements.txt and setup.py to add this dependency.

@abshammeri Thanks! You are awesome!

In addition to RUN pip install click==6.7, I added the parameter --user like so
RUN pip install click==6.7 --user

All 7 comments

This is an issue related to click==6.7

To fix, I installed click==6.7 by editing the Docker file:

RUN pip install -e . --no-cache-dir  && pip install -r requirements-dev.txt --no-cache-dir 
#add this too
RUN pip install click==6.7

of course, The permanent solution is to edit requirements.txt and setup.py to add this dependency.

@xentity for the record this situation should be solved by #5966.

The requirements.txt file has already been fixed in master, but the current docker image does not exploit it. The PR above fixes this situation (amongst other things)

Unfortunately not:

I added the click part within Dockerfile:

```RUN pip install --upgrade setuptools pip
RUN pip install -e . && pip install -r requirements-dev.txt

add this too

RUN pip install click==6.7

ENV PATH=/home/work/incubator-superset/superset/bin:$PATH
PYTHONPATH=./superset/:$PYTHONPATH

and re-ran the following commands:

bash -x docker-build.sh
docker-compose up -d
docker-compose exec superset bash
bash docker-init.sh

The results were (just the relevant parts):


clean-webpack-plugin: /home/work/incubator-superset/superset/assets/dist has been removed.
95% emitting OptimizeCssAssetsWebpackPluginError: EACCES: permission denied, mkdir '/home/work/incubator-superset/superset/assets/dist'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: NODE_ENV=production webpack --mode=production --colors --progress
npm ERR! Exit status 1


[2018-09-29 19:38:28,242: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
Trying again in 2.00 seconds...

Login is still not possible

**edit:**

I had a deeper look into Dockerfile. One line is: _chown -R work:work $HOME_ , but the user and group of assets (as an example) is not as expected. Therefore, user _work_ cannot create the sub-directory _dist_ .

work@8775c6225c26:~/incubator-superset/superset/assets$ ls -la
total 652
drwxr-xr-x 10 2024 5074 4096 Sep 27 06:55 .
drwxr-xr-x 13 2024 5074 4096 Sep 27 06:31 ..
-rw-r--r-- 1 2024 5074 121 Sep 27 06:31 .babelrc
-rw-r--r-- 1 2024 5074 140 Sep 27 06:31 .eslintignore
-rw-r--r-- 1 2024 5074 1187 Sep 27 06:31 .eslintrc
-rw-r--r-- 1 2024 5074 1365 Sep 27 06:31 .istanbul.yml
-rw-r--r-- 1 2024 5074 63166 Sep 27 06:31 backendSync.json
drwxr-xr-x 2 2024 5074 4096 Sep 27 06:31 branding
drwxr-xr-x 5 2024 5074 4096 Sep 27 06:31 cypress
-rw-r--r-- 1 2024 5074 134 Sep 27 06:31 cypress.json
-rwxr-xr-x 1 2024 5074 341 Sep 27 06:31 cypress_build.sh
lrwxrwxrwx 1 2024 5074 23 Sep 27 06:31 docs -> ../../docs/_build/html/
drwxr-xr-x 6 2024 5074 4096 Sep 27 06:31 images
-rwxr-xr-x 1 2024 5074 148 Sep 27 06:31 js_build.sh
drwxr-xr-x 1532 work work 57344 Sep 27 06:55 node_modules
-rw-r--r-- 1 2024 5074 6397 Sep 27 06:31 package.json
drwxr-xr-x 5 2024 5074 4096 Sep 27 06:31 spec
drwxr-xr-x 16 2024 5074 4096 Sep 27 06:31 src
drwxr-xr-x 5 2024 5074 4096 Sep 27 06:31 stylesheets
drwxr-xr-x 4 2024 5074 4096 Sep 27 06:31 vendor
-rw-r--r-- 1 2024 5074 4896 Sep 27 06:31 webpack.config.js
-rw-r--r-- 1 2024 5074 457113 Sep 27 06:31 yarn.lock
```

@xentity I think we misunderstood each other. In the PR I linked to, the command you are referring to does not exist.

This is an issue related to click==6.7

To fix, I installed click==6.7 by editing the Docker file:

RUN pip install -e . --no-cache-dir  && pip install -r requirements-dev.txt --no-cache-dir 
#add this too
RUN pip install click==6.7

of course, The permanent solution is to edit requirements.txt and setup.py to add this dependency.

@abshammeri Thanks! You are awesome!

In addition to RUN pip install click==6.7, I added the parameter --user like so
RUN pip install click==6.7 --user

similar issue when installing locally following: https://superset.incubator.apache.org/installation.html#python-s-setup-tools-and-pip

afaik, the issue would remain with this later method anyway as requirement.txt is not taken into account anyway (e.g: https://github.com/apache/incubator-superset/pull/4856)

but keep in mind that this was not the main point of my issue (I only listed the Click issue for the sake of completeness and found already a solution), but there is still the problem that _/home/work/incubator-superset/superset/assets/dist_ cannot be created, but is necessary to finish the docker-init.sh .

Was this page helpful?
0 / 5 - 0 ratings