This launched Baserow successfully and I was able to access the dashboard at http://localhost:3001/dashboard.
However I keep getting the following error message:
Failed
Connection to the server has failed. Please refresh the page.
Looking at the console I see:
WebSocket connection to 'ws://localhost:3001/ws/core/?jwt_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjc0MDUzNDg4LCJpYXQiOjE2NzQwNTI4ODgsImp0aSI6IjM5ZWZlNGQ2Y2IzNTQ4YmZhZTI4ZDI3NjQ4OGVhMGViIiwidXNlcl9pZCI6MX0.8B9WuTYZLhaIo5y35T_rQefeNCx0c2S2fikkjG34z-M' failed:
@Android63 do you perhaps any plugins that might be blocking this websocket connection? Could you try in private/igcognito mode in your Browser and see if it works then?
This error is indicating that the websocket connection used for realtime events isn’t working.
Thanks @nigel. It works fine in an incognito window as you suggested.
I have a few active browser plugins. I’ve tried disabling the most obvious ones (e.g. ad blocker) but can’t find out which one is causing the problem. Any suggestions on that?
No worries, could you tell me which browser + operating system you are using and the full list of plugins you have? If you want to keep it private feel free to PM me or email them to me at nigel@baserow.io .
It might not be a Chrome plugin issue but a cookie-related issue.
This matter has also happened to me and cost me 5 hours to find out the reason. I set up my Baserow using Docker with Caddy + Nginx (with reverse proxy).
The 400 error code came from the Docker (using docker logs container_id) instead of from Nginx. Also I noticed that when I cleared my browser cookies, it has no issues; when I visited a couple of different pages and accumulated a lot of cookies, the issue reproduces. Therefore, the issue is: the cookie header is too large > http connection upgrade failed at handshake.
To solve this issue, simply remove all cookies for WS connections in Nginx using “proxy_hide_header Cookie”, “add_header Cookie”, and “proxy_set_header Cookie”. Below are my settings in Nginx:
This is a fairly tricky issue related to Websocket connection upgrade (header size limited > websocket_upgrade_failure error). I wonder if there’s any way to increase that number with the docker config (instead of removing the cookie through Nginx)?
Ah I apologize i see what you mean now, do you know which specific cookies were getting large as you visited different pages? And to double check, you are using the baserow/baserow image?
It is not a specific cookie - but all the Websocket requests will include all the available cookies in the header. If you have a lot of cookies associated with the site (including cookies for the root domain, which is accessible by all subdomains), this issue will happen.
My site has many services, and all the cookies are under the root domain (which is not a good practice, I know…). I think that’s also the reason why some other people encountered the situation and (1) can see it work properly in the Incognito mode (2) couldn’t fix it in the normal mode even after disabling all the extensions - since this is not any issue with the extensions (some people suggested AdBlock extension may cause similar issues - not my case).
This issue could happen to some people who use Baserow to build an internal site with a subdomain, which shares cookie from the root domain.
I used the Docker-composer method to install Baserow with Caddy and then put that behind my own Nginx server - all following the official instructions (including the Nginx configs).
it seems that me and other people on my team experience this issue as well.
We seem to have a similar setup to the one described here (debian+ baserow docker image behind Nginx - I’m told - configured according to the guide linked in this thread. + a subdomain)
A few people on my team reported severe issues with filters and sorting not working properly (like filters missing certain fields, or sorting by wrong value, etc). I was able to reproduce some of these issues only when the “Connection to the server has failed. Please refresh the page.” error appeared.
The erros start to happen when scrolling the table, which seems to refresh the row values despite the seemingly lost connection, but the rest of the page (including filters) seems to stay “disconnected” until the entire browser tab is refreshed (hope the description makes sense).
I assume such errors could actually be expected under the circumstances… however, some people claim they have not seen the “Connection to the server has failed” error message, but a page refresh seem to have solved the issues for them - at least until they experienced them again at a different time.
My questions would be
is the fix proposed by @fanhkg is “officially supported” or in any way verified?
can the connection fail without the error message (which would explain many of the issues reported for filters by my team)