ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

ipfs-client grpc connection no longer works #4155

Closed SaulMoonves closed 2 years ago

SaulMoonves commented 2 years ago

https://github.com/improbable-eng/grpc-web/issues/1109

dependency of ipfs-client grpc has a bug that renders it inoperable. there's a pull request that's supposed to fix the bug but

  1. the project appears to be abandoned
  2. the supplied fix does not fix the problem

I tried applying the fix, and then spent most of a day trying to make it work and finally gave up.

node:internal/process/esm_loader:91
    internalBinding('errors').triggerUncaughtException(
                              ^

Error: Response closed without headers
    at file:///home/user/vcs/int/ipsn/node_modules/ipfs-grpc-client/src/utils/bidi-to-duplex.js:48:21
    at /home/user/vcs/grpc-web/client/grpc-web/dist/grpc-web-client.js:769:17
    at Array.forEach (<anonymous>)
    at GrpcClient.__webpack_modules__.934.GrpcClient.rawOnError (/home/user/vcs/grpc-web/client/grpc-web/dist/grpc-web-client.js:765:29)
    at GrpcClient.__webpack_modules__.934.GrpcClient.onTransportEnd (/home/user/vcs/grpc-web/client/grpc-web/dist/grpc-web-client.js:688:22)
    at WebSocket.ws.onclose (file:///home/user/vcs/int/ipsn/node_modules/ipfs-grpc-client/src/grpc/transport.node.js:106:17)
    at WebSocket.onClose (/home/user/vcs/int/ipsn/node_modules/ws/lib/event-target.js:210:18)
    at WebSocket.emit (node:events:527:28)
    at WebSocket.emitClose (/home/user/vcs/int/ipsn/node_modules/ws/lib/websocket.js:248:12)
    at Object.onceWrapper (node:events:642:26) {
  status: 

tried it on two different go-ipfs servers running go-ipfs version: 0.13.0

client is Node.js v17.9.0 on ubuntu 20.04 linux

The actual issue i was trying to solve was js-ipfs not responding to pubsub messages, figured i would try the websocket provider and ran into this.

achingbrain commented 2 years ago

Are you trying to use the grpc client to connect to go-ipfs? If so it’s not going to work because go-ipfs only has an http RRC api, not grpc.

SaulMoonves commented 2 years ago

Alright, I will close this, sorry.