[SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is there

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
pven
Release Testers
Release Testers
Posts: 114
Joined: August 21st, 2009, 5:00 am

[SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is there

Post by pven »

Since the upgrade to SABnzbd my scripts are not working anymore.

The error:
nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file or directory

But the file is there:
# ls -al /var/packages/sabnzbd/target/var/scripts/Deobfuscate.py
-rwxrwxrwx 1 sc-sabnzbd sabnzbd 7872 Aug 24 15:29 /var/packages/sabnzbd/target/var/scripts/Deobfuscate.py
#

In the previous version this worked (at least: I did not get errors). I also tried /volume1/@appstore as path, but wanted tot test it without the @-sign.

I have a simular issue for CharTranslator.py

What is going wrong?
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by jcfp »

pven wrote: August 25th, 2020, 3:51 amnice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file or directory
The No such file or directory part could also be referring to whatever is in the shebang line inside the script, for example an outdated or otherwise incorrect path to a python interpreter.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by safihre »

The chartranslator was removed from the Synology package because it was not python3 compatible.
Maybe the nice command is the problem. Could you try with nice disabled? (remove the nice parameters to disable it)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
pven
Release Testers
Release Testers
Posts: 114
Joined: August 21st, 2009, 5:00 am

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by pven »

When disabling nice I get:
Exit(-1) Cannot run script /var/packages/sabnzbd/target/var/scripts/Deobfuscate.py

When starting it manually it does not end in an error (immediately):
# python3 /var/packages/sabnzbd/target/var/scripts/Deobfuscate.py
This script needs to be called from SABnzbd as post-processing script.
#
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by sander »

so (like jcfp said) ... what are the first lines of /var/packages/sabnzbd/target/var/scripts/Deobfuscate.py ?
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by safihre »

The error "Cannot run script" is one thrown by SABnzbd. In the Debug logging it will specify the actual exception that was thrown. Could you check that?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
pven
Release Testers
Release Testers
Posts: 114
Joined: August 21st, 2009, 5:00 am

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by pven »

The first lines. Is this sufficient?

Code: Select all

#!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

"""

Deobfuscation post-processing script:

Will check in the completed job folder if maybe there are par2 files,
for example "rename.par2", and use those to rename the files.
If there is no "rename.par2" available, it will rename the largest
file to the job-name in the queue.
Can I mail the debug? I don't want to put it here.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by safihre »

Yes, [email protected]

You could try to remove the first line, then SABnzbd should default to just putting "python" in front of it.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
pven
Release Testers
Release Testers
Posts: 114
Joined: August 21st, 2009, 5:00 am

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by pven »

I mailed.

But ... when I remove the first line, it works as expected. Thats nice! :-)
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by safihre »

I checked and the Synology Python is located in:
/usr/local/python3
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
pven
Release Testers
Release Testers
Posts: 114
Joined: August 21st, 2009, 5:00 am

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by pven »

What is preferred: adding it to to first line, or just leave it out? Fow now it works.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by safihre »

Maybe should add a detection that checks if the part after the shebang even exists? What do you think Sander?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by sander »

Yes, we can do that for scripts SAB tries to run (pre-queue, post-proc), if on POSIX.
If path-to-executable not correct ... clear warning / error message? Or overrule the shebang with by calling "/real/path/python3 <thescript.py>"? And discover /real/path/python3 by using the python-path that was used to start SABnzb itself?

We earlier discussed putting "#!/usr/bin/env python3 " as first line in scripts (the solution I like; let the OS handle it), but you (@saifhre) showed that that can cause other problems.
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by jcfp »

So my initial guess was right.

Best to leave it at /usr/bin/python3, which works in most cases. If the script comes as part of a package (don't have synology stuff around to try but the path /var/packages/sabnzbd/target/var/scripts/Deobfuscate.py does suggests so) and the system uses non-standard locations for interpreters, its maintainer should adjust any shebang lines accordingly.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: [SABnzbd3] nice: can't execute '/var/packages/sabnzbd/target/var/scripts/Deobfuscate.py': No such file,but file is t

Post by safihre »

Well, I am the maintainer of the Synology package.. So guess I have work to do 😅
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply