DSM Task Scheduler Error

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
TomTomTuning
Posts: 12
Joined: 23 Nov 2016, 14:46

DSM Task Scheduler Error

Post by TomTomTuning »

First let me say that I am a complete noob when it comes to command line, so FileBot Node of course is what I'm using. I can SSH as admin, then switch to root, but besides that it's copy/paste commands from there. I searched around for a while, but just couldn't figure it out. Any help with this is greatly appreciated!

Installed via https://app.filebot.net/syno/

Current Versions:
- DSM 6.1-14871 (beta)
- FileBot 4.7.2
- FileBot Node 0.2.1
- Node.js v4 4.4.2-0160
- Unofficial Jave Installer 1.8.0_101

FileBot Node runs perfectly fine within DSM, I can even access it in a separate tab just fine (http://IP:5000/webman/3rdparty/filebot-node/index.html). I can run the DSM scheduled task manually (clicking Run) and it works. However, anytime it runs on it's own is when I get the following error (via email notification). Oh and the task is set to run as User: Admin.

Code: Select all

Dear user,

Task: FileBot Extracted
Start time: Wed, 23 Nov 2016 09:00:02 GMT
Stop time: Wed, 23 Nov 2016 09:00:03 GMT
Current status: 1
Standard output/error:
Locking /volume1/@appstore/filebot-node/data/filebot.log
Error during startup: /volume1/@appstore/filebot/data/root/temp
java.nio.file.AccessDeniedException: /volume1/@appstore/filebot/data/root/temp
	at net.filebot.util.FileUtilities.createFolders(FileUtilities.java:182)
	at net.filebot.Main.main(Main.java:113)


Sincerely,
Synology DiskStation
Here is my FileBot Node Log from Package Center.
Image

HTTP Auth

Code: Select all

root@SynoNAS:~# curl -v http://192.168.1.10:5452/auth
> GET /auth HTTP/1.1
> Host: 192.168.1.10:5452
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: text/json
< Access-Control-Allow-Origin: *
< Date: Wed, 23 Nov 2016 15:08:21 GMT
< Connection: keep-alive
< Content-Length: 51
HTTPS Auth

Code: Select all

root@SynoNAS:~# curl -v https://192.168.1.10:5453/auth
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* TLSv1.2 (OUT), TLS alert, Client hello (1):
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
User avatar
rednoah
The Source
Posts: 23925
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DSM Task Scheduler Error

Post by rednoah »

For some reason the filebot process thinks that it's running as user root but only with the permissions of admin:

Code: Select all

Error during startup: /volume1/@appstore/filebot/data/root/temp
What is the value of $USER? What is the output of whoami?

Every user gets it's own user data folder. If you're running as admin then that should be filebot/data/admin and not filebot/data/root.
:idea: Please read the FAQ and How to Request Help.
TomTomTuning
Posts: 12
Joined: 23 Nov 2016, 14:46

Re: DSM Task Scheduler Error

Post by TomTomTuning »

rednoah wrote:For some reason the filebot process thinks that it's running as user root but only with the permissions of admin:

Code: Select all

Error during startup: /volume1/@appstore/filebot/data/root/temp
What is the value of $USER? What is the output of whoami?

Every user gets it's own user data folder. If you're running as admin then that should be filebot/data/admin and not filebot/data/root.
Please forgive my ignorance. Could you possibly dumb that down for me? Are there certain commands you'd like for me to run?

Thank you so much for your help!
User avatar
rednoah
The Source
Posts: 23925
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DSM Task Scheduler Error

Post by rednoah »

Code: Select all

whoami

Code: Select all

echo $USER

Code: Select all

printenv
Run them as Synology Task (exactly the same way filebot is called) and post the output here.
:idea: Please read the FAQ and How to Request Help.
TomTomTuning
Posts: 12
Joined: 23 Nov 2016, 14:46

Re: DSM Task Scheduler Error

Post by TomTomTuning »

rednoah wrote:

Code: Select all

whoami

Code: Select all

echo $USER

Code: Select all

printenv
Run them as Synology Task (exactly the same way filebot is called) and post the output here.
I'm terribly sorry but I have the slightest clue what you mean. Perhaps I need a few basic step-by-step instructions?

Do I run those commands while ssh as root? Or am I creating a new scheduled task in DSM with those commands?
Again, the extent of my command line abilities is following instructions and copy/paste.
User avatar
rednoah
The Source
Posts: 23925
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DSM Task Scheduler Error

Post by rednoah »

You'll learn as you go along. Try both. I primarily care about the call that doesn't work, so wherever you call filebot, call the other commands beforehand and see what the output says.

EDIT: Don't create a new task. Just reused the exist task and call these commands beforehand. Before that filebot call that fails.
:idea: Please read the FAQ and How to Request Help.
TomTomTuning
Posts: 12
Joined: 23 Nov 2016, 14:46

Re: DSM Task Scheduler Error

Post by TomTomTuning »

I appreciate your patience with me. I'm definitely learning a lot as I go.

Screenshot of how the task is configured.
Image

Here is the log that is emailed to me (task ran automatically based on schedule).

Code: Select all

Dear user,

Task Scheduler has completed a scheduled task.

Task: FileBot Extracted
Start time: Wed, 23 Nov 2016 14:21:02 GMT
Stop time: Wed, 23 Nov 2016 14:21:02 GMT
Current status: 1
Standard output/error:
admin
root
MAILTO=
SHELL=/bin/sh
USER=root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
PWD=/root
HOME=/root
SHLVL=2
LOGNAME=root
_=/bin/printenv
Locking /volume1/@appstore/filebot-node/data/filebot.log
Error during startup: /volume1/@appstore/filebot/data/root/temp
java.nio.file.AccessDeniedException: /volume1/@appstore/filebot/data/root/temp
	at net.filebot.util.FileUtilities.createFolders(FileUtilities.java:182)
	at net.filebot.Main.main(Main.java:113)


Sincerely,
Synology DiskStation
Last edited by TomTomTuning on 23 Nov 2016, 19:23, edited 1 time in total.
TomTomTuning
Posts: 12
Joined: 23 Nov 2016, 14:46

Re: DSM Task Scheduler Error

Post by TomTomTuning »

This is what the log looks like if I click the Run button on the task, instead of allowing it to run as scheduled.

Code: Select all

Dear user,

Task Scheduler has completed a scheduled task.

Task: FileBot Extracted
Start time: Wed, 23 Nov 2016 14:22:22 GMT
Stop time: Wed, 23 Nov 2016 14:22:27 GMT
Current status: 1
Standard output/error:
admin

HTTP_X_REQUESTED_WITH=XMLHttpRequest
ENABLE_X_ACCEL_REDIRECT=yes
HTTP_CONTENT_LENGTH=224
TERM=vt102
HTTP_USER_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36
HTTP_ORIGIN=https://192.168.1.10:5001
HTTP_HOST=192.168.1.10:5001
SERVER_PORT=5001
SCGI=1
DOCUMENT_ROOT=/usr/syno/synoman
HTTPS=on
SCRIPT_FILENAME=/usr/syno/synoman/webapi/entry.cgi
REQUEST_URI=/webapi/entry.cgi
SCRIPT_NAME=/webapi/entry.cgi
HTTP_X_SYNO_TOKEN=7vNxkFJKxtN86
USERNAME=TJanz
HTTP_CONNECTION=keep-alive
PATH_INFO=
REMOTE_PORT=49444
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
JOB=apparmor
PWD=/usr/syno/synoman/webapi
APPARMOR_HAT_ARRAY=["DefaultHat"]
SYNO_WEBAPI_USERNAME=TJanz
HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.8
HTTP_REFERER=https://192.168.1.10:5001/
HTTP_ACCEPT=*/*
REMOTE_ADDR=192.168.1.17
DOCUMENT_URI=/webapi/entry.cgi
HTTP_CONTENT_TYPE=application/x-www-form-urlencoded; charset=UTF-8
SERVER_NAME=192.168.1.10
SHLVL=1
CONTENT_LENGTH=224
UPSTART_INSTANCE=
SERVER_SOFTWARE=nginx/1.11.3
SOCKET=/run/synoscgi.sock
UPSTART_EVENTS=syno.network.ready started
QUERY_STRING=
SERVER_ADDR=192.168.1.10
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
HTTP_ACCEPT_ENCODING=gzip, deflate, br
INSTANCE=
UPSTART_JOB=synoscgi
CONTENT_TYPE=application/x-www-form-urlencoded; charset=UTF-8
HTTP_COOKIE=did=93EM8mXrBhvt6ge77Aw0L65O5kSnHCVUf5Wn8VI7N9uWpI3fhyPGQvZADGKkqnKnCv9QTXfdtU61T7cz4Ukgzmy9znK0P1mUeTwp350UMPZQYvZgZIkuFkcLESZ9PEQ; __zlcmid=dgg0mx6bwi8L2n; firstVisit=1479574043019; _ga=GA1.1.378944320.1479539977; unifises=PNp4n1l7wKCkADkBcfK1mBhi6lXGGkCJ; csrf_token=O2OkZ5fKNHfKjYyNEeGhsMCMhCSZNRbx; stay_login=1; id=gv5beNdq4jq1A1650NZN678100
REQUEST_METHOD=POST
_=/bin/printenv
Locking /volume1/@appstore/filebot-node/data/filebot.log
Run script [fn:amc] at [Wed Nov 23 14:22:26 EST 2016]
Parameter: subtitles = eng
Parameter: clean = y
Parameter: skipExtract = y
Argument[0]: /volume1/Torrents/Extracted
No files selected for processing
Failure (°_°)



Sincerely,
Synology DiskStation
User avatar
rednoah
The Source
Posts: 23925
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DSM Task Scheduler Error

Post by rednoah »

Synology is definitely doing something strange there. That's probably something you should report to Synology as well. The USER variable should never be root if the task is called as admin.

Add this command before the FileBot command:

Code: Select all

export USER=`whoami`
That should make it work.
:idea: Please read the FAQ and How to Request Help.
TomTomTuning
Posts: 12
Joined: 23 Nov 2016, 14:46

Re: DSM Task Scheduler Error

Post by TomTomTuning »

rednoah wrote:Synology is definitely doing something strange there. That's probably something you should report to Synology as well. The USER variable should never be root if the task is called as admin.

Add this command before the FileBot command:

Code: Select all

export USER=`whoami`
That should make it work.
The task seems to be working now with that command before the FileBot command.
However, I still get an email saying failure, but it appears that is only because there were not files for it to process.
So I disabled the email notifications, and set the task to run ever few hours.

I wonder what could have caused this? Perhaps I did something incorrect during installation?

Thank you for all of your help!
User avatar
rednoah
The Source
Posts: 23925
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DSM Task Scheduler Error

Post by rednoah »

If the amc script isn't given any files to process, it'll abort with a negative exit code, which results in Synology Task Manager sending you an email that the call didn't return successfully.

That's perfectly normal.
:idea: Please read the FAQ and How to Request Help.
Post Reply