Ubuntu 16.04 server on AWS
Apologies if this is too broad.
I have a small pilot application running that depends on IPFS. I upload encrypted files to my node, and then later users can retrieve them using a public gateway. I few weeks ago I noticed that I was unable to retrieve files from the public gateway, as best as I could tell the files were being pinned on my node, but not propagating through the network. My node js app was still operational at this time, but the IPFS component was not connecting properly.
This problem seemed to resolve itself after several restarts, but I was never able to isolate the exact cause. Now, the same problem has raised its head - I am apparently able to save files, but not to access them via a public gateway.
Looking at my server, pm2 notes that there have been 40 (automatic) restarts in the past 17 days. The outage began at the earliest 3 days ago.
In the error logs (which are not timestamped!?!), I see the following repeatedly:
Error: multihash unknown function code: 0x0
Error: multihash unknown function code: 0x0 at Object.decode (/home/ubuntu/pilot/node_modules/multihashes/src/index.js:88:11) at Object.validate (/home/ubuntu/pilot/node_modules/multihashes/src/index.js:210:11) at Function.validateCID (/home/ubuntu/pilot/node_modules/cids/src/index.js:254:8) at new CID (/home/ubuntu/pilot/node_modules/cids/src/index.js:104:9) at decoded.wantlist.entries.forEach (/home/ubuntu/pilot/node_modules/ipfs-bitswap/src/typ$ at Array.forEach (<anonymous>) at Function.BitswapMessage.deserialize (/home/ubuntu/pilot/node_modules/ipfs-bitswap/src/$ at pull.asyncMap (/home/ubuntu/pilot/node_modules/ipfs-bitswap/src/network.js:70:43) at /home/ubuntu/pilot/node_modules/pull-stream/throughs/async-map.js:28:13 at callback (/home/ubuntu/pilot/node_modules/pull-pushable/index.js:83:5)
I am assuming these coincide with the server restarts - but i’m not certain.
I have since restarted the server, and now everything is working, but I would really like to understand this bug, and whether it is system / environment related, or due to a problem within one of the package dependencies. Any thoughts? I’m not sure where to begin with debugging my nodes behaviour and performance within the swarm.
As a side question: Public gateways - these are a fantastic gift to our community and ecosystem, but is it ‘polite’ to use them for production applications? And is there any way to build-in a fall back if a particular public gateway goes down, or is less than reliable?