Crash using GN Editor or Assetbrowser when "datafiles/assets" folder is not there #104857
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104857
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-6.1.6-200.fc37.x86_64-x86_64-with-glibc2.36 64 Bits
Graphics card: NVIDIA GeForce RTX 3080 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 525.78.01
Blender Version
Broken: version: 3.6.0 Alpha, branch: main (modified), commit date: 2023-02-17 08:38, hash:
5de9a5dea5db
Worked: (newest version of Blender that worked as expected)
Short description of error
Since
b3fb73f325
, we should have adatafiles/assets
folder.When it is not there (renamed/deleted, or contains wrong stuff), blender crashes when trying to add nodes in the Geometry Nodes Editor and also just switching to the Asset Browser
Exact steps for others to reproduce the error
datafiles/assets
todatafiles/assets_
crash is in
essentials_directory_path
, givingwhat(): basic_string: construction from null is not valid
CC @JacquesLucke
CC @HooglyBoogly
Crash using GN Editor or Assetbrowser when "datafiles/assets" foder is not thereto Crash using GN Editor or Assetbrowser when "datafiles/assets" folder is not thereHonestly I don't mind if it crashes. Removing/renaming this folder is like deleting a DLL and expect Blender to keep working.
I even rather have a Blender that is not working, then one where some function will randomly fail because the expected Node Group won't be there (e.g., the Quick Fur operator).
Fine to close it (since I have resolved my pain now 🙂), was just raising awareness
My situation might have been special (local build, for some reason this already existing assets folder, ...)
But at least it wasnt something I was actively doing, just running into by accident
(so others might as well)
But again: closing is fine, we have the report as reference now for others to find 🙂
Generally seems reasonable to avoid crashing in this case. I hoped that just using
BKE_appdir_folder_id_user_notest
inessentials_directory_path
would fix, but unfortunately that function does not support to be called withBLENDER_DATAFILES
(yet?).It does seems possible but not entirely trivial to add it, because multiple paths are checked to find the correct folder, skipping the test doesn't seem to make sense
Alternatively, we could try to handle the case
essentials_directory_path
returns an empty result, but that currently breaks elsewhere because an asset library must have a non-empty root path.This IMO is not a nice attitude. I was just using Blender from the
main
branch and couldn't use the asset browser.Then there should be a nice message explaining the situation, including how to resolve it. How is a crash acceptable?
I'm with @dr.sybren here, when you delete a dll, you'll get a popup about abcd.dll not being found, just flat out crashing, the user potentially losing work and justifying it with "well the user did something wrong, why shouldn't we crash without telling anyone why!?" seems a little harsh, pretty sure there are other, perhaps better ways to communicate with a user?
I think the problem can be split in two ways:
People who deliberately want to build a light Blender (e.g., make lite) should be able to do so with no problems.
People who were just building a regular build who didn't want a lighter Blender should get a build error.
And in my opinion if in the second scenario the folder is still not there for some reason, Blender could be prevented from launch throwing the error at users.
I haven't checked what we do for the other datafiles but I expect to be something similar. If not we can probably copy what is done there.
Sybren (on chat) was suggesting a 3rd option:
"3. whenever these files are missing just show that things are missing and functionality is limited."
If we have a good way to show those warnings I think that should be fine. I'm a bit wary of warnings that may be easily dismissable. But this is an unlikely scenario anyways so I'm fine with whatever solution people prefer.
That's a statement that nobody can disagree with. Of course a standard
make
invocation should result in a properly functional Blender.This is a dangerous one. The first point was objective, about people running a specific command. Now you're looking at people's desires, and that's not so easy to put into a list of just two items.
Before
b3fb73f325
you could runninja install
occasionally, and not doing so either just works (because it has been run previously), or produces clear errors (Python not found, USD exporter that cannot write to USD files because it doesn't have the JSON files to configure it, etc.).Technically it's not possible to get a build error because the order is:
ninja
)ninja install
)It's that 2nd step that puts the files in the right place, and thus the check whether the files are there or not can only be done after that. And that would boil down to checking that Ninja actually works -- I don't think the install step is the right place to do so.
That I think is already way better than blatantly crashing with a cryptic error message.
There we employ graceful degradation. It's a well-known way to aid in stability of the software. Basically the opposite of "it's fine to crash if files are missing".
Also from a product perspective I think it's desirable to make Blender as fault-tolerant as feasible. Especially if it aligns with developer needs & productivity (less steps to perform when building Blender, more clarity when expectations are not met).
For reference, those are some of the current errors we get for missing datafiles:
I think this is a good start point, and we can even explore more robust error-handling. For example a fake asset fallback that could actually inform the users of what is missing right where they expect to find the actual assets - as just suggested by Sybren IRL.
At least add a message to stdout/stderr about the error on Blender crash!
I got another crash which is caused by
b3fb73f325
, see #104305.The cause is different though (this includes having an older Asset Library enabled in preferences -- still trying to figure out the exact details there)