-
Notifications
You must be signed in to change notification settings - Fork 8
Cannot allocate memory #9
Comments
Do you know at exactly which part of the script this happens?
I might end up having to rewrite these in Python or try find a better way
to handle such vast amounts of processing
|
Not anymore 🙈 |
I've just re-wrote the scripts in Python. If you get a chance, can you give it a try to see if it resolves the issue? |
This should be resolved by the latest version so will close for now. Let me know if this is not the case |
I get this error with the new python file:
curl with or without sudo doesn't make a difference (should work without, pihole installl also works without sudo for instance. (running up2date Raspbian Stretch v9.11) |
@EPiC-APOC please see mmotti/pihole-regex#16 This is because the script requires Python 3.6+ :-) |
|
Yes, 3.5.3 was probably the last version added for Raspbian Stretch. If you follow the previous link there is a way to manually upgrade it which a couple of people seem to have had some success with |
Sorry, overlooked that tip, trying this now:
|
Success 👍
Will test with even bigger list and see what happens next 😂👌 |
I Can't reproduce 'cannot allocate memory' (so far), so it seems this is working better with the new methode. Just so you know. Seems to work great, but will try to piss it off ;) Question, I tried this in cron.d ; Raspbian Stretch (9.11) with Py3.6.5 @ Raspberry Pi 2B+:
But than I get this error:
When I use this at shell it works though:
Did not have any problems with the previous cron.d:
with kind regards |
Crontab seems to work fine on my end for Raspbian... are you making sure to
include the shell and path variables in cron? Assuming it works in the same
way for cron.d
Edit:
It did take me a little while initially to get this working with cron before I updated the readme, but it turned out to be an issue with paths. If I recall, it was always around the subprocess call where things failed. Adding the following variables to the top of the cron job seemed to fix it for me.
```
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
```
I'm fairly new to all things cron but I can only assume that things must operate a little differently when Python calls a script / executable, as opposed to calling a subshell or something from bash.
The added complication is that you could append `sudo` to specific commands in bash whereas Python doesn't seem to have this ability. Not sure whether this may contribute to the path issues.
|
tried this to test:
(without sudo I get:
if I just put this in crontab it just does not seem tor start:
|
Interesting. Does this error not occur when just running normally without
the env command?
Might be worth creating a new issue so we can get to the bottom of this in
it's entirety
We don't want to use sudo within the crontab as I believe this stores
credentials somewhere (if memory serves)
… |
It seems I got it to work now, like this:
=-> skipped the (absolute/direct) path @ | python3.6 ( which is in: /usr/local/bin/ ) Ran Cron Re-start: With kind regards |
Excellent!
Cron can be some damn fiddly
… |
/usr/local/bin/gravityOptimise.sh: fork: Cannot allocate memory
I guess it's propably because I use a big ass blocklist, about 4 milion entries lol (Number of unique domains trapped in the Event Horizon: 1859646). Did not have this problem before with a list of 3 milion entries (Number of unique domains trapped in the Event Horizon: approx 1250000).
Running latest Pihole on a RPi 2B+ (with up2date Jessy)
The text was updated successfully, but these errors were encountered: