Godot: Trying to load export templates in 3.0.3.rc3.mono

Created on 6 Jun 2018  路  22Comments  路  Source: godotengine/godot

Godot version:

Godot V3.0.3 RC3 Mono

OS/device including version:

N/A

Issue description:

Trying to load export templates, error appears at end:

Unable to write to file 'C:/users//AppData/Roaming/Godot/templates/3.0.3.rc3.mono, file in use, locked or lacking permissions.

No indication of which file it was referring to.

I found I could export a Windows C# project but it was missing one scene and didn't run properly:

ERROR: Failed loading resource: res://scenes/bullet.tscn
At: core/io/resource_loader.cpp:186
ERROR: Error loading resource: 'res://scenes/bullet.tscn'
At: core/bind/core_bind.cpp:79

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Tower.FireAtAlien (Godot.Vector2 vector) [0x00022] in :0
at main.TowerTargetting () [0x00080] in :0
at main._Process (System.Single delta) [0x00009] in :0

Steps to reproduce:
Load export templates

Minimal reproduction project:

This occured trying out this C# project: https://github.com/imekon/godot-unofficial-demo-projects-v3/tree/master/td2

If I can get a minimal version that has issues, I will.

bug editor mono

All 22 comments

CC @hpvb

Maybe similar to #6393 and #14339?

I think those two were fixed by #17869, which is included in 3.0.3-rc3, so I'm not sure.

This looks like windows or AV software locking files while scanning.

Try running the editor in self contained mode as a workaround (add a file named _sc_ in the same place as the executable, a editor_data folder will be created).

ps: I think self contained mode must be the default in the official downloads...

ps: I think self contained mode must be the default in the official downloads...

That would kind of defeat the point of the non-self contained mode, no? And you'd lose your settings and project each time you move to a newer version, unless you're very careful and put the binary in the exact same location.

@akien-mga yes, but is a downloaded binary, if it were added using an installer that can give the option to put things or not on user data folder (and clean it on reinstall-uninstall), is different and windows may even treat it differently too.

This error pops up in the console after downloading the templates again:

