godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.57k stars 20.35k forks source link

Improve error reporting when fail to create .import file #69911

Open AdamKokrito opened 1 year ago

AdamKokrito commented 1 year ago

Godot version

godot 4.0 beta 8

System information

Linux Ubuntu 22.04.1 LTS

Issue description

When importing new files like (png,jpeg,ogg..). The engine doesnt make an "example".import file .When i started the project i did not have this issue .I tried to fix it by opening the project with other versions of godot 4 but it did not work. (godot 3.5 didnt have this issue)

Screenshot from 2022-12-11 16-21-03 Screenshot from 2022-12-11 16-27-28

Steps to reproduce

Minimal reproduction project

import bug.zip

nestorac commented 1 year ago

Godot 4.8 beta, are you sure? Version 4.0 is still beta.

Calinou commented 1 year ago

Related to https://github.com/godotengine/godot/issues/69369. It's possible that removing the .godot/ folder within the project folder while the editor is closed resolves the issue.

@AdamKokrito Please upload a minimal reproduction project to make this easier to troubleshoot.

Godot 4.8 beta, are you sure? Version 4.0 is still beta.

OP is referring to 4.0.beta8.

AdamKokrito commented 1 year ago

Done import bug.zip I found out that one folder was the issue messing up the whole project

rcjsuen commented 1 year ago

import-4b10-bug.zip

@Calinou I am also experiencing this bug on macOS on 4b10. Deleting the .godot/ folder has not helped unfortunately. :(

rcjsuen commented 1 year ago

I reopened my project with 4b8 and imported some files then reopened the project in 4b10. From then on I was able to reuse my project in 4b10 in addition to importing new files in 4b10 so I am now unblocked. :)

pgpais commented 1 year ago

I might be experiencing a similar bug in Godot 4.0 beta 11. In my Windows 11 machine (where I usually work), everything runs smooth and is imported correctly. In my Linux Mint 21.1 machine Godot spits out errors saying that the .png file is corrupt.

In my case, I'm ignoring all .import files and .godot folder. I also have LFS set for the .png files but that seems to be working fine on my Windows machine (I just recloned the project to be sure). Seems to be a Linux-specific thing.

Any other information you think I can provide please ask away

EDIT: Please disregard this. I just noticed that LFS wasn't correctly configured on the linux machine. This is embarassing :D

coppolaemilio commented 1 year ago

