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

File not found? Is this correct? #264

Closed
Lonewolf147 opened this issue Sep 15, 2023 · 4 comments
Closed

File not found? Is this correct? #264

Lonewolf147 opened this issue Sep 15, 2023 · 4 comments

Comments

@Lonewolf147
Copy link

Lonewolf147 commented Sep 15, 2023

I have pihole up and running, i've tried to set up the auto updater, and when the whitelist.py script runs, this is the return that I'm getting:

This script will download and add domains from the repo to whitelist.
All the domains in this list are safe to add and does not contain any tracking or adserving domains.


[i] Pi-hole path exists
[i] Write access to /mnt/user/appdata/pihole verified
[i] Legacy Pi-hole detected (Version older than 5.0)
[i] Collecting existing entries from whitelist.txt
[i] 191 existing whitelists identified
[i] Existing anudeep-whitelist install identified
[i] Removing previously installed whitelist
[i] Syncing with https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
[i] Outputting 191 domains to /mnt/user/appdata/pihole/whitelist.txt
[i] Done - Domains are now added to your Pi-Hole whitelist

[i] Restarting Pi-hole. This could take a few seconds
Traceback (most recent call last):
File "/opt/whitelist/scripts/whitelist.py", line 388, in
restart_pihole(args.docker)
File "/opt/whitelist/scripts/whitelist.py", line 60, in restart_pihole
subprocess.call(['pihole', '-g'], stdout=subprocess.DEVNULL)
File "/usr/lib64/python3.9/subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib64/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib64/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pihole'

Is everything listed after the Traceback correct? Why is there a filenotfounderror?

Thanks

@Technetium1
Copy link

That probably should not happen. It cannot find pihole in path 🤔
Maybe should add more about how and where this is running pihole.

@Lonewolf147
Copy link
Author

Here's the script in unraid that I'm running

#!/bin/bash
docker exec pihole /bin/bash
sudo python3 /opt/whitelist/scripts/whitelist.py

I just have it set to run once a week.

@Technetium1
Copy link

@Lonewolf147 try instead docker exec -it https://docs.docker.com/engine/reference/commandline/exec/#run-docker-exec-on-a-running-container
You might be running the last line on unraid itself?

@Lonewolf147
Copy link
Author

Lonewolf147 commented Sep 21, 2023

Now my problem has changed a bit. Now it won't even run because when the scripts drops down into the pihole bash, it no longer recognizes the Python3 command. If I drop down into root, then python can't find the Whitelist.py script (I just have no idea where things created in the dockers is located via root).

EDIT: Messing around, I finally found a way to get it to run. I changed my script to this command

#!/bin/bash
cd ..
sudo python3 whitelist/scripts/whitelist.py --dir ./mnt/user/appdata/pihole/pihole/ --docker

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

No branches or pull requests

2 participants