skip to Main Content

Occasionally, after starting my Docksal project for local development, I will get a 502 error when visiting the site. I need help troubleshooting this. I’ve tried a fresh install of Docker, colima (I prefer it to Docker Desktop), and Docksal, but I still get the occasional 502 error. The full error is:

502 Bad Gateway
openresty/1.19.9.1

docker ps shows that all the required Docksal containers are running and healthy. docker context list shows that I’m in the "colima" context, which should be correct.

Nothing shows up in fin logs -f when I load the page and the 502 error occurs.

What else can I do to troubleshoot this error? Right now, the only way I’ve gotten past the error consistently is to shut everything down and cold boot the computer (Mac OS 11.7.3).

UPDATE: I found this issue in the Docksal github. Until the fix is in production, they suggesting running DOCKSAL_VERSION=develop fin update. So far, it’s working for me.

3

Answers


  1. Chosen as BEST ANSWER

    I asked this in the Docksal Github, and was told this:

    There is a fix in develop (#1764) that may address this issue. Please try DOCKSAL_VERSION=develop fin update

    After two weeks, this fix appears to work consistently.


  2. I have no detailed explanation, and my answer is not about Mac OS.

    My answer is about how I solved the same problem on Linux (Fedora)

    1. In .docksal/docksal.env, replaced this line

    VIRTUAL_HOST="abc.docksal"

    (you should replace "abc" with your domain) with this one

    VIRTUAL_HOST="abc.docksal.site"

    (‘.site’ added).

    1. and added these two lines to the top of the file

      DOCKSAL_DNS_DOMAIN=docksal.site

      DOCKSAL_NO_DNS_RESOLVER=1

    2. From /etc/hosts, removed (commented out) this line (probably you don’t have similar line in your file but maybe you’ve added it like me… because of some similar reasons…)

      192.168.64.100 abc.docksal

    3. Restarted the service

      fin p stop; systemctl restart docker.service; fin p start;

    4. The new address of the project is http://abc.docksal.site.

    Manual page: https://docs.docksal.io/stack/configuration-variables/#docksal-dns-disabled

    Login or Signup to reply.
  3. Same problem here, except that even a cold reboot does not help. I actually had the NO_DNS_RESOLVER in place and up and running before it randomly stopped working. (This should be a comment but I don’t have the reputation points.)

    EDIT — this might help someone. In the Docker desktop, I deleted the project that was giving me a 502. Then I ran fin project start to re-create it. Not only did it work, it brought up the old db server with a fully populated database. That seems unlikely but it worked.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search