Unable to auto attach to an already-running Kubo daemon

Aperta
#3,218 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
backend, desktop

Direzione di ricerca

Start by tracing checkIfAddrIsDaemon() and the Daemon.start() handshake described in the issue, then inspect the ipfs-http-client id() and multiaddr stack entries in combined.log. Reproduce with an external Kubo daemon using custom ports and AutoTLS; done means IPFS Desktop identifies the existing daemon, handles its addresses, avoids spawning another process, and opens WebUI with the correct API port.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/bug need/triage
  • OS: Linux (Arch Linux x86_64, Kernel 7.2 / Flatpak / native)
  • Version of IPFS Desktop: 0.50.0 / 0.50.1

Describe the bug
When a local Kubo daemon is already running, IPFS Desktop should detect and attach to it seamlessly. Currently, this fails due to two sequential issues:

  1. Gateway probe false positive (PR #3217): checkIfAddrIsDaemon() sends an RPC POST /api/v0/refs... to the gateway port (which returns 404), triggering a false "Ports are busy" prompt instead of recognizing the node.
  2. Crash on modern multiaddrs (PR #3034): During handshake (id()), legacy [email protected] fails on modern Kubo addresses (e.g. /tls/, /quic-v1/ from AutoTLS) with Error: no protocol with name: tls, aborting startup and leaving WebUI failing at 127.0.0.1:5001.

To Reproduce
Steps to reproduce the behavior:

  1. Start an external Kubo daemon (v0.33+ / 0.43+) on custom ports (e.g. API 5003, Gateway 8084) with "AutoTLS": { "Enabled": true }.
  2. Point IPFS Desktop to this repository (via IPFS_PATH or ~/.ipfs).
  3. Launch IPFS Desktop.
  4. Observe the "Ports are busy" modal dialog:

    "The ports 5003 and 8084 are not available. Do you want to use 5004 and 8085 instead?"

  5. With PR #3217 applied, observe combined.log:
    error: [ipfsd] start daemon Error: no protocol with name: tls
  6. Notice WebUI opens but fails to connect, falling back to http://127.0.0.1:5001.

Expected behavior

  • IPFS Desktop recognizes the ports belong to a running daemon ([daemon] ports busy by a daemon).
  • It attaches to the existing daemon without spawning a duplicate process or prompting to change ports.
  • It parses node addresses without crashing on modern protocols.
  • WebUI automatically launches with ?api=/ip4/127.0.0.1/tcp/<API_PORT>.

Additional context
Stack trace from combined.log:

error: [ipfsd] start daemon Error: no protocol with name: tls
    at Protocols (.../node_modules/multiaddr/src/protocols-table.js:22:11)
    at stringToStringTuples (.../node_modules/multiaddr/src/codec.js:48:19)
    at stringToBytes (.../node_modules/multiaddr/src/codec.js:220:13)
    at Object.fromString (.../node_modules/multiaddr/src/codec.js:231:10)
    at new Multiaddr (.../node_modules/multiaddr/src/index.js:56:26)
    at .../node_modules/ipfs-http-client/cjs/src/id.js:23:53
    at Array.map (<anonymous>)
    at Object.id (.../node_modules/ipfs-http-client/cjs/src/id.js:23:43)
    at async Daemon.start (.../node_modules/ipfsd-ctl/src/ipfsd-daemon.js:268:16)
Lingua principale
JavaScript
Stelle
6.6k
Fork
908
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ipfs/ipfs-desktop

Tutte le issue di ipfs/ipfs-desktop

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.