Question: uWSGI mule setup + nginx fails
0
gravatar for manuel.pasieka
7 months ago by
manuel.pasieka30 wrote:

Hi,

I am trying to setup a new local (none cluster) galaxy installation based on v18.01 that should serve multiple users.

Reading the galaxy in production documentation https://docs.galaxyproject.org/en/latest/admin/production.html and https://docs.galaxyproject.org/en/master/admin/scaling.html I understood that

uWSGI for web serving with Mules as job handlers + nginx handling proxying of static context and file uploads is the best solution.

Sadly i am unable to get this setup to work.

galaxy and nginx start both fine, without any errors, but i cannot reach the galaxy web server (not on 8080 where galaxy should be served directly, nor on 80 through nginx)

In /var/log/nginx/error.log i can see the error message

*19 connect() to unix:///opt/galaxy/var/uwsgi.sock failed (2: No such file or directory) while connecting to upstream, client: 10.42.160.99, server: _, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///opt/galaxy/var/uwsgi.sock:", host ...

In /etc/nginx/sites-enabled/galaxy

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;


    # use a variable for convenience
    set $galaxy_root /opt/galaxy;

    # Enable HSTS
    add_header Strict-Transport-Security "max-age=15552000; includeSubdomains";

    # proxy all requests not matching other locations to uWSGI
    location / {
        uwsgi_pass unix:///opt/galaxy/var/uwsgi.sock;
        uwsgi_param UWSGI_SCHEME $scheme;
        include uwsgi_params;
    }

    # serve framework static content
    location /static/style {
        alias $galaxy_root/static/style/blue;
        expires 24h;
    }
    location /static {
        alias $galaxy_root/static;
        expires 24h;
    }
    location /robots.txt {
        alias $galaxy_root/static/robots.txt;
        expires 24h;
    }
    location /favicon.ico {
        alias $galaxy_root/static/favicon.ico;
        expires 24h;
    }

    # serve visualization and interactive environment plugin static content
    location ~ ^/plugins/(?<plug_type>.+?)/(?<vis_name>.+?)/static/(?<static_file>.*?)$ {
        alias $galaxy_root/config/plugins/$plug_type/$vis_name/static/$static_file;
        expires 24;
    }
}

In galaxy/config/galaxy.yml i set

uwsgi:
  http: :8080
  socket: unix:///opt/galaxy/var/uwsgi.sock

the sock file does not exist. Who should create that? the nginx proxy, or galaxy? Any ideas why i cannot reach the webserver?

uwsgi nginx socket • 669 views
ADD COMMENTlink modified 7 months ago by Nate Coraor3.2k • written 7 months ago by manuel.pasieka30
2
gravatar for Nate Coraor
7 months ago by
Nate Coraor3.2k
United States
Nate Coraor3.2k wrote:

uWSGI should create the socket. However, there's a mistake in the docs. The value of uWSGI's socket option is not a URL, so it should look like this:

uwsgi:
    socket: /opt/galaxy/var/uwsgi.sock

I'll submit a correction for the docs - sorry for the inconvenience.

As to why you're not able to reach it on port 8080, have you enabled uWSGI's master mode?

ADD COMMENTlink written 7 months ago by Nate Coraor3.2k

Thank you Nate!

This solved the issue, in addition i can reach the web server ok 8080 as well now!

ADD REPLYlink written 7 months ago by manuel.pasieka30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 167 users visited in the last hour