Page 1 of 1
MX Upload to webserver problem
Posted: Tue 01 Dec 2020 4:27 pm
by andersondj
I have setup a raspberry pi installation of the latest CumulusMX release and it is creating the standard files OK.
However, I am having difficulty uploading the webfiles to a web server using the inbuilt MX ftp facility.
Attached are 2 log files :
ftplog.txt - Output log file when using ftp. Apart from file realtimegauges.txt all files failed to upload with the message "Could not get file size"
mxdiag.txt - Diagnostic file from folder MXdiag when using sftp. Files failed to upload with message "Cannot access a disposed object - Object name: Renci.SshNet.sftpclient.
In both cases I had the permissions to the upload folder set to 777.
When manually uploading the files using the Winscp ftp client set to sftp I did not experience any problems.
Any help/suggestions would be appreciated.
David Anderson
mxdiag.txt
ftplog.txt
Re: MX Upload to webserver problem
Posted: Tue 01 Dec 2020 5:36 pm
by freddie
As you are connecting okay with SFTP have you tried setting MX to use SFTP rather than FTP? It could be that your hosting service doesn't allow FTP - many are moving to SFTP or FTPS only.
Re: MX Upload to webserver problem
Posted: Tue 01 Dec 2020 6:01 pm
by mcrossley
If you switch on debug logging we will get some more info in the logs.
But the basic problem is - "Error uploading web/index.htm to /index.htm : Permission denied"
Re: MX Upload to webserver problem
Posted: Tue 01 Dec 2020 8:34 pm
by andersondj
Attached is a session with debug logging. You will notice that realtimegauges.txt is being created and uploaded every minute without error - I have checked that it does actually arrive at the webserver. I cannot explain the message "permission denied" when index.htm is uploaded as the destination folder has 777 permissions AND the realtimegauges.txt file is uploaded to the same folder without error. Could you please explain the meaning of the "Cannot access a disposed object" message against each of the other Standard Files.
Re: MX Upload to webserver problem
Posted: Wed 02 Dec 2020 11:06 am
by mcrossley
Yes the realtime SFTP is logging OK, and uploading the realtimegauges.txt file OK.
The interval SFTP is logging in OK, but the first file it tries to upload (/index.htm) fails with the permission denied error.
At this point Cumulus disposes of the SFTP client because I found trying to determine all the possible failure modes and correct action to take for each was too complex. So on first failure it aborts, and waits for the next upload cycle. Not clever I know, and it could be better I know but t is what it is for now.
My catch for the SFTP being disposed is wrong - I'll fix that for the next release.
The basic problem remains, the SFTP client does not have permissions to write to /index.htm
You probably need to check the server logs to find the reason why.
Re: MX Upload to webserver problem
Posted: Wed 02 Dec 2020 9:24 pm
by SamiS
Maybe a dumb question, but why there is a / in front of the failing filename, but not in the realtimegauges.txt that is sent succesfully? Some glitch / typo in Cumulus settings? Another longshot that comes to my mind is the 777-permission. Maybe a server with tight security settings could restict handling of files with full permissions?
Re: MX Upload to webserver problem
Posted: Wed 02 Dec 2020 10:20 pm
by mcrossley
The leading slash could be significant. The upload process for realtime files and interval files does treat an empty remote server folder in the settings differently.
So it looks like the upload works to the default "current" remote directory, but the SSH server possibly does not set the root to the upload folder.
A test would be to try setting the remote server folder in the settings to "./" which should force all the files into the default folder.