bgruening / docker-galaxy-stable

:whale::bar_chart::books: Docker Images tracking the stable Galaxy releases.
http://bgruening.github.io/docker-galaxy-stable
MIT License
225 stars 133 forks source link

Filename provided by nginx (/tmp/nginx_upload_store/0020518321) is not in correct directory (/export/nginx_upload_store) #412

Open bollig opened 6 years ago

bollig commented 6 years ago

Started a container with the following:

de8845e56375 bgruening/galaxy-stable:latest "/usr/bin/startup" 11 days ago Up 2 hours 21/tcp, 80/tcp, 0.0.0.0:443->443/tcp, 8800/tcp, 0.0.0.0:9002->9002/tcp, 0.0.0.0:8022->22/tcp berserk_kare

I'm getting this error when I try to upload a local file to galaxy:

galaxy.web.framework.decorators ERROR 2018-01-02 21:27:36,410 Uncaught exception in exposed API method: Traceback (most recent call last): File "lib/galaxy/web/framework/decorators.py", line 281, in decorator rval = func(self, trans, *args, **kwargs) File "lib/galaxy/webapps/galaxy/api/tools.py", line 348, in create vars = tool.handle_input(trans, incoming, history=target_history) File "lib/galaxy/tools/init.py", line 1280, in handle_input populate_state(request_context, self.inputs, expanded_incoming, params, errors) File "lib/galaxy/tools/parameters/init.py", line 313, in populate_state populate_state(request_context, input.inputs, incoming, rep_state, errors, prefix=rep_prefix, context=context, check=check) File "lib/galaxy/tools/parameters/init.py", line 316, in populate_state value, error = check_param(request_context, input, param_value, context) if check else [param_value, None] File "lib/galaxy/tools/parameters/init.py", line 132, in check_param value = param.from_json(value, trans, param_values) File "lib/galaxy/tools/parameters/basic.py", line 524, in from_json assert local_filename.startswith(upload_store), "Filename provided by nginx (%s) is not in correct directory (%s)." % (local_filename, upload_store) AssertionError: Filename provided by nginx (/tmp/nginx_upload_store/0020518321) is not in correct directory (/export/nginx_upload_store).

Looking at /etc/nginx/nginx.conf, I see line 138 is set to:

        upload_store /tmp/nginx_upload_store;

I resolved the issue by updating line 138 to:

        upload_store /export/nginx_upload_store;

I think this should be the default setting for the container build.

bgruening commented 6 years ago

Hi @bollig! I just tried with docker run -i -t -p 8080:80 bgruening/galaxy-stable and it works fine for me. How old is your image? Does it have any other modifications? How do you start your image? We have test cases that are supposed to catch those errors so I'm really clue less about your bug :(

ThomasWollmann commented 6 years ago

Having the same problem on tag 17.09 :/

bgruening commented 6 years ago

@ThomasWollmann how do you start the image?

ThomasWollmann commented 6 years ago

docker-compose. Do you want some details of the Dockerfile or docker-compose.yml?

bgruening commented 6 years ago

Oh, you are running the compose version? I thought the issue here is about the single-container version. In case of compose, I probably need to have both.

ThomasWollmann commented 6 years ago

I'm using the single-container version in a composer setup. Part of docker-compose.yml:

version: '2.1'
services:
  galaxy:
    build: .
    privileged: true
    ports:
        - "443:443"
        - "8022:22"
        - "8800:8800"
    environment:
        UWSGI_PROCESSES: 4
        UWSGI_THREADS: 8
        GALAXY_HANDLER_NUMPROCS: 2
        USE_HTTPS: 'True'
        NONUSE: 'reports'
        GALAXY_CONFIG_REQUIRE_LOGIN: 'True'

Small part of the Dockerfile:

FROM bgruening/galaxy-stable:17.09

