Page 1 of 3

FTP permissions upload problem

Posted: Sat 15 Jun 2024 9:25 am
by Carbonara
HI ! i need an help :)
I use vsftp and the latest version of CMX 3. I have a problem with uploading files to my FTP server. With each update, the files are uploaded, but the read/write permissions (755) that I need to display the data on my website are reset. So, every 60 seconds, I have to restore them using FileZilla. The issue appeared from a certain version of CMX onwards, where, if I remember correctly, some libraries for FTP uploading were updated.
Can you suggest a solution?
Thanks in advance!

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 11:10 am
by SamiS
I think your issue is basically related to your ftp server configuration and what permissions it grants to a new file.

If you don’t find the solution from the server end, you could try to experiment different combinations of CMX FTP settings found in Settings -> Internet Settings -> Web / Upload site -> General Settings.

I probably would try to disable both ”ftp rename” and ”delete before upload”.

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 11:20 am
by Carbonara
Yes, I have already disabled those options. I have no issues with version 3.17.0 b3184; I have about 50 weather station online with this older version. The problem appeared with the later versions. I remember that at some point, something was changed in the FTP libraries, and since then it hasn't worked anymore. However, I don't remember the version number.

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 11:40 am
by Carbonara
same problem on altervista hosting, in testing now...

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 12:33 pm
by freddie
You shouldn't need execute permission on data files. Or are you uploading php files?

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 1:13 pm
by Carbonara
freddie wrote: Sat 15 Jun 2024 12:33 pm You shouldn't need execute permission on data files. Or are you uploading php files?
no, no php used, I need 755 permissions for my website. The files I upload are just.. some json for the graphs, the realtime.txt file, and a custom txt file generated with webtags

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 1:34 pm
by broadstairs
If it is on the server that you need to change the permissions then the issue is on the server, it sets the permissions on the files when it receives them.

Stuart

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 1:42 pm
by Carbonara
broadstairs wrote: Sat 15 Jun 2024 1:34 pm If it is on the server that you need to change the permissions then the issue is on the server, it sets the permissions on the files when it receives them.

Stuart
ok, but why with older version of cumulus this don't happen?

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 2:06 pm
by broadstairs
What are the file permissions on the server following an upload but prior to you updating them? Also what type of FTP are you using plain FTP or FTPS etc?

Also perhaps an extract from the MXDiags log file which shows an FTP of the relevant files with FTP logging turned on, just remember to turn FTP logging on and then off again when you have captured the data and before any restart of CMX.

Stuart

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 3:01 pm
by Carbonara
broadstairs wrote: Sat 15 Jun 2024 2:06 pm What are the file permissions on the server following an upload but prior to you updating them? Also what type of FTP are you using plain FTP or FTPS etc?

Also perhaps an extract from the MXDiags log file which shows an FTP of the relevant files with FTP logging turned on, just remember to turn FTP logging on and then off again when you have captured the data and before any restart of CMX.

Stuart
I use the standard FTP upload (not SFTP). The first upload it performs (by cumulus) is with 644 permissions. Subsequently, I log in into my FTP server via FileZilla and set the permissions to 755 on the files. When Cumulus performs the subsequent uploads (every 60 seconds for the realtime files), with the older versions of Cumulus, the permissions stayed fixed at 755. With the new version of CMX, they revert back to 644. I use vsftpd on the server.
i checked the mx diag file, but there isn't any of relevant

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 3:17 pm
by broadstairs
I am puzzled by this. Just checked my uploaded website files on my hosting company and they are all 644. I suspect the issue is your server's web server and why it needs 755. Looks to me that 644 is normal and should work with the web server.

Stuart

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 3:22 pm
by freddie
Carbonara wrote: Sat 15 Jun 2024 1:13 pm
freddie wrote: Sat 15 Jun 2024 12:33 pm You shouldn't need execute permission on data files. Or are you uploading php files?
no, no php used, I need 755 permissions for my website. The files I upload are just.. some json for the graphs, the realtime.txt file, and a custom txt file generated with webtags
You shouldn't need 755 - 644 will be enough. The difference between the two is that you are setting the permissions to executable, which isn't necessary if you are not executing them.

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 5:07 pm
by broadstairs
When you think about it having executables on a Web server is a VERY bad idea from a security perspective.

Stuart

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 7:02 pm
by Carbonara
yes, i need them because i've a custom cms who need to read the file and generation a template to display online the data. I've other settings for the security, 755 is not a problem. Why 3.17.0 b3184 version works ok ?

Re: FTP permissions upload problem

Posted: Sat 15 Jun 2024 7:14 pm
by SamiS
Maybe it is an unexpected behaviour of your server when communicating with the newer ftp libraries, who knows. I’m quite sure that CMX does not intentionally change remote file permissions, but of course this is only a guess since I haven’t examined the source code. Mark as the code writer could tell this, but he is more or less away for several weeks.

You could get some more info by enabling ftp log and debug log in CMX.