Quick answer: You called disconnect() for a signal and Callable pair that is not connected on that object at that moment. Either the connection is already gone (disconnected twice, a one-shot that fired, a freed node) or it was made with a different Callable or on a different instance. Guard the call with is_connected(), keep the exact Callable you connected when it is a lambda, and remove disconnects that Godot already does for you when a node is freed.

This error does not stop the game. Godot prints it, skips the disconnect and carries on, which is why it tends to pile up in the Debugger panel unnoticed until someone reads the log. It is still worth fixing, because it means your idea of which connections exist differs from the engine’s, and the same misunderstanding is behind handlers that fire twice or never. This guide covers the message in Godot 4 and Godot 3, the rule Godot uses to decide whether a connection “exists”, the seven situations that break that rule, and the fix for each.

The exact error

In Godot 4.1 and later, the terminal and the log file of an exported game show:

ERROR: Attempt to disconnect a nonexistent connection from 'StartButton:<Button#28840035591>'. Signal: 'pressed', callable: 'Control(main_menu.gd)::_on_start_pressed'.
   at: _disconnect (core/object/object.cpp:1458)

In the editor, the same error appears in the Debugger > Errors tab with the script line that made the call:

E 0:00:03:0412   main_menu.gd:21 @ _exit_tree(): Attempt to disconnect a nonexistent connection from 'StartButton:<Button#28840035591>'. Signal: 'pressed', callable: 'Control(main_menu.gd)::_on_start_pressed'.
  <C++ Error>    Condition "signal_is_valid" is true. Returning: false
  <C++ Source>   core/object/object.cpp:1458 @ _disconnect()
  <Stack Trace>  main_menu.gd:21 @ _exit_tree()

The line number inside object.cpp changes between engine versions. The three quoted parts are what matter. The first is the object that owns the signal, written as node name, class and instance ID. The second is the signal. The third is the Callable you passed: the target’s class, its script file and the method. When the Callable is a lambda, the third part reads (anonymous lambda).

Older versions word it differently:

VersionMessage
Godot 4.1 and laterAttempt to disconnect a nonexistent connection from '…'. Signal: 'pressed', callable: '…'.
Godot 4.0The line above when the signal has no connections at all. When it has other connections: Disconnecting nonexistent signal 'pressed', callable: Control(main_menu.gd)::_on_start_pressed.
Godot 3.3 to 3.5Attempt to disconnect a nonexistent connection to signal 'pressed' in [Button:1234], with target '_on_start_pressed' in [Control:1230]. or Disconnecting nonexistent signal 'pressed', slot: 1230:_on_start_pressed.
Godot 3.2 and earlierDisconnecting nonexistent signal 'pressed', slot: 1230:_on_start_pressed.

One neighbor looks similar and means something else. Disconnecting nonexistent signal 'presed' in StartButton:<Button#28840035591>. says the object has no signal with that name at all. You only get it from the string form, button.disconnect("presed", ...), and the fix is the spelling.

How Godot decides a connection exists

A connection is stored on the emitting object, under the signal’s name, keyed by the Callable. disconnect() succeeds only when all three match: the same emitter instance, the same signal, and a Callable that compares equal to the one that was connected. What “equal” means depends on the kind of Callable:

CallableEqual whenConsequence
Method, such as _on_start_pressed or Callable(self, "_on_start_pressed")Same target object and same method nameYou can write the method name again at disconnect time and it matches
Lambda, func(): ...It is the same Callable value. Two lambdas with identical code are differentYou must store the lambda and pass that stored value to disconnect()
Bound, _on_pressed.bind(3)The Callable underneath the bind matches. Bound arguments are ignored for connect, disconnect and is_connected()disconnect(_on_pressed) removes a connection made with _on_pressed.bind(3)

The bind rule surprises people in the other direction too. Because the arguments are ignored, connecting _on_pressed.bind(1) and then _on_pressed.bind(2) to the same signal is treated as connecting the same thing twice, which is the error covered in How to Fix “Signal is already connected” in Godot. If you see advice that bind() breaks disconnecting, it does not apply to Godot 4.

