AlistGo/alist · warning

failed get status, wrong gid: %s

Error message

failed get status, wrong gid: %s

What it means

Transmission.Status() parses the numeric GID and calls TorrentGetAllFor; transmission returns an empty result set (not an error) when no torrent with that id exists. The tool then reports 'wrong gid', meaning the torrent was deleted from the daemon or the id never belonged to this daemon.

Source

Thrown at internal/offline_download/transmission/client.go:144

	err = t.client.TorrentRemove(context.TODO(), transmissionrpc.TorrentRemovePayload{
		IDs:             []int64{gid},
		DeleteLocalData: false,
	})
	return err
}

func (t *Transmission) Status(task *tool.DownloadTask) (*tool.Status, error) {
	gid, err := strconv.ParseInt(task.GID, 10, 64)
	if err != nil {
		return nil, err
	}
	infos, err := t.client.TorrentGetAllFor(context.TODO(), []int64{gid})
	if err != nil {
		return nil, err
	}

	if len(infos) < 1 {
		return nil, fmt.Errorf("failed get status, wrong gid: %s", task.GID)
	}
	info := infos[0]

	s := &tool.Status{
		Completed: *info.IsFinished,
		Err:       err,
	}
	s.Progress = *info.PercentDone * 100
	s.TotalBytes = int64(*info.SizeWhenDone / 8)

	switch *info.Status {
	case transmissionrpc.TorrentStatusCheckWait,
		transmissionrpc.TorrentStatusDownloadWait,
		transmissionrpc.TorrentStatusCheck,
		transmissionrpc.TorrentStatusDownload,
		transmissionrpc.TorrentStatusIsolated:
		s.Status = "[transmission] " + info.Status.String()
	case transmissionrpc.TorrentStatusSeedWait,

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Treat this as terminal: delete the local task record, the remote torrent is gone
  2. Re-add the torrent/magnet to create a fresh task with a new GID
  3. After changing the transmission endpoint, clear stale offline task records

Example fix

// before
infos, _ := t.client.TorrentGetAllFor(ctx, []int64{gid})
if len(infos) < 1 { return nil, fmt.Errorf("failed get status, wrong gid: %s", task.GID) }

// caller: terminal handling
if err != nil && strings.Contains(err.Error(), "wrong gid") {
    _ = deleteLocalTask(task.ID)
}
Defensive patterns

Strategy: try-catch

Validate before calling

infos, err := t.client.TorrentGetAllFor(context.TODO(), []int64{gid})
if err != nil {
    return nil, err
}
if len(infos) < 1 {
    // torrent gone from daemon: terminal, no point retrying
    markTerminalAndCleanup(task)
    return nil, nil
}

Try / catch

s, err := t.Status(task)
if err != nil && strings.Contains(err.Error(), "wrong gid") {
    // remote torrent deleted: remove local record, do not retry
    deleteLocalTask(task.ID)
    return nil
}

Prevention

When it happens

Trigger: Polling a task after the torrent was removed in transmission's UI or by another client; daemon restarted with its torrent list lost; task GID from a different transmission instance (endpoint changed in settings).

Common situations: Users cleaning transmission's list while OpenList still tracks the task; transmission data dir wiped or moved; configuration pointing the tool at a new daemon with old task records.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/33358b477b068a20. Report an issue: GitHub.