FTP - FRITZ!Box: SetModTime is not supported

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

rclone reports "SetModTime is not supported" as ERROR in the console (and logfiles which are sent per mail) together with the FTP implementation of a FRITZ!Box.
The synchronisation works as expected and timestamps look correct. So this is more of a cosmetic issue (allthough it is annoying).
I was hoping the fix mentioned here:

could be implemented :wink:

Run the command 'rclone version' and share the full output of the command.

rclone v1.62.2-DEV
- os/version: freebsd 13.1-release-p5 (64 bit)
- os/kernel: 13.1-release-p5 (amd64)
- os/type: freebsd
- os/arch: amd64
- go/version: go1.20.3
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

FRITZ!Box 7530 - FRITZ!OS:7.51-104920 BETA

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone touch fritz.ftp:/FOLDER/test.txt 
2023/04/24 10:31:10 ERROR : ftp://fritzbox.local:21/FOLDER: SetModTime is not supported

The rclone config contents with secrets removed.

[fritz.ftp]
type = ftp
host = fritzbox.local
user = ***
port = 21
pass = ***
tls = false
explicit_tls = false
no_check_certificate = true
concurrency = 1
disable_epsv = true
disable_mlsd = true
disable_tls13 = true

A log from the command with the -vv flag

2023/04/24 10:34:17 DEBUG : rclone: Version "v1.62.2-DEV" starting with parameters ["rclone" "touch" "fritz.ftp:/FOLDER/test.txt" "-vv" "--dump" "bodies"]
2023/04/24 10:34:17 DEBUG : Creating backend with remote "fritz.ftp:/FOLDER/"
2023/04/24 10:34:17 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/04/24 10:34:17 DEBUG : ftp://fritzbox.local:21/FOLDER: Connecting to FTP server
2023/04/24 10:34:17 DEBUG : ftp://fritzbox.local:21/FOLDER: dial("tcp","fritzbox.local:21")
2023/04/24 10:34:17 DEBUG : ftp://fritzbox.local:21/FOLDER: > dial: conn=*fshttp.timeoutConn, err=<nil>
2023/04/24 10:34:17 DEBUG : FTP Rx: "220 FTP server ready."
2023/04/24 10:34:17 DEBUG : FTP Tx: "USER *****"
2023/04/24 10:34:17 DEBUG : FTP Rx: "331 Password required for *****."
2023/04/24 10:34:17 DEBUG : FTP Tx: PASS *****
2023/04/24 10:34:18 DEBUG : FTP Rx: "230 User ***** logged in."
2023/04/24 10:34:18 DEBUG : FTP Tx: "FEAT"
2023/04/24 10:34:18 DEBUG : FTP Rx: "211- Extensions supported:"
2023/04/24 10:34:18 DEBUG : FTP Rx: " UTF8"
2023/04/24 10:34:18 DEBUG : FTP Rx: " MDTM"
2023/04/24 10:34:18 DEBUG : FTP Rx: " SIZE"
2023/04/24 10:34:18 DEBUG : FTP Rx: " AUTH TLS"
2023/04/24 10:34:18 DEBUG : FTP Rx: " PBSZ"
2023/04/24 10:34:18 DEBUG : FTP Rx: " PROT"
2023/04/24 10:34:18 DEBUG : FTP Rx: "211 end"
2023/04/24 10:34:18 DEBUG : FTP Tx: "TYPE I"
2023/04/24 10:34:18 DEBUG : FTP Rx: "200 Type set to I."
2023/04/24 10:34:18 DEBUG : FTP Tx: "OPTS UTF8 ON"
2023/04/24 10:34:18 DEBUG : FTP Rx: "200 UTF8 ON"
2023/04/24 10:34:18 DEBUG : FTP Tx: "PASV"
2023/04/24 10:34:18 DEBUG : FTP Rx: "227 Entering Passive Mode (192,168,100,5,172,23)"
2023/04/24 10:34:18 DEBUG : ftp://fritzbox.local:21/FOLDER: dial("tcp","192.168.100.5:44055")
2023/04/24 10:34:18 DEBUG : ftp://fritzbox.local:21/FOLDER: > dial: conn=*fshttp.timeoutConn, err=<nil>
2023/04/24 10:34:18 DEBUG : FTP Tx: "LIST /FOLDER"
2023/04/24 10:34:18 DEBUG : FTP Rx: "150 Opening BINARY mode data connection for '/bin/ls -lgA /FOLDER'."
---SNIP---
2023/04/24 10:34:18 DEBUG : FTP Rx: "-rwxrwxrwx 1 ftp ftp 0 Apr 24 10:00 test.txt"
2023/04/24 10:34:18 DEBUG : FTP Rx: "226 Transfer complete."
2023/04/24 10:34:18 DEBUG : Touch time 2023-04-24 10:34:18.64592745 +0200 CEST m=+1.685860261
2023/04/24 10:34:18 DEBUG : FTP Tx: "PASV"
2023/04/24 10:34:18 DEBUG : FTP Rx: "227 Entering Passive Mode (192,168,100,5,179,45)"
2023/04/24 10:34:18 DEBUG : ftp://fritzbox.local:21/FOLDER: dial("tcp","192.168.100.5:45869")
2023/04/24 10:34:18 DEBUG : ftp://fritzbox.local:21/FOLDER: > dial: conn=*fshttp.timeoutConn, err=<nil>
2023/04/24 10:34:18 DEBUG : FTP Tx: "LIST /FOLDER"
2023/04/24 10:34:18 DEBUG : FTP Rx: "150 Opening BINARY mode data connection for '/bin/ls -lgA /FOLDER'."
---SNIP---
2023/04/24 10:34:18 DEBUG : FTP Rx: "-rwxrwxrwx 1 ftp ftp 0 Apr 24 10:00 test.txt"
2023/04/24 10:34:18 DEBUG : FTP Rx: "226 Transfer complete."
2023/04/24 10:34:18 DEBUG : ftp://fritzbox.local:21/FOLDER: Touching "test.txt"
2023/04/24 10:34:18 ERROR : ftp://fritzbox.local:21/FOLDER: SetModTime is not supported
2023/04/24 10:34:18 DEBUG : 4 go routines active
2023/04/24 10:34:18 DEBUG : ftp://fritzbox.local:21/FOLDER: closing 1 unused connections
2023/04/24 10:34:18 DEBUG : FTP Tx: "QUIT"

Do you want to send a pull request? Change the fs.Errorf to fs.Debugf and you are done!

Thanks for your quick reply Nick.
Iam happy to do that, allthough Iam very little experienced.
I have cloned the repo locally and changed the code mentioned. Now I reading up on how to build it so I can test it.
After that I will try my best to make not a fool out of me when making a pull request.
Have a great day!
Tobias

Thank you and good luck :slight_smile: Let me know if you need help.

You gotta be kidding!!! This couldnt be easier :wink:
I was expecting to spend hours configuring some Makefiles....instead:

go build
Downloading some dependencies and done. Awesome!!!

Okay, I build a version before my changes and confirmed the error:
2023/04/24 15:52:58 ERROR : ftp://fritzbox.local:21/FOLDER: SetModTime is not supported

After I have changed backend/ftp/ftp.go:

// SetModTime sets the modification time of the object
func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {
        if !o.fs.fSetTime {
                fs.Debugf(o.fs, "SetModTime is not supported")
                return nil
        }
        c, err := o.fs.getFtpConnection(ctx)
        if err != nil {
                return err
        }
        path := path.Join(o.fs.root, o.remote)
        path = o.fs.opt.Enc.FromStandardPath(path)
        err = c.SetTime(path, modTime.In(time.UTC))
        if err == nil && o.info != nil {
                o.info.ModTime = modTime
                o.info.precise = true
        }
        o.fs.putFtpConnection(&c, err)
        return err
}

No error message is printed to the console. Perfect!
Now, is there a guide / documentation on how to correctly create a pull request? It will be my first one so bare with me :wink:
Thanks for your help!

Great!

Creating your first PR has quite a few steps, alas. Here is a tutorial which looks pretty good: How to create a pull request in GitHub | Opensource.com

Don't download the github repo again though add an upstream for your repo

git remote add YOURGITHUBUSER https://github.com/YOURGITHUBUSER/rclone

And when you push the file you'll push it to git push -u YOURGITHUBUSER new_branch

Or you can follow the tutorial from scratch in a new directory and copy in the file you've modified at the right moment.

Good luck!

Hey Nick,

I think I managed to pull it off (no pun intended).

Allthough I messed up the verification. It was done on the client side with the correct git commit -S, but I didnt have keys installed on GitHub for the connected mail address. Apparently adding it afterwards, doesn't change the verification status.

I will do better next time!

Thanks for your patience and awesome work with rclone!

1 Like

Ah, yes, I always mess up the verification somehow too!

Thank you for the PR.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.