download 3.0.3.rc3.mono
(mirrors:[(name:Official 3.0.3-rc3.mono [HTTPS]), (url:https://downloads.tuxfamily.org/godotengine/3.0.3/rc3/mono/Godot_v3.0.3-rc3_mono_export_templates.tpz)])
ERROR: close: Condition ' rename_error ' is true.
    At: drivers/windows/file_access_windows.cpp:158
closed

@eon-s I tried self contained mode, I still get the error about the file being locked.

I tried exporting 'yielder' (see https://github.com/imekon/godot-unofficial-demo-projects-v3) however running the generated output results in lots of errors:

no access to .mono/assemblies/mscorlib.dll
ERROR: _get_modified_time: Method/Function Failed, returning: 0
    At: drivers/windows/file_access_windows.cpp:290
no access to .mono/assemblies/mscorlib.dll
ERROR: _get_modified_time: Method/Function Failed, returning: 0
    At: drivers/windows/file_access_windows.cpp:290
Mono: Runtime initialized
no access to .mono/assemblies/GodotSharp.dll
ERROR: _get_modified_time: Method/Function Failed, returning: 0
  At: drivers/windows/file_access_windows.cpp:290
no access to .mono/assemblies/System.dll
ERROR: _get_modified_time: Method/Function Failed, returning: 0
    At: drivers/windows/file_access_windows.cpp:290
no access to .mono/assemblies/Yielder.dll
ERROR: _get_modified_time: Method/Function Failed, returning: 0
    At: drivers/windows/file_access_windows.cpp:290
Mono: INITIALIZED
Found class .Main for script res://scripts/Main.cs
ERROR: load_interactive: Condition ' err != OK ' is true. returned: Ref<ResourceInteractiveLoader>()
    At: scene/resources/scene_format_text.cpp:1225
ERROR: Failed loading resource: res://scenes/red.tscn
    At: core/io/resource_loader.cpp:186
ERROR: Error loading resource: 'res://scenes/red.tscn'
    At: core/bind/core_bind.cpp:79
ERROR: load_interactive: Condition ' err != OK ' is true. returned: Ref<ResourceInteractiveLoader>()
    At: scene/resources/scene_format_text.cpp:1225
ERROR: Failed loading resource: res://scenes/green.tscn
    At: core/io/resource_loader.cpp:186
ERROR: Error loading resource: 'res://scenes/green.tscn'
    At: core/bind/core_bind.cpp:79
ERROR: load_interactive: Condition ' err != OK ' is true. returned: Ref<ResourceInteractiveLoader>()
    At: scene/resources/scene_format_text.cpp:1225
ERROR: Failed loading resource: res://scenes/blue.tscn
    At: core/io/resource_loader.cpp:186
ERROR: Error loading resource: 'res://scenes/blue.tscn'
    At: core/bind/core_bind.cpp:79

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
    at Main._Ready () [0x00052] in <51bd99c6a10941df9b452de25cef9752>:0
no access to .mono/assemblies/System.Core.dll
ERROR: _get_modified_time: Method/Function Failed, returning: 0
   At: drivers/windows/file_access_windows.cpp:290

I see a uppercase problem in that project, res://scenes/blue.tscn does not exists, but res://scenes/Blue.tscn, the editor on windows can run it but once packed, it is case sensitive.

Ah, that fixes the export; seems the error reported is nothing serious - though the Export is unavailable for a while - not sure when it appears.

This appears to happen due to windows defender. If I disable it this message goes away, it appears that everything still works afterwards so we'll look into this for 3.0.4

I'm getting the same error in 3.0.4 about export templates. I can still export on Windows, though, which is strange.

This error will keep appearing until binaries get signed (which may be complex with windows templates too), using self contained mode may help some users until windows/AV software gets even more agressive.

I keep getting an error just like this even with self contained mode whenever I attempt to install the export templates. I also attempted to export my project after said error, but doing that causes Godot to crash.

Edit: This is after disabling my anti-virus. I get this error every single time.

Same here. Running on Windows 7, 64 bit version using Mono (tried the one without Mono as well).

"Unable to write to file 'C:/Users/User/AppData/Roaming/Godot/templates/3.0.4.stable.mono/', file in use, locked or lacking permissions."

Downloaded the file and used the "install from file" button.
Tried the self contained mode, checked if any other software were really using any of the 10 files that are exported from the .tpz. Don't know about the empty .tmp file, however. It never goes away even though it's a .tmp file which should be temporary. Each time I start the editor it also generates log files in the mono/mono_logs with gems in it such as "AOT: image 'C:\Program Files\Mono\lib\/mono/aot-cache/amd64/mscorlib.dll.dll' not found: The system cannot find the path specified.". Then again I've been warned that the C# version is quite experimental from what I gathered.

Someone should explain to me why it's hard to export and move 10 files and write a .tmp file in a user's appdata directory (or a directory controlled by the software if self-contained). I've been using (tried using) this engine for not even a day yet and I'm already struggling to have my development environment working. Also, the fact that the C# version using Mono can't do releases properly yet should be the kind of thing that's advertised on the download page on their official website, not when you open a project in the editor. I know this isn't a blog and this isn't being helpful but this only makes me feel like I'm wasting my time tbh. I'm not impressed at having spent hours looking on github and tinkering with something that quite frankly, should be working without issues. I've been forced to do some funky work around at my job to get a C++ Builder IDE running on Windows 7 and 10 efficiently but this is not something I'd expect I have to do on something that's actually kept up to date.

UPDATE:
I've took some time today doing some testing and searching for answers and I've found something that might help any of you who are looking for a solution. Turns out the .tpz templates files that I've downloaded from the official website contain ADS which are blocked by Windows (which I should have thought about earlier). Basically, it's extra data contained within the template files, this is called the Windows Alternate Data Stream (ADS) which is a feature of the NFTS file format of Windows. Windows blocks this data because of it being a bit obscure and tricky, security softwares used to have a hard time detecting malicious things from within these data streams so Windows, as a matter of security, just blocks them outright when it comes from another computer.

To unblock the files, simply right-click them, go into properties and in the "General" tabs, at the very bottom there should be a mean to unblock the files through the "unblock" button.

If you want to learn more on ADS, you can check this out :
https://www.bleepingcomputer.com/tutorials/windows-alternate-data-streams/

To workaround that ADS thing then the tpz may need to be in another format, what about 7zip?

To unblock the files, simply right-click them, go into properties and in the "General" tabs, at the very bottom there should be a mean to unblock the files through the "unblock" button.

But is this really related to ADS? AIUI Windows just blocks downloaded files, in particular executables and containers, no matter what they have in.

For 3.0.5 the editor binary will be signed. I'm not sure if that in itself will fix the problem though since the export templates themselves will likely not be. I'll have a look at it though.

Apparently this issue was caused by choking on folders while installing the templates, which is fixed by #20186 (and should be in 3.0.6 once cherry-picked).

Please comment if you can still reproduce the issue when 3.0.6 RCs are made available.

BTW @hpvb, this issue started happening with 3.0.3 because you're zipping the whole templates/ folder (folder + files), while you should only zip the files as shown in the pre-3.0.3 build script: https://github.com/GodotBuilder/godot-builds/blob/master/scripts/zip-templates.sh#L11

So basically zip file.zip templates/* instead of zip -r file.zip templates/. See the difference:

$ unzip -l Godot_v3.0.5-stable_export_templates.tpz 
Archive:  Godot_v3.0.5-stable_export_templates.tpz
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2018-07-08 19:23   templates/
 10153460  2018-07-08 17:01   templates/uwp_arm_release.zip
  9254183  2018-07-08 17:01   templates/uwp_arm_debug.zip
  8310024  2018-07-08 17:01   templates/uwp_x86_release.zip
  8632055  2018-07-08 17:01   templates/uwp_x86_debug.zip
 10888562  2018-07-08 17:01   templates/uwp_x64_release.zip
 10562153  2018-07-08 17:01   templates/uwp_x64_debug.zip
 24363008  2018-07-08 18:17   templates/windows_64_release.exe
 23156736  2018-07-08 18:17   templates/windows_64_debug.exe
 24536576  2018-07-08 18:17   templates/windows_32_release.exe
 25304064  2018-07-08 18:17   templates/windows_32_debug.exe
 48619434  2018-07-08 18:18   templates/osx.zip
 96436979  2018-07-08 18:18   templates/iphone.zip
 33767609  2018-07-08 18:56   templates/linux_x11_32_debug
 33515993  2018-07-08 18:56   templates/linux_x11_32_release
 29143540  2018-07-08 19:16   templates/linux_x11_64_debug
 29852187  2018-07-08 19:16   templates/linux_x11_64_release
 43183081  2018-07-08 19:18   templates/android_debug.apk
 34537592  2018-07-08 19:18   templates/android_release.apk
  3381515  2018-07-08 19:23   templates/webassembly_release.zip
  4896171  2018-07-08 19:23   templates/webassembly_debug.zip
       13  2018-07-08 19:23   templates/version.txt
---------                     -------
512494935                     22 files

$ unzip -l Godot_v2.1.5-rc2_export_templates.tpz 
Archive:  Godot_v2.1.5-rc2_export_templates.tpz
  Length      Date    Time    Name
---------  ---------- -----   ----
 23193348  2018-07-18 19:16   templates/GodotiOSXCode.zip
 16334054  2018-07-18 19:29   templates/android_debug.apk
 14179463  2018-07-18 19:29   templates/android_release.apk
  6268581  2018-07-18 19:16   templates/javascript_debug.zip
  6325118  2018-07-18 19:16   templates/javascript_release.zip
 25280996  2018-07-18 19:16   templates/linux_x11_32_debug
 26157998  2018-07-18 19:16   templates/linux_x11_32_release
 25940704  2018-07-18 19:16   templates/linux_x11_64_debug
 27295283  2018-07-18 19:16   templates/linux_x11_64_release
 40902822  2018-07-18 19:16   templates/osx.zip
        9  2018-07-18 19:30   templates/version.txt
 14389248  2018-07-18 19:16   templates/windows_32_debug.exe
 15290880  2018-07-18 19:16   templates/windows_32_release.exe
 17263104  2018-07-18 19:16   templates/windows_64_debug.exe
 17306624  2018-07-18 19:16   templates/windows_64_release.exe
  7145553  2018-07-18 19:30   templates/winrt_arm_debug.zip
  7363468  2018-07-18 19:30   templates/winrt_arm_release.zip
  8235928  2018-07-18 19:30   templates/winrt_x64_debug.zip
  9129781  2018-07-18 19:30   templates/winrt_x64_release.zip
  6811523  2018-07-18 19:30   templates/winrt_x86_debug.zip
  7143735  2018-07-18 19:30   templates/winrt_x86_release.zip
---------                     -------
321958220                     21 files

See how the 3.0.5-stable tpz has 0 2018-07-08 19:23 templates/ which is not in the 2.1.5-rc2 tpz.

Reuploading fixed tpz for 3.0.3, 3.0.4 and 3.0.5 should fix this issue (and #20186 should prevent it from happening even if templates tpz contain a folder).

You could also add the -D switch to ensure that no directories are included in the zip.

Then you'd get:

$ zip -q -9 -D test.zip 3.0.5.stable/

zip error: Nothing to do! (test.zip)

$ zip -q -9 -D test-wildcard.zip 3.0.5.stable/*

$ zip -q -9 -D test-wildcard.zip 3.0.5.stable/*
unzip -l test-wildcard.zip[akien@cauldron templates]$ unzip -l test-wildcard.zip
Archive:  test-wildcard.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 43183081  2018-07-18 13:43   3.0.5.stable/android_debug.apk
 34537592  2018-07-18 13:43   3.0.5.stable/android_release.apk
 96436979  2018-07-18 13:43   3.0.5.stable/iphone.zip
 33767609  2018-07-18 13:43   3.0.5.stable/linux_x11_32_debug
 33515993  2018-07-18 13:43   3.0.5.stable/linux_x11_32_release
 29143540  2018-07-18 13:43   3.0.5.stable/linux_x11_64_debug
 29852187  2018-07-18 13:43   3.0.5.stable/linux_x11_64_release
 48619434  2018-07-18 13:43   3.0.5.stable/osx.zip
  9254183  2018-07-18 13:43   3.0.5.stable/uwp_arm_debug.zip
 10153460  2018-07-18 13:43   3.0.5.stable/uwp_arm_release.zip
 10562153  2018-07-18 13:43   3.0.5.stable/uwp_x64_debug.zip
 10888562  2018-07-18 13:43   3.0.5.stable/uwp_x64_release.zip
  8632055  2018-07-18 13:43   3.0.5.stable/uwp_x86_debug.zip
  8310024  2018-07-18 13:43   3.0.5.stable/uwp_x86_release.zip
       13  2018-07-18 13:43   3.0.5.stable/version.txt
  4896171  2018-07-18 13:43   3.0.5.stable/webassembly_debug.zip
  3381515  2018-07-18 13:43   3.0.5.stable/webassembly_release.zip
 25304064  2018-07-18 13:43   3.0.5.stable/windows_32_debug.exe
 24536576  2018-07-18 13:43   3.0.5.stable/windows_32_release.exe
 23156736  2018-07-18 13:43   3.0.5.stable/windows_64_debug.exe
 24363008  2018-07-18 13:43   3.0.5.stable/windows_64_release.exe
---------                     -------
512494935                     21 files

$ zip -r -q -9 -D test-recursive.zip 3.0.5.stable/

$ unzip -l test-recursive.zip 
Archive:  test-recursive.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 25304064  2018-07-18 13:43   3.0.5.stable/windows_32_debug.exe
 96436979  2018-07-18 13:43   3.0.5.stable/iphone.zip
 10153460  2018-07-18 13:43   3.0.5.stable/uwp_arm_release.zip
 34537592  2018-07-18 13:43   3.0.5.stable/android_release.apk
 10562153  2018-07-18 13:43   3.0.5.stable/uwp_x64_debug.zip
 29852187  2018-07-18 13:43   3.0.5.stable/linux_x11_64_release
       13  2018-07-18 13:43   3.0.5.stable/version.txt
 10888562  2018-07-18 13:43   3.0.5.stable/uwp_x64_release.zip
 24536576  2018-07-18 13:43   3.0.5.stable/windows_32_release.exe
 43183081  2018-07-18 13:43   3.0.5.stable/android_debug.apk
  8632055  2018-07-18 13:43   3.0.5.stable/uwp_x86_debug.zip
  3381515  2018-07-18 13:43   3.0.5.stable/webassembly_release.zip
 29143540  2018-07-18 13:43   3.0.5.stable/linux_x11_64_debug
 33515993  2018-07-18 13:43   3.0.5.stable/linux_x11_32_release
  4896171  2018-07-18 13:43   3.0.5.stable/webassembly_debug.zip
 24363008  2018-07-18 13:43   3.0.5.stable/windows_64_release.exe
  9254183  2018-07-18 13:43   3.0.5.stable/uwp_arm_debug.zip
 23156736  2018-07-18 13:43   3.0.5.stable/windows_64_debug.exe
  8310024  2018-07-18 13:43   3.0.5.stable/uwp_x86_release.zip
 48619434  2018-07-18 13:43   3.0.5.stable/osx.zip
 33767609  2018-07-18 13:43   3.0.5.stable/linux_x11_32_debug
---------                     -------
512494935                     21 files
Was this page helpful?
0 / 5 - 0 ratings