Two times Error 101. Reverse Proxy

I have a self-hosted Baserow running over Docker Compose.

It is running behind reverse proxy.

Unfortunately not everything is running smoothly for unknown reasons.

This is what the Network status returns from the browser:

Two times error 101.
I don’t know if it’s related, but after some time of not using the system, Baserow is showing an error message in the browser: “Connection to the server has failed. Please refresh the page”.

Caddyfile:

  GNU nano 5.4                                                                                      Caddyfile                                                                                                
{
        {$BASEROW_CADDY_GLOBAL_CONF}
}

{$BASEROW_CADDY_ADDRESSES} {
        handle /api/* {
                reverse_proxy {$PRIVATE_BACKEND_URL:localhost:8000}
        }

        handle /ws/* {
                reverse_proxy {$PRIVATE_BACKEND_URL:localhost:8000}
        }

        handle_path /media/* {
                @downloads {
                        query dl=*
                }
                header @downloads Content-disposition "attachment; filename={query.dl}"

                file_server {
                        root {$MEDIA_ROOT:/baserow/media/}
                }
        }

        handle_path /static/* {
                file_server {
                        root {$STATIC_ROOT:/baserow/static/}
                }
        }

        reverse_proxy {$PRIVATE_WEB_FRONTEND_URL:localhost:3000}
}

Nginx:

  GNU nano 4.8                                                                                baserow.domain.io                                                                                          
        chunked_transfer_encoding on;

        location / {
                proxy_pass              http://baserow_domain;
                proxy_http_version 1.1;
                proxy_pass_request_headers on;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
        }

    server_tokens off;
    add_header X-Content-Type-Options nosniff;

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/baserow.domain.io/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/baserow.domain.io/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}



server {
    if ($host = baserow.domain.io) {
        return 301 https://$host$request_uri;
    } # managed by Certbot



        server_name baserow.domain.io;


    listen [::]:80;
    listen 80;
    return 404; # managed by Certbot


}

Anything wrong with these entries?

Hi @taubers, a 101 response is actually not an error. It’s related the WebSocket connection, and it stands for Switching Protocols (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/101). The same happens on baserow.io.

  • Just to double-check, when you sign in to Baserow, do you immediately see a notification in the top right corner saying something about trying to connect to the server?
  • If you open two browser tabs of the same table, and you make a change in one of them, do you see that same update coming through in the other tab?
  • Do you see the “Connection to the server has failed. Please refresh the page” error after your computer has gone into sleep mode?
  1. No, not immediately
  2. Yes
  3. No, but when the tab hasn’t been used for a while. Like after 5 minutes or so.

Okay, so it seems like the websocket/real-time collaboration parts are working as expected, but the server somehow becomes inactive active 5 minutes or so. Would you mind explaining more about how you’re currently self-hosting, which platform, etc? And do you have some output logs that you can share?

some output logs

Which logs do you mean would be the most revealing?

How are you currently self-hosting? If you’re using the baserow/baserow image, then the output of that would be great.

I’m self-hosting it using Docker Compose. So, where are the logs placed? Inside the container?
(I’m not very familiar with Docker).

The error message appears now not as frequently anymore for some reason.

You should be able to see the logs by running something like docker logs backend and docker logs celery.

Ok, sending logs from “baserow-celery-1” and “baserow-backend-1” containers.