Page 1 of 1

Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 12 Nov 2017, 21:19
by melvynadam
I'm using this script on uTorrent's "Run this program when a torrent finishes" option (on Win 10):

Code: Select all

filebot -script fn:amc --output "//mynas/Multimedia" --action move -non-strict "C:/Users/[MyName]/Downloads/Completed" --log-file amc.log --def "seriesFormat=/TV/{n}/Season {s}/{n} - {s00e00} - {t}" --def excludeList=amc.txt --def gmail=[my email address]:[app password] --def "movieFormat=/Movies/{n} ({y})/{n} ({y})"
Files are renamed and moved. No emails are sent. Can someone please help me work out why emails aren't going out?

Re: Where's the error in this script?

Posted: 12 Nov 2017, 21:31
by rednoah
1.
The Troubleshooting section in the amc script manual will give you lots of good advice. I'd start with that. ;)


2.
Change --log-file amc.log to --log-file C:/amc.log and then look at the log at C:/amc.log to see if it says anything interesting.

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 13 Nov 2017, 10:44
by melvynadam
Thanks for the reply.

amc.log works just fine in the current location.

In that file I consistently see the same error message about sending emails:

Code: Select all

MessagingException: Can't send command to SMTP host
But this exact same script works on a different computer on the same network. Both PCs are running Win10 and uTorrent.

Also, the host is Gmail and it's working just fine. If I use the same app password and run sendEmail from the same computer I am able to successfully send emails from that account from the command line. So the PC is connected, the password is valid, and the script is otherwise fine.

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 13 Nov 2017, 11:45
by rednoah
1.
Here's some advice on how to debug things further:
https://stackoverflow.com/a/42309753/1514467


2.
Please run the command with CMD. There might be additional console output that's not captured by FileBot logging.

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 13 Nov 2017, 13:44
by melvynadam
Thanks, I'd tried running it from the command line.

After the file is found, renamed correctly and moved, the console displays an error regarding the email problem:

Code: Select all

     [mail] Failed to send email: Can't send command to SMTP host
MessagingException: Can't send command to SMTP host
Done ?(?????)?
Like I've said though, this is a script that works. It's copied and pasted from another PC on which it gives no errors and emails are sent successfully. In my opinion there's some background prerequisite which either isn't installed or isn't configured. What back-end components does FileBot depend on for sending emails?

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 13 Nov 2017, 14:40
by rednoah
FileBot is self-contained and doesn't have any prerequisites. Hence no idea why it might work on one machine but not another.

Did you get any additional console output after setting the JAVA_ARGS environment variable as mentioned in the link above?

Code: Select all

-Dmail.smtp.starttls.enable=true -Dmail.debug=true

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 14 Nov 2017, 07:02
by melvynadam
Sorry, on Windows where do I enter those arguments?
At the CLI I tried putting the script in quotes and the arguments before it:

Code: Select all

java -Dmail.smtp.starttls.enable=true -Dmail.debug=true "filebot -script fn:amc --output "//<myNAS>/Multimedia" --action move -non-strict "C:/Users/<username>/Downloads/Completed" --log-file amc.log --def "seriesFormat=/TV/{n}/Season {s}/{n} - {s00e00} - {t}" --def excludeList=amc.txt --def gmail=<myemail>:<password> --def "movieFormat=/Movies/{n} ({y})/{n} ({y})""
The output was simple:

Code: Select all

Error: Could not find or load main class filebot -script fn:amc --output ..myNAS.Multimedia --action move -non-strict C:.Users.username.Downloads.Completed --log-file amc.log --def seriesFormat=.TV.{n}.Season

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 14 Nov 2017, 07:14
by melvynadam
Found it, I think. Is this where you want me to enter those args?
Image

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 14 Nov 2017, 10:44
by rednoah
I have never seen this dialog before. Does it make a difference?

So you're on Windows? Using the Windows Store version of FileBot? In this case you can just set the JAVA_OPTS environment variable in the Environment Variables settings.


Image



Alternatively, running this command in CMD will do the trick:

Code: Select all

setx JAVA_OPTS "-Dmail.smtp.starttls.enable=true -Dmail.debug=true"

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 14 Nov 2017, 21:18
by melvynadam
I used the setx command and got the success message. Nonetheless, no console ever appears.

Yes, I have enabled it:
Image

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 14 Nov 2017, 22:17
by rednoah
You start CMD, so you have a console window, then you run the command from the first post, and with those options set, there should be additional logging when the email is being sent.

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 14 Nov 2017, 22:42
by melvynadam
I thought you meant the Java Console window. Not the CMD window.
The output from the command remains unchanged after setting those options:

Code: Select all

     [mail] Failed to send email: Can't send command to SMTP host
I've also tried uninstalling Java, cleaning up all trace of Java on the machine, rebooting, reinstalling Java, and trying again. To no avail.

amc.log still only shows:

Code: Select all

MessagingException: Can't send command to SMTP host

Re: Where's the error in this script? Files are renamed and moved. No emails are sent.

Posted: 15 Nov 2017, 00:02
by rednoah
Sorry. Then I have no idea. It's a generic issue not specific to FileBot though, so you might find some solution if you Google for the error message and try various things.