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

FTL Crashes if FTLCONF_webserver_api_password has a value set #2242

Open
uurf opened this issue Feb 21, 2025 · 7 comments
Open

FTL Crashes if FTLCONF_webserver_api_password has a value set #2242

uurf opened this issue Feb 21, 2025 · 7 comments

Comments

@uurf
Copy link

uurf commented Feb 21, 2025

Versions

  • Core version is v6.0.3 (Latest: v6.0.3)
  • Web version is v6.0.1 (Latest: v6.0.1)
  • FTL version is v6.0.1 (Latest: v6.0.1)

Platform

  • OS and version:
  • Platform: Device: Synology DS1817+
    DSM 7.2.2-72806 Update 3
    Docker Compose via Synology Container Manager 20.10.23-1437

Expected behavior

Having set a password using FTLCONF_webserver_api_password: '<password>' I expect the web service to load on https://<adress>:8181/admin and to be challenged for the password I set.

Actual behavior / bug

FTL Crashes.

Steps to reproduce

Steps to reproduce the behavior:

  1. build a docker container using this compose code:
name: pihole6
services:
    pihole:
        container_name: Pi-Hole
        security_opt:
            - no-new-privileges=false
        volumes:
            # For persisting custom dnsmasq config files. Most will not need this, and can be safely removed/commented out
            - /volume1/docker/pihole/dnsmasq.d:/etc/dnsmasq.d:rw
            # For persisting Pi-hole's databases and common configuration file
            - /volume1/docker/pihole/pihole:/etc/pihole:rw
     environment:
            # FTLCONF_webserver_api_password: '<password>'
            FTLCONF_webserver_port: '8181s'
            # Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
            TZ: 'America/New York'
            
        cap_add:
            - SYS_NICE
        restart: on-failure:5
        network_mode: host
        image: pihole/pihole:latest
  1. observe in the container logs that pihole has started.
  2. load https://<adress>:8181/admin
  3. observe in the logs that FTL has crashed. Admin UI does not load

Debug Token

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

if I comment out # FTLCONF_webserver_api_password: '' it starts and the FTL ui is accessible where expected, but there's no password. Not even a randomly generated one.

I am able to set a password via pihole setpassword but it doesn't seem to be used - after setting it the admin UI still loads without a login challenge.

@uurf
Copy link
Author

uurf commented Feb 21, 2025

crash log

