Column 'checked_out' cannot be null

After upgrading from Joomla 3.* to Joomla 4.* you can have this error in various places:

Column 'checked_out' cannot be null

This can be seen when you try to save a new article, a new product in your shopping cart, at user registration during checkout in Virtuemart - virtually anywhere when in background a new entry in the database is created in a table which have the 'checked_out' field.

The geeky fix is simple. You need to identify the database table in question, and see the 'checked_out' field's properties.

You probably will find this:

The column have Allow NULL=No and Default=Zero - as was the normal setup up to J3.10.11. But in J4 and up the field should have  Allow NULL=yes and Default=NULL - the values found in a clean new Joomla install.

Be aware that if you don't know enough Joomla/database stuff, you can easily break your site - the above trick qualifies as a core hack.

Fortunately in lot of cases the issue can be fixed i less geeky way too. Go to System>Database in backend, and check if ALL database structures are up to date. If not, use the tools found there to apply the fixes. In most cases this alone will fix the issue. Generally, applying the available updates to your installed components/modules/plugins potentially can get rid of the problem. But some components (as I write this, for example VirtueMart) aren't prepared to fix the issue by themselves. In those cases you should go for the geeky solution above. Do backups, keep your fingers crossed, avoid to cross paths with black cats, and jump on it!

As always, remember - this tip is comes with absolutely no guarantees! You should perform the stunt on your own. Stay cool, generally works without problems ;)