cofoundry icon indicating copy to clipboard operation
cofoundry copied to clipboard

Auto-update locked

Open JornWildt opened this issue 1 year ago • 2 comments

Every now and then, during development, the website fails to start - and the console only states:

info: Cofoundry.Web.AutoUpdateHostedService[0]
      Process failed, retrying in 5 seconds

No further info is given. It took me a while to guess that the singular entry in AutoUpdateLock table, column "IsLocked" should be changed manually from False to True. No exact idea why, but it fixes the problem.

Apparently it is one of the failure modes of auto update that doesn't get a useful error message attached. It would be nice if the error message stated something like "Seems like the previous auto update failed and got stuck in a unhealthy state. Try XXX to restart the process".

I don't know how it happens - but it is most likely a result of a quick rebuild from VS2022 while the auto update is running?

JornWildt avatar Mar 18 '23 20:03 JornWildt

Some more info in #525.

Perhaps it is due to a quick rebuild, I'm not sure if the new hot reload compilation feature would mess with it either? The issue does seem to be limited to dev and I only see it when I force shut down while debugging the auto-update process. I can't imagine many people do that, but people do occasionally log an issue for it.

I don't think there's not much to be done to work around that without risking multiple update processes running concurrently. Perhaps in development mode we can be more tolerant or show a button to unlock the process.

HeyJoel avatar Mar 20 '23 19:03 HeyJoel

I assume it happens because I compile-and-run from VS2022 while it is auto-updating, which restarts the website in the middle of the auto update, leaving it in the invalid state - or if I kill the process somehow else. Not much to do about that.

But you could add to the error message "This may happen during development, blah blah. If the problem does not go away - and you are sure there are no other website processes running - then try to XXXX"

JornWildt avatar Mar 20 '23 20:03 JornWildt