Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Uncaught ERR_SOCKET_DGRAM_NOT_RUNNING when leaving network in joinNetwork callback #246

@jaller94

Description

@jaller94

I am reporting:

  • a bug or unexpected behaviour

Bug Report

Please give us details about your installation to assist you. Run dat -v to see the version of Dat you are using.

  • Operating system: Manjaro Linux
  • Node Version: v12.9.1
  • dat-node Version: 3.5.15

Expected behavior

All errors are catchable

Actual behavior

The following code sometimes crashes on me.

const folderPath='./archives/0';
const folderPath='./test-keys';
Dat(folderPath, {secretDir: path.join(rootFolder, 'secret_keys')}, function (err, dat) {
  if (err) reject(err);
  dat.importFiles();
  // It did not crash without this.    
  const network = dat.joinNetwork(() => {
    dat.leaveNetwork();
    console.log(`Leaving ${folderPath}`);
  });
});

Sometimes it just crashes. Note that I am opening 163 archives at the same time, waiting for them to finish their initial sync.

dgram.js:831
    throw new ERR_SOCKET_DGRAM_NOT_RUNNING();
    ^

Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
    at healthCheck (dgram.js:831:11)
    at Socket.send (dgram.js:609:3)
    at RPC.send (/home/jaller94/Git/fdroid2dat/node_modules/k-rpc-socket/index.js:144:15)
    at RPC.query (/home/jaller94/Git/fdroid2dat/node_modules/k-rpc-socket/index.js:189:8)
    at RPC.query (/home/jaller94/Git/fdroid2dat/node_modules/k-rpc/index.js:146:17)
    at DHT._sendPing (/home/jaller94/Git/fdroid2dat/node_modules/bittorrent-dht/client.js:213:13)
    at test (/home/jaller94/Git/fdroid2dat/node_modules/bittorrent-dht/client.js:168:10)
    at DHT._checkNodes (/home/jaller94/Git/fdroid2dat/node_modules/bittorrent-dht/client.js:186:3)
    at DHT._checkAndRemoveNodes (/home/jaller94/Git/fdroid2dat/node_modules/bittorrent-dht/client.js:152:8)
    at KBucket.<anonymous> (/home/jaller94/Git/fdroid2dat/node_modules/bittorrent-dht/client.js:58:10)

The traceback doesn't look like dat-node is at fault, but I have to start somewhere on my journey to track down the issue. Maybe someone here knows more?

Debug Logs

Output is not any different when running it with DEBUG=dat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions