Failed to create temporary local FS to spool file

Running rclone (v1.42) on Android. It was compiled on Termux and runs in rcloneExplorer app.

When running rclone serve webdav and trying to upload files using a webdav client, the upload fails.

The important bit from log file is:

2018/08/09 02:07:23 DEBUG : webdav root 'Work-IT': Target remote doesn't support streaming uploads, creating temporary local FS to spool file
2018/08/09 02:07:23 ERROR : test/IMG_20160117_122457.jpg: WriteFileHandle.New Rcat failed: Failed to create temporary local FS to spool file: mkdir /data/data/com.termux/files/usr/tmp/rclone-spool516087129: permission denied
2018/08/09 02:07:23 ERROR : test/IMG_20160117_122457.jpg: WriteFileHandle.Write error: io: read/write on closed pipe

What seems to be happening is that rclone needs to create temporary files. Since it was compiled in Termux, it must think that the home directory is /data/data/com.termux/, and tries to save there. But since rclone is run from rcloneExplorer, it doesn’t have access to that directory.

Is there a flag that would tell rclone where to save those temporary files to? I looked through documentation and the only relevant flag I could find was --cache-tmp-upload-path. Running it with the flag and supplying a path that rclone can access on Android would still result in the error.

For reference, this issue was opened in my project. Link to github issue page.

You’ll need to set the TMPDIR environment variable which is a unix standard to point to the temporary directory.

Thanks, that worked :+1: