Recover Autosave breaks library paths #112423

Closed
opened 2023-09-15 19:49:58 +02:00 by Demeter Dzadik · 8 comments
Member

Blender Version
Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-09-12 22:03, hash: 158dbc1b101b
Worked: (newest version of Blender that worked as expected)

Exact steps for others to reproduce the error

  • Download both files, next to each other: cube_linked.blend cube.blend
  • Open cube_linked.blend to verify that it's valid the way it is. It links a collection from the other file.
  • File->Recover Autosave->Browse cube_linked.blend
  • Library path is broken, pop-up error about missing IDs.


(The 2nd error pop-up here is from an add-on, but I tested the bug after disabling add-ons and restarting Blender as well.)

**Blender Version** Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-09-12 22:03, hash: `158dbc1b101b` Worked: (newest version of Blender that worked as expected) **Exact steps for others to reproduce the error** - Download both files, next to each other: [cube_linked.blend](/attachments/a586365a-40b3-4b5e-89f4-688e98fdfcfe) [cube.blend](/attachments/d14fb542-ee23-41b5-8cd4-7e7de84cfc42) - Open cube_linked.blend to verify that it's valid the way it is. It links a collection from the other file. - File->Recover Autosave->Browse cube_linked.blend - Library path is broken, pop-up error about missing IDs. <video src="/attachments/f4b1c9ad-efa6-4921-a472-23b04903311a" title="2023-09-15 19-47-38.mp4" controls></video> (The 2nd error pop-up here is from an add-on, but I tested the bug after disabling add-ons and restarting Blender as well.)
Demeter Dzadik added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-09-15 19:49:59 +02:00
Germano Cavalcante added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-09-15 21:59:37 +02:00

Following the steps described, it works fine for me.
No broken path or error popup.