2025-02-21 17:36:34.485 UTC [56M] INFO: Reading certificate from /etc/pihole/tls.pem ...
2025-02-21 17:36:34.486 UTC [56M] INFO: Using SSL/TLS certificate file /etc/pihole/tls.pem
2025-02-21 17:36:34.486 UTC [56M] INFO: Web server ports:
2025-02-21 17:36:34.486 UTC [56M] INFO:   - 8181 (HTTPS, IPv4)
2025-02-21 17:36:34.487 UTC [56M] INFO: Restored 0 API sessions from the database
2025-02-21 17:36:34.721 UTC [56M] ERROR: getrandom() failed in generate_password()
2025-02-21 17:36:34.721 UTC [56M] ERROR: Failed to generate CLI password hash!
2025-02-21 17:36:34.722 UTC [56M] INFO: Blocking status is enabled
2025-02-21 17:36:34.823 UTC [56/T172] INFO: Compiled 0 allow and 13 deny regex for 5 clients in 18.6 msec
2025-02-21 17:36:38.498 UTC [56/T174] ERROR: Cannot receive UDP DNS reply: Timeout - no response from upstream DNS server
2025-02-21 17:36:38.498 UTC [56/T174] INFO: Tried to resolve PTR "1.1.168.192.in-addr.arpa" on 127.0.0.1#53 (UDP)
2025-02-21 17:36:40.498 UTC [56/T174] ERROR: Cannot receive UDP DNS reply: Timeout - no response from upstream DNS server
2025-02-21 17:36:40.498 UTC [56/T174] INFO: Tried to resolve PTR "234.1.168.192.in-addr.arpa" on 127.0.0.1#53 (UDP)
2025-02-21 17:36:42.499 UTC [56/T174] ERROR: Cannot receive UDP DNS reply: Timeout - no response from upstream DNS server
2025-02-21 17:36:42.499 UTC [56/T174] INFO: Tried to resolve PTR "198.1.168.192.in-addr.arpa" on 127.0.0.1#53 (UDP)
2025-02-21 17:43:06.616 UTC [56/T316] INFO: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2025-02-21 17:43:06.616 UTC [56/T316] INFO: ---------------------------->  FTL crashed!  <----------------------------
2025-02-21 17:43:06.617 UTC [56/T316] INFO: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2025-02-21 17:43:06.617 UTC [56/T316] INFO: Please report a bug at https://github.com/pi-hole/FTL/issues
2025-02-21 17:43:06.617 UTC [56/T316] INFO: and include in your report already the following details:
2025-02-21 17:43:06.617 UTC [56/T316] INFO: FTL has been running for 402 seconds
2025-02-21 17:43:06.617 UTC [56/T316] INFO: FTL branch: master
2025-02-21 17:43:06.617 UTC [56/T316] INFO: FTL version: v6.0.1
2025-02-21 17:43:06.617 UTC [56/T316] INFO: FTL commit: 62904aef
2025-02-21 17:43:06.617 UTC [56/T316] INFO: FTL date: 2025-02-20 23:07:18 +0000
2025-02-21 17:43:06.617 UTC [56/T316] INFO: FTL user: started as pihole, ended as pihole
2025-02-21 17:43:06.617 UTC [56/T316] INFO: Compiled for linux/amd64 (compiled on CI) using cc (Alpine 14.2.0) 14.2.0
2025-02-21 17:43:06.617 UTC [56/T316] INFO: Process details: MID: 56
2025-02-21 17:43:06.617 UTC [56/T316] INFO:                  PID: 56
2025-02-21 17:43:06.618 UTC [56/T316] INFO:                  TID: 316
2025-02-21 17:43:06.618 UTC [56/T316] INFO:                  Name: civetweb-worker
2025-02-21 17:43:06.618 UTC [56/T316] INFO: Received signal: Segmentation fault
2025-02-21 17:43:06.618 UTC [56/T316] INFO:      at address: 0
2025-02-21 17:43:06.618 UTC [56/T316] INFO:      with code:  SEGV_MAPERR (Address not mapped to object)
2025-02-21 17:43:06.618 UTC [56/T316] INFO: !!! INFO: pihole-FTL has not been compiled with glibc/backtrace support, not generating one !!!
2025-02-21 17:43:06.618 UTC [56/T316] INFO: ------ Listing content of directory /dev/shm ------
2025-02-21 17:43:06.618 UTC [56/T316] INFO: File Mode User:Group      Size  Filename
2025-02-21 17:43:06.619 UTC [56/T316] INFO: rwxrwxrwx root:root       360   .
2025-02-21 17:43:06.619 UTC [56/T316] INFO: rwxr-xr-x root:root       340   ..
2025-02-21 17:43:06.619 UTC [56/T316] INFO: rw------- pihole:pihole   786K  FTL-56-recycler
2025-02-21 17:43:06.619 UTC [56/T316] INFO: rw------- pihole:pihole    20K  FTL-56-dns-cache-lookup
2025-02-21 17:43:06.619 UTC [56/T316] INFO: rw------- pihole:pihole    33K  FTL-56-domains-lookup
2025-02-21 17:43:06.619 UTC [56/T316] INFO: rw------- pihole:pihole     4K  FTL-56-clients-lookup
2025-02-21 17:43:06.619 UTC [56/T316] INFO: rw------- pihole:pihole   569K  FTL-56-fifo-log
2025-02-21 17:43:06.620 UTC [56/T316] INFO: rw------- pihole:pihole     4K  FTL-56-per-client-regex
2025-02-21 17:43:06.620 UTC [56/T316] INFO: rw------- pihole:pihole   102K  FTL-56-dns-cache
2025-02-21 17:43:06.620 UTC [56/T316] INFO: rw------- pihole:pihole     8K  FTL-56-overTime
2025-02-21 17:43:06.620 UTC [56/T316] INFO: rw------- pihole:pihole    11M  FTL-56-queries
2025-02-21 17:43:06.620 UTC [56/T316] INFO: rw------- pihole:pihole    29K  FTL-56-upstreams
2025-02-21 17:43:06.621 UTC [56/T316] INFO: rw------- pihole:pihole   348K  FTL-56-clients
2025-02-21 17:43:06.621 UTC [56/T316] INFO: rw------- pihole:pihole   131K  FTL-56-domains
2025-02-21 17:43:06.621 UTC [56/T316] INFO: rw------- pihole:pihole   164K  FTL-56-strings
2025-02-21 17:43:06.622 UTC [56/T316] INFO: rw------- pihole:pihole   144   FTL-56-settings
2025-02-21 17:43:06.622 UTC [56/T316] INFO: rw------- pihole:pihole   328   FTL-56-counters
2025-02-21 17:43:06.622 UTC [56/T316] INFO: rw------- pihole:pihole    88   FTL-56-lock
2025-02-21 17:43:06.624 UTC [56/T316] INFO: ---------------------------------------------------
2025-02-21 17:43:06.624 UTC [56/T316] INFO: Please also include some lines from above the !!!!!!!!! header.
2025-02-21 17:43:06.624 UTC [56/T316] INFO: Thank you for helping us to improve our FTL engine!
2025-02-21 17:43:06.624 UTC [56/T316] INFO: Waiting for threads to join
2025-02-21 17:43:06.624 UTC [56/T316] INFO: Thread database (0) is idle, terminating it.
2025-02-21 17:43:06.625 UTC [56/T316] INFO: Thread housekeeper (1) is idle, terminating it.
2025-02-21 17:43:06.625 UTC [56/T316] INFO: Thread dns-client (2) is idle, terminating it.
2025-02-21 17:43:06.625 UTC [56/T316] INFO: Thread timer (3) is idle, terminating it.
2025-02-21 17:43:06.625 UTC [56/T316] INFO: All threads joined
2025-02-21 17:43:06.626 UTC [56/T316] INFO: PID file emptied
2025-02-21 17:43:06.627 UTC [56/T316] INFO: Stored 0 API sessions in the database
2025-02-21 17:43:09.242 UTC [56M] INFO: Finished final database update
2025-02-21 17:43:09.242 UTC [56M] INFO: Waiting for threads to join
2025-02-21 17:43:09.242 UTC [56M] INFO: Thread database (0) is idle, terminating it.
2025-02-21 17:43:09.243 UTC [56M] INFO: Thread housekeeper (1) is idle, terminating it.
2025-02-21 17:43:09.243 UTC [56M] INFO: Thread dns-client (2) is idle, terminating it.
2025-02-21 17:43:09.243 UTC [56M] INFO: Thread timer (3) is idle, terminating it.
2025-02-21 17:43:09.243 UTC [56M] INFO: All threads joined
2025-02-21 17:43:09.243 UTC [56M] INFO: PID file emptied
2025-02-21 17:43:09.709 UTC [56M] INFO: ########## FTL terminated after 6m 44s  (code 0)! ##########```

