It seems that 4.0.0 may need a new directory created that doesn't yet exist and since it's in app/code it's not able to create it either.
The /app/code/tmp is already symlinked to /run/matomo/tmp. I checked a new install and it had this directory created (by matomo). Also, our cloudron.io, matomo instance updated fine as well. I also deleted tracker directory and restarted the app. Matomo creates that directory again.
Do you have the logs before this error message? Would be good to know where in the start up script it fails.
Somehow fixed by running the reset link in the plugin Settings > Support. No idea what setting was wrong but happy to confirm not a Cloudron issue. Sorry for the bother, was just eliminating possibilities.
@girish A fresh install already has it set to "No"? Interesting, I don't recall ever setting mine to "Yes", but I guess I did. Thank you for confirming, seems it's okay then if it's set to "No" by default and the cronjob is doing it automatically.