mljar / mercury

Convert Jupyter Notebooks to Web Apps
https://RunMercury.com
GNU Affero General Public License v3.0
4.03k stars 255 forks source link

Error while installing from dockerfile #378

Open catabram opened 1 year ago

catabram commented 1 year ago

Hi!

I'm getting an error while installing mercury from docker file from https://github.com/mljar/mercury.git using instruction https://runmercury.com/docs/docker-compose/, could you pls help?

Step 8/17 : RUN mamba install --yes python=3.8 --file mercury/requirements.txt -c conda-forge
 ---> Running in 5b4b3355f24a                        
Traceback (most recent call last):                   
  File "/opt/conda/bin/mamba", line 7, in <module>   
    from mamba.mamba import main                     
  File "/opt/conda/lib/python3.11/site-packages/mamba/mamba.py", line 44, in <module>
    import libmambapy as api                         
  File "/opt/conda/lib/python3.11/site-packages/libmambapy/__init__.py", line 7, in <module>
    raise e                                          
  File "/opt/conda/lib/python3.11/site-packages/libmambapy/__init__.py", line 4, in <module>
    from libmambapy.bindings import *  # noqa: F401,F403
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                
ImportError: /opt/conda/lib/python3.11/site-packages/libmambapy/../../../libmamba.so.2: undefined symbol: solver_ruleinfo2str, version SOLV_1.0
ERROR: Service 'mercury' failed to build: The command '/bin/sh -c mamba install --yes python=3.8 --file mercury/requirements.txt -c conda-forge' returned a non-zero code: 1

System: CentOS 7

pplonski commented 1 year ago

Hi @catabram,

Did you manage to solve the issue? Do you have more logs?

catabram commented 1 year ago

Hi Piotr!

No, haven't managed yet, but found some relevant info in mamba: https://mamba.readthedocs.io/en/latest/user_guide/troubleshooting.html#libmamba-so-2-undefined-symbol. It seems some conflicts with default mamba & conda-forge, tried recepy from here, as well python 3.8 not working now. Tried with python 3.10, got this image and errors in network: image

pplonski commented 1 year ago

Thanks for response @catabram, looks like server is working because you have screenshot with API viewer. It is a good sign. Have you customised nginx configuration? Are you able to attach your nginx config? Because it looks like frontend is not displayed, which might be caused by improper nginx config.

catabram commented 1 year ago

@pplonski Hi! There's nginx config (I have external one insead of included in docker):

server {
  listen  80;
  server_name mercury.----host----;
  return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name mercury.----host----;
    server_tokens off;

    ssl_certificate /etc/nginx/ssl/mercury.----host----/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/mercury.----host----/privkey.pem;
    ssl_trusted_certificate /etc/nginx/ssl/mercury.----host----/chain.pem;

    client_max_body_size 20M;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    location /api {
        try_files $uri @proxy_api;
    }
    location /admin {
        try_files $uri @proxy_api;
    }

    location @proxy_api {
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Url-Scheme $scheme; 
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass   http://----host----:9010;
    }

    location /ws {
        try_files $uri @proxy_ws;
    }

    location @proxy_ws {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_redirect off;
        proxy_pass   http://----host----:9010;
    }

    location /django_static/ {
        autoindex on;
        alias /var/lib/docker/volumes/mercury_static_volume/_data/;
    }

    location /media/ {
        autoindex on;
        alias /var/lib/docker/volumes/mercury_media_volume/_data/;
    }
}
pplonski commented 1 year ago

Thanks for nginx config. In the screenshot you are using port 9010, in ngnix you are not setting this port ... Is it working without port number?

boryakbrk commented 1 year ago

@pplonski Hi! The container with mercury listens to port 9010 which is proxied to port 9000 inside the container. In our environment, port 9000 is already occupied, and we use an external nginx balancer.

I believe there have been changes in the python dependencies that can no longer be installed on python version 3.8. For the same reason, mercury is not working properly.

pplonski commented 1 year ago

You might be right, I have reports from that docker is not working with 3.8 https://github.com/mljar/mercury/issues/385

pplonski commented 1 year ago

I've updated the Dockerfile, please check #385.

boryakbrk commented 1 year ago

I've updated the Dockerfile, please check #385.

I applied these fixes initially, we still see the broken mercury interface. There are no errors in the container logs.

pplonski commented 1 year ago

Please double check your nginx configuration. Have you changed the port number in docker entrypoint script https://github.com/mljar/mercury/blob/main/docker/mercury/entrypoint.sh (line 37).

catabram commented 1 year ago

Hi, port set to 9010 at this line