@yubiuser yubiuser transferred this issue from pi-hole/pi-hole Feb 21, 2025
@yubiuser
Copy link
Member

Might be fixed by #2240

@vitaliy-sk
Copy link

Same issue on Linux nas 3.10.108 #42962 SMP Mon May 29 14:36:16 CST 2023 x86_64 GNU/Linux synology_bromolow_3615xs

2025-02-21 23:36:06.864 GMT [58M] ERROR: getrandom() failed in generate_password()
2025-02-21 23:36:06.865 GMT [58M] ERROR: Failed to generate CLI password hash!

It's not crashing, but UI isn't asking for password event if it was set before migration to v6

@DL6ER
Copy link
Member

DL6ER commented Feb 22, 2025

Please try again after running

sudo pihole checkout ftl development

to get the latest bug fixing attempts for this problem. The issue here is that your VMs somehow do not provide cryptographically sound randomness and we need find out why.

@GDT1978
Copy link

GDT1978 commented Feb 23, 2025

I have the same issue with my installation in a Synology DS415+. If I configure my docker with a blank password I was able to open the admin page.

@vitaliy-sk
Copy link

@DL6ER thanks, tried, but it's not working on Docker

1ad31eb40277:/# sudo !!
sudo pihole checkout ftl development
Function not supported in Docker images

also tried pihole/pihole:nightly image but no luck

@yubiuser
Copy link
Member

If your are on docker, you need to build the image yourself.

https://github.com/pi-hole/docker-pi-hole?tab=readme-ov-file#building-the-image-locally

./build.sh -f development

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

5 participants