Page 1 of 1

External program

Posted: Mon 09 May 2016 7:26 pm
by thegasman
Hi,

I wonder if anyone can help..

I'm having fundamental problems with the 'run external programs' feature of CumulusMX (v3.0 build 3038 on a Raspberry Pi2).
Whenever I enter a program to execute into the 'program' box, the program executes succesfully once, but it causes all subsequent ftp uploads to fail until Cumulus is restarted -going back and removing the program to run from the settings isn't enough.
I started with a tiny Python script to write a timestamp into a text file as a test. This runs succesfully, and the timestamp is written, but the simultaneous and all further ftp uploads fail. I have also tried a bash script containing nothing just in case the Python was throwing an error. Same outcome.
Ftplog.txt contains the following relevant details:
2016-05-09 19:35:02.139 Connecting to ftp.doonfootweather.x10.mx
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 8 of 50 allowed.
220-Local time is now 14:35. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 5 minutes of inactivity.
USER cumulus@doonfootweather.x10.mx
331 User cumulus@doonfootweather.x10.mx OK. Password required
PASS <omitted>
230 OK. Current restricted directory is /
FEAT
211-Extensions supported:
EPRT
IDLE
MDTM
SIZE
MFMT
REST STREAM
MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
MLSD
AUTH TLS
PBSZ
PROT
UTF8
TVFS
ESTA
PASV
EPSV
SPSV
ESTP
211 End.
Text encoding: System.Text.UTF8Encoding
OPTS UTF8 ON
200 OK, UTF-8 enabled
Disposing FtpClient object...
Testing connectivity using Socket.Poll()...
Testing connectivity using Socket.Poll()...
There is stale data on the socket, maybe our connection timed out. Re-connecting.
Testing connectivity using Socket.Poll()...
The data was: 421 Timeout - try typing a little faster next time
Not sending QUIT because the connection has already been closed.
Disposing FtpSocketStream...
I'm stumped. Can anyone help?

Martin

Re: External program

Posted: Mon 09 May 2016 7:37 pm
by steve
Launching the external program happens just before ftp login, so it's possible that for some reason the program launch causes a problem on your system. You could turn on debug logging, and see if any interesting messages appear in the diags file regarding the external program. You could also look at your system logs.

Re: External program

Posted: Mon 09 May 2016 8:46 pm
by thegasman
Ok, it took me a while to get debug logging on - had to add 'logging=1' manually to Cumulus.ini as suggested elsewhere.

Here is the error:
2016-05-09 21:40:02.003 Executing program /home/pi/CumulusMX/trial.sh
2016-05-09 21:40:02.025 External program started
2016-05-09 21:40:02.963 System.NullReferenceException: Object reference not set to an instance of an object
at CumulusMX.Cumulus. () [0x00000] in <filename unknown>:0
at CumulusMX.Cumulus.DoHTMLFiles () [0x00000] in <filename unknown>:0
at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0
Means nothing to me I'm afraid.
PS. Here is the content of my file 'trial.sh'
#!/bin/bash
#echo ""
Martin

Re: External program

Posted: Tue 10 May 2016 7:46 am
by steve
Mono doesn't give very helpful stack dumps (no line numbers) so it's hard to say where exactly this exception occurs, except that it's apparently after the ftp connection has been established, but before it has uploaded any files (assuming what was seen in the ftp log you posted earlier is always the same).

I think that the external program is a red herring, and it is the updating of the internet settings that is causing an item to be set to null, where Cumulus expects an empty string. But I did change the code in a recent build to make sure that any null items were changed to empty strings. If this is indeed the problem, then after restarting Cumulus, the problem should go away - is that not the case? And if you just update the internet settings without specifying an external program, the same problem should happen - is that the case?

Re: External program

Posted: Tue 10 May 2016 5:59 pm
by thegasman
Hi Steve,
I think that the external program is a red herring, and it is the updating of the internet settings that is causing an item to be set to null, where Cumulus expects an empty string.
You are absolutely right, any change to the internet settings causes all subsequent ftp uploads to fail, and restarting Cumulus with no further changes fixes it.
As you mentioned you had made some changes to this in recent builds I have updated today from 3036 to 3038, and lo and behold the problem seems to have resolved.

So not only were you right, but you have already fixed it! :lol:

Thanks for your help, and I will keep my version fully up-to-date from now on.

Martin

Re: External program

Posted: Tue 10 May 2016 7:48 pm
by steve
I would have suggested the latest build but you said you were already using it.

Re: External program

Posted: Wed 11 May 2016 3:35 pm
by thegasman
Apologies for the typo regarding the version I was running on my first post.

Martin