Godot: Error printed to console on any project with an image

Created on 3 Oct 2019  路  10Comments  路  Source: godotengine/godot

Godot version:
Latest 3.2
Latest 3.2 Mono
Not reproducible in 3.1.1 Mono! (Regression)

OS/device including version:
OS: Ubuntu 18.04 bionic
Kernel: x86_64 Linux 5.0.0-29-generic

Issue description:
On the second and all subsequent times you load the project with an image, this error shows up

ERROR: bind: Method/Function Failed, returning: ERR_UNAVAILABLE
   At: drivers/unix/net_socket_posix.cpp:367.

Happens with any image, and still happens when the .import/ folder is deleted and even when test.png.import is deleted.

Steps to reproduce:

  • Download reproduction project, or make any project that contains an image (This works on both PNG and JPG)
  • Open the project and wait for the import to finish.
  • Close and Reopen the project
  • Error will be shown in console

Minimal reproduction project:
GodotTestProject.zip

bug regression core

All 10 comments

Doesn't seem to happen in 00417675f

Tested on Windows 10 x64

This happens for me(on Ubuntu 19.04) when I open 2 or more editors.
This is probably related with GodotLanguageServer:
Screenshot_20191004_075934

CC @Geequlim

@qarmin This problem is caused by the two editors trying to listen to same port 6008(which is configurable in editor settings.)

@Faless Seems like the WebsocketServer not really stopped when I call stop here when quit to project manager.
https://github.com/godotengine/godot/blob/4da56495202847cf22bca9874593a4ed15da05e6/modules/gdscript/language_server/gdscript_language_protocol.cpp#L155-L157

@Geequlim weird, Are you sure the problem is there?

WebsocketServer::stop immediately calls TCP_Server::stop, which in turn calls NetSocket::close.

https://github.com/godotengine/godot/blob/bd7b2354c5384527ed73b5d13cee61d85f38fec6/modules/websocket/wsl_server.cpp#L226-L234

https://github.com/godotengine/godot/blob/bd7b2354c5384527ed73b5d13cee61d85f38fec6/core/io/tcp_server.cpp#L115-L120

Did you manage to reproduce the issue?

BTW, I can't reproduce it.
Of course if I open 2 editors together then the error happens, due to the language server trying to bind to the same port/address.

EDIT: I suspect the OP had 2 editor open and did not realize it

@Faless I can reproduce this problem when quit the edtor to project list. If I reopen the project from project manager the port is still in using.
If I exit the editor directly without quit to project manager the port is stopped correctly.

Edit: I'm testing on Arch Linux x64

@Geequlim Now I see...
the problem is that sockets are not created with FD_CLOEXEC, so if we fork before closing them (like we do with the language server when switching to project manager) they will be copied to the new process and thus stay open if we don't close them before forking.

I'll work on adding that option to our sockets, but we might need a _editor_deinit callback for better cleanup of editor plugins.

Edit: Yes I had two Editors open. 3.1 and then opened 3.2

DOUBLE EDIT: Ok, it happens when I Quit To Projects List and then Re-Open.

Hello same problem on Mac OS X Mojave
Version
/Applications/Godot 2.app/Contents/MacOS$ ./Godot --version
arguments
0: ./Godot
1: --version
Current path: /Applications/Godot 2.app/Contents/MacOS
3.2.alpha1.official

Error Message
Godot Engine v3.2.alpha1.official (c) 2007-2019 Juan Linietsky, Ariel Manzur & Godot Contributors.
drivers/unix/net_socket_posix.cpp:367 - Method/Function Failed, returning: ERR_UNAVAILABLE
--- GDScript language server started ---
Switch Scene Tab

Was this page helpful?
0 / 5 - 0 ratings