Failed to load resource: the server responded with a status of 408 ()

Hi Docker community. I am new to Docker and running into some issues while building and running a container. I’m currently working on a project to log into an AT&T account and download an invoice. I am running Docker on Windows with Ubuntu. While I can successfully build the Docker image, I am unable to run it due to the following issue:

V-W2272L:/mnt/c/Git/T-mobileInvoiceAutomation$ docker run --net=host --dns=8.8.8.8 --dns=8.8.4.4 -it --rm t-mobile_invoice:v1.4 /bin/bash
Starting ChromeDriver 129.0.6668.100 (cf58cba358d31ce285c1970a79a9411d0fb381a5-refs/branch-heads/6668@{#1704}) on port 35971
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully on port 35971.
[10/10/2024 23:41:35] Severe: https://account.t-mobile.com/ - Failed to load resource: the server responded with a status of 408 ()

It seems ChromeDriver starts, but the website fails to load due to a “408 Request Timeout” error. Has anyone experienced a similar issue, or do you have suggestions on how to resolve this?

Please, share why you think it is a Docker issue. You got “server responded” message. Even if it was an error, we can’t help you to solve an issue of a remote server.

Hi Akos. Thank you for getting back to me. This issue may be related to Docker, as I had successfully run Selenium tests on my local machine before converting the script to headless mode using a Dockerfile. I was also able to successfully ping AT&T’s URL. Based on the issue log, it seems that ChromeDriver started, but the URL was not reached. Do you have any suggestions on what I can troubleshoot to resolve this? Could there be network or headless mode restrictions in Docker that I should look into?

Again, a server sent you a response code, just not the expected response, so at least some server was reached.

My guess is that the request is different when you try it in Docker Desktop, but I don’t know how the request is created and why the target url can’t handle it.

I also see that you use --net=host. Docker Desktop has only a “fake host network”, which forwards requests to and from the host, but not a real host network. Just in case that matters. So the request will not come from your Windows host, but the virtual machine of Docker Desktop.

Yes, the account.att remote server blocked my access. It worked well when I switched the URL to www.google.com instead. Currently, the root cause has been identified. Appreciate your time and support!!