What causes it

  1. The disconnect runs more often than the connect. The classic pair is connect() in _ready() and disconnect() in _exit_tree(). _ready() runs once. _exit_tree() runs every time the node leaves the tree, so the second time you remove or reparent the node there is nothing left to disconnect.
  2. It was never connected, or not to this method. The connect() call sits in a branch that did not run, or the connection was made in the Node dock to a method on a different node than the script that is now trying to disconnect it.
  3. A lambda was connected and a new lambda is passed to disconnect. Every func(): ... expression creates a new Callable each time the line runs.
  4. The connection was one-shot and has already fired. A connection made with CONNECT_ONE_SHOT is removed by the engine just before the callback is called.
  5. The emitter is a different instance. The node was freed and instanced again, taken from a pool, or you kept a reference to the old scene. The new instance has the same name and none of the old connections.
  6. The target is a different instance. _on_hit written in one enemy’s script refers to that enemy. The connection may belong to another enemy’s _on_hit.
  7. The engine already cleaned up. When an object is freed, Godot drops every connection from its signals and every connection to its methods. Cleanup code that runs later, against whatever now sits in the same variable, finds nothing to remove.

Find which one you have

  1. Read the callable in the message. (anonymous lambda) means cause 3. A class and script you did not expect, for example the scene root’s script where you thought it was the button’s, means cause 2 or 6.
  2. Read the <C++ Error> line in the editor. Condition "signal_is_valid" is true means the signal has no connections of any kind on that emitter: think double disconnect, one-shot, or a fresh instance. A condition that mentions slot_map.has means the signal has connections, and yours is not among them: think wrong Callable or wrong target.
  3. Print what is connected, on the line before the failing call:
for c in button.pressed.get_connections():
    print(c["callable"], " flags=", c["flags"])
print("emitter id: ", button.get_instance_id())

Compare the instance ID with the number after # in the error. If they differ, the variable does not point at the object you connected to. If the list is empty, look for the earlier disconnect: put a breakpoint or a print_stack() on every disconnect of that signal, and check whether the connect used CONNECT_ONE_SHOT.

Fix 1: remove disconnects Godot already does

A large share of these errors come from cleanup code that was never needed. This is the usual shape:

func _ready() -> void:
    GameEvents.score_changed.connect(_on_score_changed)

func _exit_tree() -> void:
    GameEvents.score_changed.disconnect(_on_score_changed)

If the node is only ever removed by queue_free(), delete _exit_tree(). When the node is freed, the engine removes every connection whose Callable targets it, including connections from autoloads and from nodes in other scenes. That covers method Callables and lambdas that use self or a member of the script. The exception is a lambda that touches only local variables: it is not tied to any node, so it stays connected for as long as the emitter lives. That case has its own failure, described in How to Fix “Lambda capture at index 0 was freed” in Godot.

One-shot connections are the same story. This disconnect is redundant and fails whenever the timer has already fired:

func start_countdown() -> void:
    timer.timeout.connect(_on_countdown_done, CONNECT_ONE_SHOT)

func cancel_countdown() -> void:
    timer.stop()
    timer.timeout.disconnect(_on_countdown_done)   # error if it already fired

Keep the cancel path, since a one-shot that never fired is still connected, and guard it as shown in the next section.

Fix 2: pair connect and disconnect, and guard with is_connected()

You do need a manual disconnect when the node stays alive and should stop listening: a pooled bullet returned to the pool, a panel taken out of the tree with remove_child() and kept for later. Put the two calls on callbacks that run the same number of times. _enter_tree() and _exit_tree() are such a pair. _ready() and _exit_tree() are not.

func _enter_tree() -> void:
    if not GameEvents.score_changed.is_connected(_on_score_changed):
        GameEvents.score_changed.connect(_on_score_changed)

func _exit_tree() -> void:
    if GameEvents.score_changed.is_connected(_on_score_changed):
        GameEvents.score_changed.disconnect(_on_score_changed)

is_connected() returns false without printing anything when the connection does not exist, so the guard is safe in both directions. In _enter_tree(), @onready variables are not assigned yet on the first entry, so this pairing suits signals on autoloads and on nodes you reach without them. For a child button, connect in _ready() and skip the disconnect: the button and the script are freed together.

Do not use the guard to silence a disconnect you cannot explain. If is_connected() is false at a point where you believed the connection was live, something else removed it or it was never made, and the handler has been silent for longer than you think.

In Godot 3 the same guard takes three arguments: if emitter.is_connected("score_changed", self, "_on_score_changed"):.

Fix 3: keep the Callable you connected

# Broken: two different lambdas
func _ready() -> void:
    health_bar.value_changed.connect(func(v): label.text = str(v))

func stop_tracking() -> void:
    health_bar.value_changed.disconnect(func(v): label.text = str(v))

The second lambda has the same source text and is a different object. The error names it as (anonymous lambda). Store the first one in a member variable and reuse it:

var _on_value_changed: Callable

func _ready() -> void:
    _on_value_changed = func(v): label.text = str(v)
    health_bar.value_changed.connect(_on_value_changed)