ENV GALAXY_CONFIG_CLEANUP_JOB=${GALAXY_CONFIG_CLEANUP_JOB:-onsuccess} \
    GALAXY_CONFIG_ALLOW_USER_DATASET_PURGE=True \
    GALAXY_CONFIG_ALLOW_USER_CREATION=False \
    GALAXY_CONFIG_ALLOW_USER_DELETION=True \
    GALAXY_CONFIG_ALLOW_USER_IMPERSONATION=True \
    GALAXY_CONFIG_ALLOW_LIBRARY_PATH_PASTE=True \
    GALAXY_CONFIG_ENABLE_BETA_WORKFLOW_MODULES=True \
    ENABLE_TTS_INSTALL=True \
    GALAXY_DOCKER_ENABLED=True \
    GALAXY_DOCKER_VOLUMES='$galaxy_root:ro,$galaxy_root/database/tmp:rw,$tool_directory:ro,$job_directory:ro,$working_directory:rw,$default_file_path:rw'

COPY config/tool_conf.xml $GALAXY_ROOT/config/tool_conf.xml
COPY shed_tools.yml $GALAXY_ROOT/shed_tools.yaml
RUN install-tools $GALAXY_ROOT/shed_tools.yaml  && \
    /tool_deps/_conda/bin/conda clean --tarballs --yes > /dev/null && \
    rm /export/galaxy-central/ -rf
COPY workflows/ /tmp/workflows/
RUN startup_lite && \
    galaxy-wait && \
    workflow-install --workflow_path /tmp/workflows/ -g http://localhost:8080 -u $GALAXY_DEFAULT_ADMIN_USER -p $GALAXY_DEFAULT_ADMIN_PASSWORD
COPY interactive_environments/ $GALAXY_ROOT/config/plugins/interactive_environments/
COPY web/ $GALAXY_CONFIG_DIR/web/

P.S. "install-tools" also does not work any more in 17.09. Error: "/usr/bin/install-tools: line 50: shed-install: command not found"

bgruening commented 6 years ago

please try to quay.io version. Dockerhub is really not good anymore. quay.io/bgruening/galaxy:17.09

ThomasWollmann commented 6 years ago

install-tools works with the quay version. Upload is still broken :/

P.S. Just notices IEs also not working: "docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?."

bgruening commented 6 years ago

P.S. Just notices IEs also not working: "docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?."

are you running DiD or Docker next to Docker?

ThomasWollmann commented 6 years ago

DiD

ThomasWollmann commented 6 years ago

Couldn't figure it out yet. My current trace:

galaxy_1  |
galaxy_1  | ==> /home/galaxy/logs/uwsgi.log <==
galaxy_1  | galaxy.web.framework.decorators ERROR 2018-02-07 10:39:55,422 Uncaught exception in exposed API method:
galaxy_1  | Traceback (most recent call last):
galaxy_1  |   File "lib/galaxy/web/framework/decorators.py", line 281, in decorator
galaxy_1  |     rval = func(self, trans, *args, **kwargs)
galaxy_1  |   File "lib/galaxy/webapps/galaxy/api/tools.py", line 348, in create
galaxy_1  |     vars = tool.handle_input(trans, incoming, history=target_history)
galaxy_1  |   File "lib/galaxy/tools/__init__.py", line 1280, in handle_input
galaxy_1  |     populate_state(request_context, self.inputs, expanded_incoming, params, errors)
galaxy_1  |   File "lib/galaxy/tools/parameters/__init__.py", line 367, in populate_state
galaxy_1  |     populate_state(request_context, input.inputs, incoming, rep_state, errors, prefix=rep_prefix, context=context, check=check)
galaxy_1  |   File "lib/galaxy/tools/parameters/__init__.py", line 370, in populate_state
galaxy_1  |     value, error = check_param(request_context, input, param_value, context) if check else [param_value, None]
galaxy_1  |   File "lib/galaxy/tools/parameters/__init__.py", line 186, in check_param
galaxy_1  |     value = param.from_json(value, trans, param_values)
galaxy_1  |   File "lib/galaxy/tools/parameters/basic.py", line 524, in from_json
galaxy_1  |     assert local_filename.startswith(upload_store), "Filename provided by nginx (%s) is not in correct directory (%s)." % (local_filename, upload_store)
galaxy_1  | AssertionError: Filename provided by nginx (/tmp/nginx_upload_store/0000000002) is not in correct directory (/export/nginx_upload_store).
g
mvdbeek commented 6 years ago

the hackish way around this would be to export GALAXY_CONFIG_NGINX_UPLOAD_STORE=/tmp/nginx_upload_store/. If /tmp is tool small you can export an additional volume to /tmp

ThomasWollmann commented 6 years ago

Thanks! Works for me.