Page 1 of 1

Erno 12

Posted: 30 Jul 2019, 07:04
by Panja
Since a few days I'm getting a strange problem when unpacking.

Code: Select all

ERROR	Tue Jul 30 2019 08:56:11	series/VideoSort: Could not start post-process-script series/VideoSort.py for The Handmaid's Tale - S03E08: errno 12
ERROR	Tue Jul 30 2019 08:56:04	series/VideoSort: Could not start post-process-script series/VideoSort.py for The Handmaid's Tale - S03E08: errno 12
ERROR	Tue Jul 30 2019 08:56:02	series/VideoSort: Could not start post-process-script series/VideoSort.py for The Handmaid's Tale - S03E08: errno 12
ERROR	Tue Jul 30 2019 08:56:01	Unpack for The Handmaid's Tale - S03E08 failed
ERROR	Tue Jul 30 2019 08:54:22	Unrar: Could not start unpack for The Handmaid's Tale - S03E08: errno 12
Any one have a clue?
Running v21.0 in Docker.
Has been running flawless for years.

Re: Erno 12

Posted: 30 Jul 2019, 11:00
by sanderj
Docker ... so ... on Linux?

AFAIK Errno 12 is often/always "[Errno 12] Cannot allocate memory" in combination with pyathon, so a memory allocation problem of your system.

Re: Erno 12

Posted: 30 Jul 2019, 11:46
by Panja
Thanks for the reply!

It's running it on a Synology NAS (DS415+).
I've replaced the standard 2GB ram for 8GB ram.

At the moment I'm running @ 27% ram when checking resources on my NAS.

Though when restarting the docker instance did fix (temp?) my problem.

Hmmm strange...

Re: Erno 12

Posted: 30 Jul 2019, 13:30
by sanderj
Panja wrote:
30 Jul 2019, 11:46

Though when restarting the docker instance did fix (temp?) my problem.
That's the way to handle a docker instance: if/when it doesn't behave like it should, kill/restart it.

However ... if it happens more often that would be strange indeed: VideoSort.py seems to be a plain python script (no strange, memory hungry system calls) so memory problems should not occur.

... Unless another process (maybe nzbget itself, although unlikely) had eaten all the memory ... Or the docker instance had limited amount of RAM (via --memory)

Re: Erno 12

Posted: 30 Jul 2019, 13:36
by Panja
I did not set an environment --memory.

I do have another post download script running but that script is not memory hungry as far as I can tell.
I'll post it here for reference.

Code: Select all

#!/bin/sh

###########################################
### NZBGET POST-PROCESSING SCRIPT       ###

# Plex libray update --> movies-classics.

### NZBGET POST-PROCESSING SCRIPT       ###
###########################################

wget --no-check-certificate --delete-after "https://ip_of_plex_server:32400/library/sections/1/refresh?X-Plex-Token=Plex_token_xyz" >/dev/null 2>&1

exit 93;

Re: errno 12

Posted: 30 Jul 2019, 14:00
by sanderj
Oh, wait ... I should read better:

Code: Select all

Could not start post-process-script series/VideoSort.py for The Handmaid's Tale - S03E08: errno 12
and

Code: Select all

Unrar: Could not start unpack for The Handmaid's Tale - S03E08: errno 12
So the problem is not in VideoSort.py itself, but with starting VideoSort.py. And yes, that is a fork (heavy OS call). Apparantly memory (or number of PIDs) was exhausted in / for your docker instance.

It's probably this line:

Code: Select all

daemon/util/Script.cpp:600:		PrintMessage(Message::mkError, "Could not start %s: errno %i", *m_infoName, errno);
So apparantly the fork in "pid_t pid = fork();" failed.

Re: Erno 12

Posted: 30 Jul 2019, 14:11
by Panja
I have updated my Docker instance to the latest (LinuxServer.io image) and rebooted the NAS afterwards.
I'll have a look how it goes now.

Thanks

Re: Erno 12

Posted: 30 Jul 2019, 14:18
by sanderj
Also worth monitoring: usage by docker itself:

Code: Select all

$ top -bn1 | grep -e VIRT -e docker
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
31572 root      20   0  984184  72948  39252 S   0,0   1,9   0:01.43 dockerd
32056 sander    20   0  954836  49864  29880 S   0,0   1,3   0:00.15 docker

Re: Erno 12

Posted: 31 Jul 2019, 18:40
by Panja
It seems to be fixed now.
Running the latest linuxserver.io docker image (and rebooting the NAS).
Been downloading a few things without any problems.

Thanks for the help Sander! Helemaal top!