Comments (8)
Heads up @rclone/support - the "Support Contract" label was applied to this issue.
from rclone.
Google docs are handled in a special way in rclone.
We don't know their size until after they are downloaded so we can't use the standard copy routines. Instead we use the internal equivalent of rclone rcat
which streams the result to the destination.
In this process rclone loses the knowledge of the source backend.
I've had a go at fixing this here - can you give it a try? Note that this includes the fix for #7845 which is very relevant!
v1.67.0-beta.7962.0681eb1c7.fix-7848-metadata-mapper on branch fix-7848-metadata-mapper (uploaded in 15-30 mins)
from rclone.
The SrcFsType
now looks good, but I've lost the DstFsType
.
Now
"SrcFs": "Source{xrgXa}:Test",
"SrcFsType": "drive",
"DstFs": "//?/C:/Users/Chad/Logs/rclone-spool1942096378",
"DstFsType": "local",
Before
"SrcFs": "memory:",
"SrcFsType": "object.memoryFs",
"DstFs": "Target{VZpyf}:Test",
"DstFsType": "onedrive",
from rclone.
Using v1.67.0-beta.7962.0681eb1c7.fix-7848-metadata-mapper
, the behavior changes based on whether or not --streaming-upload-cutoff
governs the transfer.
Without --streaming-upload-cutoff
set
Note that the mapper is invoked twice for a single file.
{
"level": "debug",
"msg": "Metadata mapper sent: \n{\n\t\"SrcFs\": \"Source{xrgXa}:Test\",\n\t\"SrcFsType\": \"drive\",\n\t\"DstFs\": \"//?/C:/Users/Chad/Domains/cdsconsulting.co/logs/Copy-GOUserDrives_20240515_160249/rclone-spool259196758\",\n\t\"DstFsType\": \"local\",\n\t\"Remote\": \"Sample doc.docx\",\n\t\"Size\": -1,\n\t\"MimeType\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n\t\"ModTime\": \"2024-05-15T15:05:22.457Z\",\n\t\"IsDir\": false,\n\t\"Metadata\": {\n\t\t\"btime\": \"2024-05-15T14:56:11.061Z\",\n\t\t\"content-type\": \"application/vnd.google-apps.document\",\n\t\t\"copy-requires-writer-permission\": \"false\",\n\t\t\"mtime\": \"2024-05-15T15:05:22.457Z\",\n\t\t\"owner\": \"[email protected]\",\n\t\t\"permissions\": \"[{\\\"emailAddress\\\":\\\"[email protected]\\\",\\\"id\\\":\\\"14885772533033484759\\\",\\\"role\\\":\\\"writer\\\",\\\"type\\\":\\\"user\\\"},{\\\"emailAddress\\\":\\\"[email protected]\\\",\\\"id\\\":\\\"09287294999424909072\\\",\\\"role\\\":\\\"owner\\\",\\\"type\\\":\\\"user\\\"}]\",\n\t\t\"starred\": \"false\",\n\t\t\"viewed-by-me\": \"true\",\n\t\t\"writers-can-share\": \"true\"\n\t}\n}\n",
"source": "fs/metadata.go:123",
"time": "2024-05-15T16:03:00.789903-05:00"
}
{
"level": "debug",
"msg": "Metadata mapper sent: \n{\n\t\"SrcFs\": \"//?/C:/Users/Chad/Domains/cdsconsulting.co/logs/Copy-GOUserDrives_20240515_160249/rclone-spool259196758\",\n\t\"SrcFsType\": \"local\",\n\t\"DstFs\": \"Target{qpiyZ}:Test\",\n\t\"DstFsType\": \"onedrive\",\n\t\"Remote\": \"Sample doc.docx\",\n\t\"Size\": 317900,\n\t\"MimeType\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n\t\"ModTime\": \"2024-05-15T10:05:22.457-05:00\",\n\t\"IsDir\": false,\n\t\"Metadata\": {\n\t\t\"atime\": \"2024-05-15T10:05:22.457-05:00\",\n\t\t\"btime\": \"2024-05-15T09:56:11.061-05:00\",\n\t\t\"mode\": \"666\",\n\t\t\"mtime\": \"2024-05-15T10:05:22.457-05:00\"\n\t}\n}\n",
"source": "fs/metadata.go:123",
"time": "2024-05-15T16:03:01.167733-05:00"
}
With --streaming-upload-cutoff 100Mi
set
Note that the mapper is invoked only once.
{
"level": "debug",
"msg": "Metadata mapper sent: \n{\n\t\"SrcFs\": \"Source{xrgXa}:Test\",\n\t\"SrcFsType\": \"drive\",\n\t\"DstFs\": \"Target{qpiyZ}:Test\",\n\t\"DstFsType\": \"onedrive\",\n\t\"Remote\": \"Sample doc.docx\",\n\t\"Size\": 317900,\n\t\"MimeType\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n\t\"ModTime\": \"2024-05-15T15:05:22.457Z\",\n\t\"IsDir\": false,\n\t\"Metadata\": {\n\t\t\"btime\": \"2024-05-15T14:56:11.061Z\",\n\t\t\"content-type\": \"application/vnd.google-apps.document\",\n\t\t\"copy-requires-writer-permission\": \"false\",\n\t\t\"mtime\": \"2024-05-15T15:05:22.457Z\",\n\t\t\"owner\": \"[email protected]\",\n\t\t\"permissions\": \"[{\\\"emailAddress\\\":\\\"[email protected]\\\",\\\"id\\\":\\\"14885772533033484759\\\",\\\"role\\\":\\\"writer\\\",\\\"type\\\":\\\"user\\\"},{\\\"emailAddress\\\":\\\"[email protected]\\\",\\\"id\\\":\\\"09287294999424909072\\\",\\\"role\\\":\\\"owner\\\",\\\"type\\\":\\\"user\\\"}]\",\n\t\t\"starred\": \"false\",\n\t\t\"viewed-by-me\": \"true\",\n\t\t\"writers-can-share\": \"true\"\n\t}\n}\n",
"source": "fs/metadata.go:123",
"time": "2024-05-15T16:05:05.602204-05:00"
}
from rclone.
It looks like the changes I made are working for --streaming-upload-cutoff 100M
.
Some backends (such as onedrive) can't upload a file of unknown length. You can see these backends with StreamUpload = N in the overview table.
Google docs don't have a defined length - you have to download them to find out how long they are. So either we cache them in memory (if size < --streaming-upload-cutoff
) or we download them to a local disk first (if size >= --streaming-upload-cutoff
)
If we cache them in memory then you will just get the single transfer and the single invocation of the metadata mapper. If we are caching them on disk then you will get the transfer to the local disk (with metadata invocation) followed by the transfer from local disk to destination (with metadata invocation). Rclone takes some care that the metadata is correct when transferring via the local disk.
In an ideal world we'd change the onedrive backend to accept streaming uploads. I had a quick review of the uploading methods and still think that you can't upload files without knowing how big they are to onedrive. There is a stack overflow question which confirms this) but you may have a better idea. This would be the best solution if possible.
In the mean time I'm going to attempt to rejig the Rcat code so that it doesn't use the rclone machinery to copy an object to local disk. This will mean writing a bit more code but it would mean you'd only get one transfer. I don't think it would make the transfer less reliable. It would affect the stats slightly but I suspect currently they are quite confusing!
from rclone.
I've had a go at fixing this by re-working the internals of rcat.
I've run the local and onedrive integration tests with this and I think it is looking OK, but it could do with more testing.
v1.67.0-beta.7967.12d4964f2.fix-7848-metadata-mapper on branch fix-7848-metadata-mapper (uploaded in 15-30 mins)
from rclone.
In an ideal world we'd change the onedrive backend to accept streaming uploads. I had a quick review of the uploading methods and still think that you can't upload files without knowing how big they are to onedrive. There is a stack overflow question which confirms this) but you may have a better idea. This would be the best solution if possible.
My research turned up the same. Uploading files of unknown length does not seem possible with OneDrive/SharePoint.
The fix in v1.67.0-beta.7967.12d4964f2.fix-7848-metadata-mapper
looks good to me. In particular, when I have --streaming-upload-cutoff
unset:
- The mapper is invoked only once.
SrcFsType
andDstFsType
have the expected values.
{
"level": "debug",
"msg": "Metadata mapper sent: \n{\n\t\"SrcFs\": \"Source{xrgXa}:Test\",\n\t\"SrcFsType\": \"drive\",\n\t\"DstFs\": \"Target{qpiyZ}:Test\",\n\t\"DstFsType\": \"onedrive\",\n\t\"Remote\": \"Sample doc.docx\",\n\t\"Size\": 317900,\n\t\"MimeType\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n\t\"ModTime\": \"2024-05-15T15:05:22.457Z\",\n\t\"IsDir\": false,\n\t\"Metadata\": {\n\t\t\"btime\": \"2024-05-15T14:56:11.061Z\",\n\t\t\"content-type\": \"application/vnd.google-apps.document\",\n\t\t\"copy-requires-writer-permission\": \"false\",\n\t\t\"mtime\": \"2024-05-15T15:05:22.457Z\",\n\t\t\"owner\": \"[email protected]\",\n\t\t\"permissions\": \"[{\\\"emailAddress\\\":\\\"[email protected]\\\",\\\"id\\\":\\\"14885772533033484759\\\",\\\"role\\\":\\\"writer\\\",\\\"type\\\":\\\"user\\\"},{\\\"emailAddress\\\":\\\"[email protected]\\\",\\\"id\\\":\\\"09287294999424909072\\\",\\\"role\\\":\\\"owner\\\",\\\"type\\\":\\\"user\\\"}]\",\n\t\t\"starred\": \"false\",\n\t\t\"viewed-by-me\": \"true\",\n\t\t\"writers-can-share\": \"true\"\n\t}\n}\n",
"source": "fs/metadata.go:123",
"time": "2024-05-16T12:58:07.830524-05:00"
}
from rclone.
Related Issues (20)
- OAuth tokens fail to refresh when they are provided as a JSON blob (for native-app clients) HOT 2
- HDFS remote fails to copy file with " Received error: unexpected EOF" HOT 19
- Implement WebHDFS to acces remote HDFS storage HOT 4
- Poor copy/sync speed from a NFS-mounted directory to Ceph S3 bucket HOT 3
- WebAssembly - WASI Support HOT 1
- Access "Photos" folder in Proton Drive
- ListJSON failed to load config for crypt remote HOT 3
- Canβt move and rename inside linkbox mount HOT 3
- Wrong encoding type in response when using "serve s3" - should not be url-encoded HOT 4
- MacOS and Linux doesn't support space character on folder name HOT 1
- Problems with pikpak storing hash after uploads HOT 4
- Fatal error: unknown flag: --vfs-cache-mode HOT 4
- Fail on missing files when using `--files-from=`
- Support for BitBucket (git repo over ssh) HOT 1
- BYO Storage Provider
- panic at github.com/rclone/rclone/fs/metadata.go:112: invalid memory address or nil pointer dereference HOT 9
- The issue encountered when uploading large size file to Pikpak. HOT 2
- android: SAF support HOT 1
- Google Drive API does not always return permissionIds in files.list request HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rclone.