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

random password is rejected #428

Closed
5 of 7 tasks
cmurf opened this issue Feb 27, 2019 · 8 comments
Closed
5 of 7 tasks

random password is rejected #428

cmurf opened this issue Feb 27, 2019 · 8 comments

Comments

@cmurf
Copy link

cmurf commented Feb 27, 2019

This is a...

  • Request for a new or modified feature
  • Issue trying to run the docker image
  • Issue trying to build / test / develop the docker image

Description

Since docker image e0869bf1a536 (4.2.2), more often than not the listed password is rejected by the web interface. I am using the latest docker_run.sh script, only adding :z for selinux and changing timezone.

Expected Behavior

I should be able to login to the web interface.

Actual Behavior

Wrong password!

Possible Fix

Steps to Reproduce and debugging done

e.g. your docker run command, pages to visit, CLI commands you ran

  1. sudo docker rm pihole
  2. sudo ./docker_run.sh
  3. Go to web interface, input the password the script provides (which matches what I see with sudo docker logs pihole

Debug steps I have tried

  • I have tried destroying my container instance, pulling the newest image version, and re-creating a new container
  • I have tried running the nearly stock docker run example in the readme (removing any customizations I added)
  • I have tried running without my volume data mounts to eliminate volumes as the cause
  • I have searched this repository for existing issues and pull requests that look similar

If I rm -rf etc-* the problem doesn't happen. So something is being saved in there that's contributing to this problem. And another regression test is if I use the old password, it still works. The newly generated random password reported by the script doesn't work. So yeah, password is being saved in the volumes.

Context and extra information

The bug is that the script says the password is Y but it's really X, and it's not really random. It's one time random and then it's assigned, and ends up disagreeing with the startup script's output.

Your Environment

  • Docker Host Operating System and OS Version:
  • Docker Version:
  • Hardware architecture:

docker-1.13.1-65.git1185cfd.fc29.x86_64
4.20.12-200.fc29.x86_64
 

@diginc
Copy link
Collaborator

diginc commented Feb 27, 2019

What do your docker logs say about the web password being set?

The only behavior that changed with 4.2.2 is now if you use a volume for /etc/pihole/ it should just say ::: Pre existing WEBPASSWORD found from your previous container creations.

@stachrom
Copy link

stachrom commented Feb 27, 2019

yes - ::: Pre existing WEBPASSWORD found

If I like to generate a new random password - could I remove the password line (WEBPASSWORD=xxxxxxxxx) from setupVars.conf ?

@diginc
Copy link
Collaborator

diginc commented Feb 27, 2019

Yes that is the current procedure to regenerate a new random password.

@cmurf
Copy link
Author

cmurf commented Feb 27, 2019

The log says this:

Assigning random password: Mx15U9Gq
stty: 'standard input': Inappropriate ioctl for device
  [i] Existing PHP installation detected : PHP version 7.0.33-0+deb9u1
  [i] Installing configs from /etc/.pihole...
  [i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
  [✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf
chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
::: Pre existing WEBPASSWORD found
Docker DNS variables not used

But the docker_run.sh says

$ sudo ./docker_run.sh
WARNING: Localhost DNS setting (--dns=127.0.0.1) may fail in containers.
e200f1fcf967cb1066ad4ece5947000fb2c8d01d562c541dd2538a0ecce46b48
Starting up pihole container .......... OK
Assigning random password: Mx15U9Gq for your pi-hole: https:///admin/

Updated to show same log as docker_run output. The docker_run output does report the same password as the log; it's just wrong. It's not really assigning that password, it's using the first run random password.

Also the script isn't reporting the correct admin page URL, I just noticed that, the old docker_run.sh script showed that correctly.

@airdrummingfool
Copy link

I just experienced this same issue - I was re-creating the Docker container a bunch of times while ironing out my config, and when it finally came time to login, the most recent "Assigning random password:" log entry did not work. Luckily I had logged the random password each time I created a new container, and was able to use trial-and-error to figure out which one was correct.

It was definitely confusing that a new password was being reported each time but not used, and doubly so because the docker logs pihole | grep random command (which is what is recommended by pihole to find your password) did not show the "Pre existing WEBPASSWORD found" log messages.

@diginc
Copy link
Collaborator

diginc commented May 2, 2019

I think "Assigning random password" prints even when a pre existing password is there. That message should probably actually say 'Generating random password for later assignment'.

Could you review your full log and see if it also says the message "::: Pre existing WEBPASSWORD found" - which should mean it prevented the actual usage of the randomly generated password.

I'll add in logic to stop printing the 'Assigning random pass' when it isn't assigned to prevent confusion.

@BrianLakstins
Copy link

BrianLakstins commented May 2, 2019

I'm having similar issue. Each time restarts, assigns a new random password. Getting error in settings that might be related:

PHP error (2): parse_ini_file(/etc/pihole/setupVars.conf): failed to open stream: Permission denied in /var/www/html/admin/settings.php:11

Tried setting password in environment variable and it would not be set.
And the interface acts like there is no password set at all.

Figured it out - could not read /etc/pihole/setupVars.conf all the time. Could create it, but not change it. My complicated configuration wanting to save that data on a CIFS share. Found out that need 777 access to everything on the share for it to work.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

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