Dropbox saving errors with compressed files #93389

Open
opened 2021-11-25 21:41:12 +01:00 by Daniel Salazar · 14 comments
Member

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 496.49

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-11-24 23:04, hash: 827c5b399e

Short description of error
Saving compressed blend files on a Dropbox folder gives sporadical saving errors
image.png

Exact steps for others to reproduce the error
Save a compressed blend file on a Dropbox folder
If it doesn't give you an error keep pressing Ctrl+S

Notes:
Tested on Windows with the official Dropbox app
Save versioning is completely disabled

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1080 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 496.49 **Blender Version** Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-11-24 23:04, hash: `827c5b399e` **Short description of error** Saving compressed blend files on a Dropbox folder gives sporadical saving errors ![image.png](https://archive.blender.org/developer/F12192866/image.png) **Exact steps for others to reproduce the error** Save a compressed blend file on a Dropbox folder If it doesn't give you an error keep pressing Ctrl+S *Notes:* *Tested on Windows with the official Dropbox app* *Save versioning is completely disabled*
Author
Member

Added subscriber: @zanqdo

Added subscriber: @zanqdo

Added subscriber: @carlosmu

Added subscriber: @carlosmu

Yes, the same thing happened to me.
Anyway... Dropbox is usually troublesome.
imagen.png

Yes, the same thing happened to me. Anyway... Dropbox is usually troublesome. ![imagen.png](https://archive.blender.org/developer/F12203715/imagen.png)

If you pause the sync in Dropbox the issue disappears.
Apparently the conflict is because Dropbox takes control of the file.

If you pause the sync in Dropbox the issue disappears. Apparently the conflict is because Dropbox takes control of the file.

Added subscribers: @Harley, @iss

Added subscribers: @Harley, @iss

@Harley Saw you discussed this on chat, but it seems you haven't come to conclusion where the problem is? Just wanted to make sure all info is here too.

@Harley Saw you discussed this on chat, but it seems you haven't come to conclusion where the problem is? Just wanted to make sure all info is here too.
Member

When we save we first save the document in the target location with a temporary name. If that is successful we then rename this to the final desired name. This is a fairly standard practice that works as a failsafe for quite a few hardware, connectivity, and permissions errors.

In this case though Dropbox notices the new (temp) file has been added and starts processes that lock it for a short time which doesn’t allow the rename to proceed. That it is more likely to happen with compressed blends could be that these take a bit longer to save, or they might be saved incrementally, triggering Dropbox to do its thing at a different time.

Not sure (yet) what we can do about this. A good start would be a way to know these files are in Dropbox, ideally in a generic way that would work for similar systems and does not require their API. We can tell if the items are offline (not currently local) as we use that knowledge to no allow thumbnail creation, but not if the are just regular local files.

One thing that would solve this situation is to initially save the temp file in the user’s temp folder and the rename from there to final path. Rename doesn’t care if the folders, or even drives, differ so acts as a “move”. Although it would fix this issue it would have downsides. There would be performance degradation when saving any file to a drive that differs from the one containing your temp folder. And this would also negate some of the usefulness of the two-step save process since this doesn’t test the writeability of the target location until the rename.

When we save we first save the document in the target location with a temporary name. If that is successful we then rename this to the final desired name. This is a fairly standard practice that works as a failsafe for quite a few hardware, connectivity, and permissions errors. In this case though Dropbox notices the new (temp) file has been added and starts processes that lock it for a short time which doesn’t allow the rename to proceed. That it is more likely to happen with compressed blends could be that these take a bit longer to save, or they might be saved incrementally, triggering Dropbox to do its thing at a different time. Not sure (yet) what we can do about this. A good start would be a way to know these files are in Dropbox, ideally in a generic way that would work for similar systems and does not require their API. We can tell if the items are offline (not currently local) as we use that knowledge to no allow thumbnail creation, but not if the are just regular local files. One thing that would solve this situation is to initially save the temp file in the user’s temp folder and the rename from there to final path. Rename doesn’t care if the folders, or even drives, differ so acts as a “move”. Although it would fix this issue it would have downsides. There would be performance degradation when saving any file to a drive that differs from the one containing your temp folder. And this would also negate some of the usefulness of the two-step save process since this doesn’t test the writeability of the target location until the rename.

Added subscriber: @brecht

Added subscriber: @brecht

Here's some background on a similar thing in Sublime text, where they ended up disabling atomic saves.
https://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file

Also for the case where you write a temp file on another drive, it's not obvious that rename/move is atomic.

The ideal solution is not obvious to me. It feels like this should be a solved problem in other applications, but it seems hard to find good information on this.

Here's some background on a similar thing in Sublime text, where they ended up disabling atomic saves. https://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file Also for the case where you write a temp file on another drive, it's not obvious that rename/move is atomic. The ideal solution is not obvious to me. It feels like this should be a solved problem in other applications, but it seems hard to find good information on this.
Member

Gimp has reported almost-identical errors, but not seeing resolution:

Wondering now about the idea of first saving to user temp folder only if on the same drive as target location.

Gimp has reported almost-identical errors, but not seeing resolution: - https://gitlab.gnome.org/GNOME/gimp/-/issues/6495 - https://gitlab.gnome.org/GNOME/gimp/-/issues/5212 - https://gitlab.gnome.org/GNOME/gimp/-/issues/1370 Wondering now about the idea of first saving to user temp folder **only if** on the same drive as target location.
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58
Contributor

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Contributor

I think this task should be marked as confirmed.

I think this task should be marked as confirmed.
Author
Member

Dropping to say I've re-enabled compression to test things for a few days now (Windows and Linux) and I've gotten no errors so far. Maybe Dropbox fixed something or the new compression algorithm in Blender works better?

Can anyone else test?

Dropping to say I've re-enabled compression to test things for a few days now (Windows and Linux) and I've gotten no errors so far. Maybe Dropbox fixed something or the new compression algorithm in Blender works better? Can anyone else test?
Bastien Montagne added this to the Core project 2023-02-09 15:42:54 +01:00
Bastien Montagne removed this from the Core project 2023-02-09 18:20:37 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#93389
No description provided.