I found this issue with the latest 4.0.beta11. The issue started happening after I downloaded a .gltf model (https://sketchfab.com/3d-models/gun-of-leila-from-d-the-vampire-hunter-blood-l-3RXKSlKHlIhV8Cjs1DqRq3mQheN) and placing it in my project. (I tried importing the same model into an empty new project and I couldn't reproduce the .png import bug) It failed to load its images, and after that, everything else failed as well.

No matter what new png files I want to import they all failed. The images that were imported already when I downloaded the template worked, but after removing the .godot directory they also failed.

The error messages:

  drivers/png/png_driver_common.cpp:56 - Not a PNG file
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: res://Level/Materials/._T_Grid.png
  editor/editor_file_system.cpp:1939 - Error importing 'res://Level/Materials/._T_Grid.png'.
  editor/editor_file_system.cpp:2163 - Condition "!importer.is_valid()" is true. Continuing.
  editor/editor_file_system.cpp:2163 - Condition "!importer.is_valid()" is true. Continuing.
  editor/editor_file_system.cpp:2163 - Condition "!importer.is_valid()" is true. Continuing.
  editor/editor_file_system.cpp:2163 - Condition "!importer.is_valid()" is true. Continuing.

I'm running Windows 10. This is the project with the issues: FPSCharaterController-main.zip

image

EDIT: Tried with beta 12 and same happens. Tried removing the .godot folder but no luck. EDIT 2: Trying self contained mode didn't fix the issue. EDIT 3: Tried removing the Godot cache files from /%APPDATA%/Godot but no luck either

akien-mga commented 1 year ago
$ file ./Level/Materials/._T_Grid.png
./Level/Materials/._T_Grid.png: AppleDouble encoded Macintosh file

That's indeed not a PNG.

Interestingly though, for me on Linux the file is ignored and not visible in the FileSystem dock, so I have no errors.

Zireael07 commented 1 year ago

No clue what the _T_Grid is, when looking up the model I see something else,

leila_gun_d.tga 1024x1024 png 1MB Source archive

Either the texture file is named "leila_gun_d.tga.png" or Sketchfab website is mistakenly recognizing tga as png?

jon-heard commented 1 year ago

I'm also experiencing this issue. I am unable to import files via two importer addons (.vox and .sfxr files) and also TTF font files, which should work without addons. All files imported before updating from Godot 3.5 to Godot 4.0 beta 10 work fine. In 4.0, new files show red X icons and the importer panel shows the message seen in Coppolaemilio's screenshot.

I've tried importing new files with Godot 4.0 beta 8, 10, 11 and 12 with the same results.

The errors that shows in the console when I try to add new files are:

  editor/editor_file_system.cpp:1904 - BUG: File queued for import, but can't be imported, importer for type '' not found.
  editor/editor_file_system.cpp:1905 - Method/function failed.
  editor/editor_file_system.cpp:2163 - Condition "!importer.is_valid()" is true. Continuing.

Thankfully, PNG files are still importing fine.

nezvers commented 1 year ago

Started with Beta 11, but moving to Beta 13 didn't change it.

  drivers/png/png_driver_common.cpp:56 - Not a PNG file
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: res://Assets/Visual/Actors/Enemy/Placeholder/Untitled_Artwork.png
  editor/editor_file_system.cpp:1940 - Error importing 'res://Assets/Visual/Actors/Enemy/Placeholder/Untitled_Artwork.png'.
  editor/editor_file_system.cpp:2164 - Condition "!importer.is_valid()" is true. Continuing.

I started to have an issue with importing new audio files too.

One thing I found was that one image for some reason was considered corrupted and it bricked importing. After deleting it other images got imported.

P.S. It fixed Audio file importing. Also, I found out that file names having the word Copy imports the image differently (without the preview icon but the CompressedTexture2D icon instead)

coppolaemilio commented 1 year ago

A user on Reddit reported a similar issue. Their solution was rather drastic, so I don't think that's what we should prescribe, but I'll leave it here for reference: https://www.reddit.com/r/godot/comments/10ky7vt/how_do_i_solve_png_not_being_imported_i

rcjsuen commented 1 year ago

I am getting this problem on macOS on Godot 4 beta 16. This is on a new project that I am starting fresh on beta 16. I'm having issues with both PNG and OGG files at the moment.

lyuma commented 1 year ago

If anybody is able to reproduce this on 4.0rc3, can you please zip up your project folder ideally minimally reproducible, or list exact steps.

a lot of the comments here are outdated and some bugs were fixed in earlier release candidates.

coppolaemilio commented 1 year ago

My side of it is solved, so I would feel good closing it, but probably better to wait for @AdamKokrito to confirm.

rcjsuen commented 1 year ago

@lyuma Thanks for continuing to check back on this issue. I just reproduced this problem on macOS 12.6.1 using Godot 4 RC4 with the Digital Audio pack from Kenney and I think I've figured out my problem at least...

When I unzip the file, I get the following structure:

Audio/
Kenney.url
License.txt
Patreon.url

Throwing this into my Godot project gets me the red X issue. Upon further inspection, I only have read privileges in the extracted Audio/ folder when inspecting it with "Get Info" in Finder. If I move the folder somewhere and change it so I have read and write privileges to Audio/ and throw it back into my Godot project then the import works and all those abc.ogg.import files are created. So the mystery is solved there. It couldn't have created any *.import files given that Godot could not write into the folder.

Now my question is how can Godot present the user with an informative error message when it cannot create the *.import file? The current list of red X icons makes identifying the root cause very difficult.

yedpodtrzitko commented 1 year ago

I've narrowed it down a bit - it happens with Compatibility Rendered. Forward+ works fine.

Not sure which of these log messages are directly related:

$ Godot Engine v4.1.dev.custom_build.080dab6c3 - https://godotengine.org
OpenGL API 4.1 Metal - 83.1 - Compatibility - Using Device: Apple - Apple M2 Pro

ERROR: Cubemap Arrays are not supported in the GL Compatibility backend.
   at: texture_2d_layered_initialize (drivers/gles3/storage/texture_storage.cpp:757)
ERROR: Attempting to use an uninitialized RID
   at: get_or_null (./core/templates/rid_owner.h:198)
ERROR: Condition "!t" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:700)
ERROR: Condition "!importer.is_valid()" is true. Continuing.
   at: reimport_files (editor/editor_file_system.cpp:2279)
ERROR: Condition "!importer.is_valid()" is true. Continuing.
   at: reimport_files (editor/editor_file_system.cpp:2279)
ERROR: Condition "!importer.is_valid()" is true. Continuing.
   at: reimport_files (editor/editor_file_system.cpp:2279)
yedpodtrzitko commented 1 year ago

the cause here might be related / overlapping with #75114 and #58131