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

Failed testing Docker image #5987

Closed
3 tasks done
xentity opened this issue Sep 27, 2018 · 7 comments · Fixed by #5966
Closed
3 tasks done

Failed testing Docker image #5987

xentity opened this issue Sep 27, 2018 · 7 comments · Fixed by #5966

Comments

@xentity
Copy link

xentity commented Sep 27, 2018

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

  • I have checked the superset logs for python stacktraces and included it here as text if 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

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...

#5919 and #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

@abshammeri
Copy link

abshammeri commented Sep 28, 2018

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.

@victornoel
Copy link
Contributor

@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)

@xentity
Copy link
Author

xentity commented Sep 29, 2018

Unfortunately not:

I added the click part within Dockerfile:

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! superset@0.999.0-dev build: `NODE_ENV=production webpack --mode=production --colors --progress`
npm ERR! Exit status 1

and

[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

@victornoel
Copy link
Contributor

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

@CloudChaoszero
Copy link

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

@gwbx
Copy link

gwbx commented Oct 2, 2018

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: #4856)

@xentity
Copy link
Author

xentity commented Oct 3, 2018

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants