IntersectMBO / plutus-apps

The Plutus application platform
Apache License 2.0
306 stars 214 forks source link

PAB does not report invalid node socket path #287

Closed bwbush closed 2 years ago

bwbush commented 2 years ago

Summary

The PAB silently fails to handle blockchain effects if it cannot connect to the node socket in its configuration.

Steps to reproduce the behavior

  1. Edit the configuration file for the PAB and set pscSocketPath to any path that does not exist.
  2. Start the PAB.

Actual Result

Observe that no error message is reported, but the PAB runs without a connection to the node, and hence never notifies clients of blockchain effects..

Expected Result

The PAB should fail because of this fatal misconfiguration and report that it could not connect to the node.

Describe the approach you would take to fix this

Add an error handler and logger to https://github.com/input-output-hk/plutus-apps/blob/ea1bfc6a49ee731c67ada3bfb326ee798001701a/plutus-pab/src/Plutus/PAB/Core/ContractInstance/BlockchainEnv.hs#L58.

System info

any

bwbush commented 2 years ago

@koslambrou, here is how we fixed this for Marlowe: e0a2922bcd6eba1f92ec9b440c3336e37b80ef7b. The underlying issue is that the chain index connects within forkIO so the thread silently dies.

koslambrou commented 2 years ago

The underlying issue is that the chain index connects within forkIO so the thread silently dies.

The chain index? You mean the PAB, no?