The replica returned Http Error - status 500 Internal Server Error

The replica returned an HTTP Error: Http Error: status 500 Internal Server Error, content type "text/plain; charset=utf-8", content: Broken pipe (os error 32)

This error occurs because the Wasm module you’re trying to install is too large. Previously the http handler would return a better error message from the replica (one about ingress message size exceeding the limit.)
It’s not present in dfinity/ic but the ledger and other nns canisters are optimized. You can find a similar optimization script in the cycles wallet here: cycles-wallet/build.sh at main · dfinity/cycles-wallet · GitHub

The replica returned an HTTP Error: Http Error: status 500 Internal Server Error, content type "text/plain; charset=utf-8", content: Protocol wrong type for socket os error 41

I’m not sure about this one however; how consistently do you see this?