Are you able to reproduce this issue consistently with the steps you provided?
Can you try using a different version of Blender to see if the issue is specific to the 4.0.0 Alpha version.
Could you provide debug logs through the Batch scripts included in Blender installation directory? (See https://docs.blender.org/manual/en/dev/troubleshooting/crash.html)

System Information
    Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 528.79
Following the steps described, it works fine for me. No broken path or error popup. Are you able to reproduce this issue consistently with the steps you provided? Can you try using a different version of Blender to see if the issue is specific to the 4.0.0 Alpha version. Could you provide debug logs through the Batch scripts included in Blender installation directory? (See https://docs.blender.org/manual/en/dev/troubleshooting/crash.html) <details> <summary>System Information</summary> <ul> Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 528.79 </ul> </details>
Author
Member

Yessir, consistent. Tested after nuking my .config folder, happens in 4.0, 3.6.2 release, 3.1.2 release.

Double-checking in 4.0 latest-ish:

3.6.2 release:

(I must admit, I'm not sure why there's a black bar on the bottom instead of the asset shelf here!)

3.1.2 release:

So, if this wasn't caused by a recent Blender change... I either haven't used autosave recovery in a very very long time, which I doubt, or the issue is somehow specific to my system... which is weird. I can ask someone else in the office on Monday to test this, since we all have the same OS here. But, hm, still, wtf. Maybe I'm cursed.

System Information
Operating system: Linux-6.5.2-gentoo-x86_64-Intel-R-_Core-TM-i9-9900K_CPU@_3.60GHz-with-glibc2.37 64 Bits
Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 535.104.05

Yessir, consistent. Tested after nuking my .config folder, happens in 4.0, 3.6.2 release, 3.1.2 release. Double-checking in 4.0 latest-ish: <video src="/attachments/e42d241a-4076-484f-b98f-629582a1050b" title="2023-09-15 22-10-52.mp4" controls></video> 3.6.2 release: <video src="/attachments/30afd72e-5cda-4ea5-8db5-2a1bb7d02d1b" title="2023-09-15 22-12-40.mp4" controls></video> (I must admit, I'm not sure why there's a black bar on the bottom instead of the asset shelf here!) 3.1.2 release: <video src="/attachments/f2c4ff4c-7595-434b-98ec-620fe2f4fe40" title="2023-09-15 22-16-07.mp4" controls></video> So, if this wasn't caused by a recent Blender change... I either haven't used autosave recovery in a very very long time, which I doubt, or the issue is somehow specific to my system... which is weird. I can ask someone else in the office on Monday to test this, since we all have the same OS here. But, hm, still, wtf. Maybe I'm cursed. **System Information** Operating system: Linux-6.5.2-gentoo-x86_64-Intel-R-_Core-TM-_i9-9900K_CPU_@_3.60GHz-with-glibc2.37 64 Bits Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 535.104.05
Germano Cavalcante added
Status
Needs Triage
and removed
Status
Needs Information from User
labels 2023-09-15 22:20:56 +02:00

I cannot reproduce this problem either on a build of blender 4 that I built from source yesterday. Perhaps its os specific as I only tested on windows.
I'll try to test on a fresh install of gentoo when I have time, but I don't really have any right now.

I cannot reproduce this problem either on a build of blender 4 that I built from source yesterday. Perhaps its os specific as I only tested on windows. I'll try to test on a fresh install of gentoo when I have time, but I don't really have any right now.
Member

I can confirm in current main (also persists in older releases)

**System Information**
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 532.03
I can confirm in current main (also persists in older releases) ``` **System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 532.03 ```
Pratik Borhade added
Module
Core
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-09-18 11:59:51 +02:00

@PratikPB2123, thanks for confirming. I was planning on farther testing but I am away right now, so limited to mobile devices.

@PratikPB2123, thanks for confirming. I was planning on farther testing but I am away right now, so limited to mobile devices.

@Mets is this happening also with real autosave/crash files?

Thing is, filepath is only written to file (in FileGlobal) when writing recovery files (i.e. when G_FILE_RECOVER_WRITE is set, see writefile.cc:1063). This was changed in 88b24bc6bb .

But when recovering a file (when G_FILE_RECOVER_READ is set), the relabase path (used to handle relative paths) of the filedata is forcefully set to the FileGlobal.filepath value, which will always be empty for regular-saved files. See readfile.cc:3120.

This also implies that bfd->filepath is almost always empty, though this does not seem to have consequences in current code, besides recover code again (see blendfile.cc:902).

To me it feels like 88b24bc6bb forgot to handle appropriate changes in readcode, @ideasman42 ?

!115048 tries to fix this now.

@Mets is this happening also with _real_ autosave/crash files? Thing is, filepath is only written to file (in `FileGlobal`) when writing recovery files (i.e. when `G_FILE_RECOVER_WRITE` is set, see `writefile.cc:1063`). This was changed in 88b24bc6bbbf35b . But when recovering a file (when `G_FILE_RECOVER_READ` is set), the `relabase` path (used to handle relative paths) of the filedata is forcefully set to the `FileGlobal.filepath` value, which will always be empty for regular-saved files. See `readfile.cc:3120`. This also implies that `bfd->filepath` is almost always empty, though this does not seem to have consequences in current code, besides recover code again (see `blendfile.cc:902`). To me it feels like 88b24bc6bbbf35b forgot to handle appropriate changes in readcode, @ideasman42 ? !115048 tries to fix this now.
Author
Member

You're right, it doesn't seem to happen on real autosave files. Sorry, I didn't realize that, so this issue is not nearly as bad as I thought.

Still, the reason I discovered this is that I was writing my own autosave behaviour in Python, which of course just calls bpy.ops.save_as_mainfile(copy=True, ...). So, a fix would still be welcome. :)

You're right, it doesn't seem to happen on real autosave files. Sorry, I didn't realize that, so this issue is not nearly as bad as I thought. Still, the reason I discovered this is that I was writing my own autosave behaviour in Python, which of course just calls `bpy.ops.save_as_mainfile(copy=True, ...)`. So, a fix would still be welcome. :)
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-01-24 10:49:37 +01:00
Author
Member

Ah, cool that you got around to this, thanks! I'm still using my custom autosave add-on, so having this fixed is nice, so I don't have to deal with those broken library paths anymore. It has saved my butt on at least a couple occasions where regular autosave wouldn't have.

Ah, cool that you got around to this, thanks! I'm still using my custom autosave add-on, so having this fixed is nice, so I don't have to deal with those broken library paths anymore. It has saved my butt on at least a couple occasions where regular autosave wouldn't have.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
5 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#112423
No description provided.