Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests to /admin/ will hang for a short while (firefox) #2412

Open
ZakKemble opened this issue Apr 3, 2025 · 7 comments
Open

Requests to /admin/ will hang for a short while (firefox) #2412

ZakKemble opened this issue Apr 3, 2025 · 7 comments

Comments

@ZakKemble
Copy link

Versions

Core version is v6.0.6 (Latest: v6.0.6)
Web version is v6.1 (Latest: v6.1)
FTL version is v6.1 (Latest: v6.1)

Description

In Firefox, requests to the web interface at https://pi.hole/admin/ will hang for a short while because the server is sending a single redirect Location header. Without at least the Content-Length: 0 header the browser doesn't know whether to expect more data or not. Doesn't seem to effect Chrome.

@PromoFaux
Copy link
Member

Possibly related here... pi-hole/docker-pi-hole#1802

Do you see the same delay if you drop the trailing slash? i.e https://pi.hole/admin

@ZakKemble
Copy link
Author

ZakKemble commented Apr 3, 2025

Yea that looks like the same issue as what I have.

A request to /admin responds instantly with a 308 redirect to /admin/, then that request takes a while to get the 302 redirect to /admin/login. This only happens in firefox.

/admin -> 308 -> /admin/ -> 302 (slow) -> /admin/login -> 200

A wireshark capture shows that the server does respond instantly with a 302 redirect and Location header, but firefox doesn't do anything until the server closes the connection after 5 seconds (hopefully I'm reading the capture correctly hah).

curl is also slow curl --insecure -v https://pi.hole/admin/ and outputs this problem message about no chunk/close/size, and instead waits for the server to close the connection:

< HTTP/1.1 302 Found
< Location: /admin/login
* no chunk, no close, no size. Assume close to signal end

However wget is fine wget --no-check-certificate https://pi.hole/admin/.

@pralor-bot
Copy link

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/web-interface-takes-5-seconds-to-load-the-initial-request/78841/4

@a7md0
Copy link

a7md0 commented Apr 5, 2025

I noticed the same behaviour on Chrome as well, I don't think it's related to a specific brwoser as I was able to confirm the same using a cURL command.

@DL6ER
Copy link
Member

DL6ER commented Apr 5, 2025

Please run

sudo pihole checkout ftl new/slow-302

and try again. Users deplayong FTL via docker need to build local docker image using the custom branch new/slow-302 following the instructions

git clone https://github.com/pi-hole/docker-pi-hole
cd docker-pi-hole
./build.sh -f new/slow-302

and then use the generated image (tagged as pihole:local).

@a7md0
Copy link

a7md0 commented Apr 5, 2025

$ sudo pihole checkout ftl new/slow-302
  Please note that changing branches severely alters your Pi-hole subsystems
  Features that work on the master branch, may not on a development branch
  This feature is NOT supported unless a Pi-hole developer explicitly asks!
  Have you read and understood this? [y/N] y

  [i] Checking for availability of branch new/slow-302 on GitHub
  [✗] Requested branch is not available

I believe there is typo in the branch name, it should be sudo pihole checkout ftl fix/slow-302. I can confirm that this fixed the issue on my installation. Thank you @DL6ER

HTTP

$ curl -o /dev/null -s -w "DNS lookup:  %{time_namelookup}s\nConnect:     %{time_connect}s\nSSL Hand
shake: %{time_appconnect}s\nTTFB:        %{time_starttransfer}s\nTotal time:  %{time_total}s\n" --resolve pi.hole:80:1
27.0.0.1 'http://pi.hole:80/admin/'
DNS lookup:  0.000109s
Connect:     0.000675s
SSL Handshake: 0.000000s
TTFB:        0.001724s
Total time:  0.003345s

HTTPS

$ curl -o /dev/null -s -w "DNS lookup:  %{time_namelookup}s\nConnect:     %{time_connect}s\nSSL Hand
shake: %{time_appconnect}s\nTTFB:        %{time_starttransfer}s\nTotal time:  %{time_total}s\n" --resolve pi.hole:443:1
27.0.0.1 'https://pi.hole:443/admin/'
DNS lookup:  0.000086s
Connect:     0.000655s
SSL Handshake: 0.275291s
TTFB:        0.276436s
Total time:  0.277631s

@DL6ER
Copy link
Member

DL6ER commented Apr 5, 2025

Yeah, sorry for the typo but thanks for the verification. It has already been merged into development and will be part of the next release. Please don't forget to switch back to master at some point as this branch here will not receive any future updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants