Can't login with password

Hello, I've been trying the pihole/pihole:development docker image with a docker compose file. I changed the env variables accordingly in the file.

First I tried to upgrade from my current v5 install, and then I did a clean install (i.e., I removed the mounted volumes and the existing container). In both cases login didn't work for me, it just remains loading with no visible feedback.

I noticed some javascript errors in the console (different to Error message in js console on login page), so I tried with both Firefox and Chrome (Mac OS X), nothing seems blocked on uBlock Origin, and the issue remains.

The trace I'm getting:

Uncaught TypeError: right-hand side of 'in' should be an object, got undefined
    wrongPassword https://pihole/admin/scripts/pi-hole/js/login.js?v=1727274505:33
    doLogin https://pihole/admin/scripts/pi-hole/js/login.js?v=1727274505:105
    jQuery 6
    doLogin https://pihole/admin/scripts/pi-hole/js/login.js?v=1727274505:91
    <anonymous> https://pihole/admin/scripts/pi-hole/js/login.js?v=1727274505:122
    jQuery 9
    <anonymous> https://pihole/admin/scripts/pi-hole/js/login.js?v=1727274505:111
login.js:33:37

I saw the "wrongPassword" call there, so I started a shell from inside the container and set the password to something easy as 123456, but I still get the same error. Only way I could login is leaving the password as blank.

Any idea why this might be happening? Can I do anything else to help you debug it? Thanks in advance!

Edit:

I would like to add that, even when logged in (without password), functionality seems broken (i.e. plots not loading, going into "Group Management" throws a popup with the text "An unknown error occurred while loading the data" and the full HTML code), and multiple errors appear in the js console, such as

Uncaught TypeError: system is undefined
    updateSystemInfo https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:331
    jQuery 6
    updateSystemInfo https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:326
    updateInfo https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:230
    <anonymous> https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:592
    jQuery 13
footer.js:331:24
Uncaught TypeError: version is undefined
    updateVersionInfo https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:487
    jQuery 6
    updateVersionInfo https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:476
    updateInfo https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:231
    <anonymous> https://pihole/admin/scripts/pi-hole/js/footer.js?v=1727274505:592
    jQuery 13
footer.js:487:9

What does your compose file/run command look like? Just to make sure you're configuration is correct :slight_smile:

This is currently in draft, but I've been putting together some documentation for configuration the v6 container here:

as well as specific notes for upgrading from v5 here:

Thanks for the quick reply! Sure, here is the stuff. Mostly I compared the compose from this PR with mine and merged

Compose file:

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:development
    hostname: pihole.${HOSTNAME}
    environment:
      - TZ=Europe/Zurich
    volumes:
      - './etc-pihole:/etc/pihole'
    ports:
      - '53:53/tcp'
      - '53:53/udp'
      - '80:80/tcp'
      - '443:443/tcp'
    restart: always

Nginx reverse proxy nixOS config (some stuff redacted, it forces SSL so I can access through https://xxxx too) :

    locations."/" = {
      proxyPass = "http://xxxx:80/";
      extraConfig = ''
        rewrite / /admin  break;
        allow x.x.x.x.0/24;
        deny all;
      '';
    };
    locations."/admin" = {
      proxyPass = "http://xxxx:80/admin";
      extraConfig = ''
        rewrite /(.*) /$1  break;
        allow x.x.x.x.0/24;
        deny all;
      '';
    };

One thing I've noticed is that if I remove the password from the CLI and restart the container, a random password gets set once again. Perhaps this should happen only on the first-time install?

If no password is found on either the Environment or the config file (i.e value is blank) then a random password is assigned.

If you want to explicitly have no password on the web interface (which is doubtful!) Then you can set the environment variable FTLCONF_webserver_api_password: ''

Are you saying that if you set a password via the CLI, the password gets regenerated without the environment variable present?

Ok, now I understood the functioning! No, I had no environment variable, therefore the first time I started the container I expected the random password generation. But when I removed the password from the CLI, I would have expected this option to prevail. In fact, the log says "No password set in environment or config file", so by removing the password from the cli I expected it to set it to blank rather than removing the option, but I understand how it works now :).

I know that no password is doubtful, I was just trying to force it so I could test easily why the rest of my setup isn't working.

Ok, got it, the problem was with the reverse proxy. I didn't know that the "/api" endpoint should also be redirected (probably this needs to be updated).

Everything seems to work OK now :slight_smile: , many thanks!

2 Likes