func stop_tracking() -> void:
    if health_bar.value_changed.is_connected(_on_value_changed):
        health_bar.value_changed.disconnect(_on_value_changed)

When a lambda is connected inside a loop, store one Callable per emitter, for example in a Dictionary keyed by the emitter. If that feels like bookkeeping, it is a sign the lambda should be a named method. Extra data that the lambda captured can be passed with bind() instead, and as described above the bound arguments do not have to be repeated when you disconnect:

slot_button.pressed.connect(_on_slot_pressed.bind(slot_index))
# later
slot_button.pressed.disconnect(_on_slot_pressed)

Fix 4: disconnect from the instance you connected to

The emitter half of the pair goes wrong when a variable is reassigned between connect and disconnect:

# hud.gd, broken
func _ready() -> void:
    player.health_changed.connect(_on_health_changed)

func _on_player_respawned(new_player: Player) -> void:
    player = new_player    # the old player was freed, the new one is not connected

func _exit_tree() -> void:
    player.health_changed.disconnect(_on_health_changed)   # error

The error here is the harmless symptom. The real bug is that the health bar stopped updating at the respawn, because nothing ever connected the new player. Move both calls into one function that owns the variable:

func set_player(new_player: Player) -> void:
    if is_instance_valid(player) and player.health_changed.is_connected(_on_health_changed):
        player.health_changed.disconnect(_on_health_changed)
    player = new_player
    if player:
        player.health_changed.connect(_on_health_changed)

is_instance_valid() comes first because calling anything on a freed player raises a different error, covered in How to Fix “Attempt to call function on a previously freed instance” in Godot. A freed player needs no disconnect, since its connections went with it. Pooled objects follow the same rule: connect when the object is taken from the pool, disconnect when it is returned, both in the pool’s own code.

The target half goes wrong when the method belongs to someone else. Inside enemy.gd, _on_wave_ended means this enemy’s method. If a spawner wrote wave.ended.connect(enemy._on_wave_ended), then the disconnect has to name that same enemy: wave.ended.disconnect(enemy._on_wave_ended). Keeping connect and disconnect in the same script, on the same object, avoids the mismatch.

How to confirm the fix

Run the scene and repeat the action that produced the error until the Errors tab stays empty: remove and re-add the node, change scene and come back, return an object to its pool and take it out again. Then check the other half, that the handler still runs exactly once per emission. Add a temporary print() to the handler, or print get_connections().size() for the signal after each connect and disconnect. A count that grows each time the scene is entered means a connection is leaking, which is the subject of How to Fix a Godot Memory Leak from Undisconnected Signals.

What reaches you from an exported game

Nothing visible happens to the player when this error fires, so nobody reports it. It is written to the engine log in debug and release exports alike. Bugnet’s Godot SDK does its automatic error capture by reading that log file, so with File Logging enabled (it is off by default on mobile exports) the line can arrive as a report with the platform, OS and game version. One limit is specific to this message: the report title is taken from the log line, and the line contains the emitter’s instance ID, which is different on every run. Reports stack by identical title, so the same bug can show up as several entries. Search the dashboard for the signal and method name to see them together.

Bugnet cannot tell you which of the causes above applies. Depending on the engine version and build type, the log line may carry only the C++ location and no script line, so the signal name and the callable in the message are what you search your project for. If a silent failure here would matter, for example a handler that must be detached before a save, check is_connected() yourself and send the unexpected branch with report_error(message, stack). Setup is in the SDK docs.

Frequently asked questions

What does Attempt to disconnect a nonexistent connection mean in Godot?

You called disconnect() for a signal and Callable that are not connected on that object at that moment. The connection was already removed, was never made, or was made with a different Callable or on a different instance.

Does this error crash the game?

No. Godot prints the error, skips the disconnect and continues running. It is still worth fixing, because it shows that a connection you believed was live is missing, which often means a handler is not being called.

How do I disconnect a lambda from a signal in Godot 4?

Store the lambda in a variable when you connect it and pass that same variable to disconnect(). Writing the lambda again creates a new Callable, and lambdas only match when they are the same value.

Do I need to disconnect signals before calling queue_free()?

Usually not. When a node is freed, Godot removes every connection from its signals and every connection to its methods. A manual disconnect is only needed when the node stays alive and should stop listening, such as a pooled object.

Does bind() stop disconnect() from finding the connection?

No. Godot 4 ignores bound arguments when it compares Callables for connect, disconnect and is_connected. A connection made with a bound method can be removed by passing the plain method.

Read the three quoted parts of the message: emitter, signal, callable. One of them is not what you connected, or the connection is already gone, and is_connected() on the line before tells you which.