pi-hole / pi-hole

A black hole for Internet advertisements
https://pi-hole.net
Other
48.86k stars 2.69k forks source link

Unable to reset /var/www/html/admin, exiting installer, while reconfiguring #2395

Closed realtebo closed 5 years ago

realtebo commented 6 years ago

In raising this issue, I confirm the following: {please fill the checkboxes, e.g: [X]}

How familiar are you with the the source code relevant to this issue?:

6


Expected behaviour:

I have some problems my with actual config, so I tryed to execute a pihole -r, I was expecting to be able to reinstall all components_ of pihole setup

Actual behaviour:

realtebo@pihole4:~$ pihole -r
[sudo] password di realtebo: 

  [✓] Root user check

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

  [i] Reconfigure option selected
  [✓] Disk space check

  [✓] Update local cache of available packages

  [✓] Checking apt-get for upgraded packages... 1 updates available
  [i] It is recommended to update your OS after installing the Pi-hole! 

  [i] Installer Dependency checks...
  [✓] Checking for apt-utils
  [✓] Checking for dialog
  [✓] Checking for debconf
  [✓] Checking for dhcpcd5
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for whiptail

  [i] Using Cloudflare servers
  [✓] Set IP address to 192.168.1.229
            You may need to restart after the install is complete
  [i] IPv4 address: 192.168.1.229/24
  [i] IPv6 address: 
  [i] Web Interface On
  [i] Web Server On
  [i] Logging On.
  [i] Performing reconfiguration, skipping download of local repos
  [✓] Resetting repository within /etc/.pihole...
  Unable to reset /var/www/html/admin, exiting installer

I tried to rerun pihole -r doing a repair instead of a reconfigure.

realtebo@pihole4:~$ sudo pihole -r

  [✓] Root user check

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

  [i] Repair option selected
  [✓] Disk space check

  [✓] Update local cache of available packages

  [✓] Checking apt-get for upgraded packages... 1 updates available
  [i] It is recommended to update your OS after installing the Pi-hole! 

  [i] Installer Dependency checks...
  [✓] Checking for apt-utils
  [✓] Checking for dialog
  [✓] Checking for debconf
  [✓] Checking for dhcpcd5
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for whiptail

  [i] Performing reconfiguration, skipping download of local repos
  [✓] Resetting repository within /etc/.pihole...
  [i] Main Dependency checks...
  [✓] Checking for bc
  [✓] Checking for cron
  [✓] Checking for curl
  [✓] Checking for dnsutils
  [✓] Checking for iputils-ping
  [✓] Checking for lsof
  [✓] Checking for netcat
  [✓] Checking for psmisc
  [✓] Checking for sudo
  [✓] Checking for unzip
  [✓] Checking for wget
  [✓] Checking for idn2
  [✓] Checking for sqlite3
  [✓] Checking for libcap2-bin
  [✓] Checking for dns-root-data
  [✓] Checking for resolvconf

  [✓] Installing scripts from /etc/.pihole

  [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

  [✓] Installing latest Cron script

  [✓] Installing latest logrotate script

  [i] FTL Checks...
  [✓] Detected x86_64 architecture
  [i] Checking for existing FTL binary...
  [i] Latest FTL Binary already installed (v4.0). Confirming Checksum...
  [i] Checksum correct. No need to download!

  [✓] man pages installed and database updated
  [i] Systemd-resolved does not need to be restarted
  [i] Restarting services...
  [✓] Starting pihole-FTL service
  [✓] Enabling pihole-FTL service to start on reboot
  [✓] Deleting existing list cache
  [i] Neutrino emissions detected...
  [✓] Pulling blocklist source list into range

  [i] Target: raw.githubusercontent.com (hosts)
  [✓] Status: Retrieval successful

  [i] Target: mirror1.malwaredomains.com (justdomains)
  [✓] Status: Retrieval successful

  [i] Target: sysctl.org (hosts)
  [✓] Status: Retrieval successful

  [i] Target: zeustracker.abuse.ch (blocklist.php?download=domainblocklist)
  [✓] Status: Retrieval successful

  [i] Target: s3.amazonaws.com (simple_tracking.txt)
  [✓] Status: Retrieval successful

  [i] Target: s3.amazonaws.com (simple_ad.txt)
  [✓] Status: Retrieval successful

  [i] Target: hosts-file.net (ad_servers.txt)
  [✓] Status: Retrieval successful

  [✓] Consolidating blocklists
  [✓] Extracting domains from blocklists
  [i] Number of domains being pulled in by gravity: 157658
  [✓] Removing duplicate domains
  [i] Number of unique domains trapped in the Event Horizon: 134446
  [i] Nothing to whitelist!
  [i] Number of regex filters: 0
  [✓] Parsing domains into hosts format
  [✓] Cleaning up stray matter

  [✓] Force-reloading DNS service
  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled

  [i] The install log is located at: /etc/pihole/install.log
    Update Complete! 

  Current Pi-hole version is v4.0
  Current AdminLTE version is -1
  Current FTL version is v4.0

Steps to reproduce:

Not able to restart from scratch.

Debug token provided by uploading pihole -d log:

***********************************
***********************************
[✓] Your debug token is: bwz9lh5smj
***********************************
***********************************

Troubleshooting undertaken, and/or other relevant information:

I fixed running again, manually, the installer.

curl -sSL https://install.pi-hole.net | bash

The following step fixed problems:

  [✗] Check for existing repository in /var/www/html/admin
  [✓] Clone https://github.com/pi-hole/AdminLTE.git into /var/www/html/admin

My suggestion is to force check and clone when doing a repair or a reconfigure

dschaper commented 6 years ago

This doesn't look like a bug to me. If the user is choosing to reconfigure then that's all that should be done. I wouldn't expect for a reconfigure to clone a new web repository and remove any customization that the user may have applied. If they choose reinstall, then yes I would agree that new repositories should be created. I believe this is how the existing code is written?

realtebo commented 6 years ago

Yes, I agree. Reconfigure must not override existing installation Reinstall must redo the install from scratch.

Actually I was able to restart a VM from scratch and done an unattended update, The problem came again.

So I think to investigate over automatic installation process.

Kindly, why pihole reinstallation is different from pihole installation?

Thanks for your precious work. Feel free to keep open, and feel free to close. I will post any useful infos if I will find.

realtebo commented 6 years ago

Found !

As said, I was doing unattended setup. So I copied setupVars.conf before invoking setup script.

The problem was due to lighttpd not being installed. This, in its turn, was due to

INSTALL_WEB_SERVER=True
INSTALL_WEB_INTERFACE=True

instead of

INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true

Before closing, a question: dhcpd server is being installed; must be up & rrunning at the end of setup? I cannot see where we enable and then start it.

AzureMarker commented 6 years ago

The re-installation is basically the same as the installation, except it does not go through the setup questions and does not try to install the repos.

I think dhcpcd starts automatically, or at least it starts up when you reboot (there is a notice printed that you may need to reboot after install).