Problem with WordPress file permissions

Hello gentlemen, ever since we moved our site to digital ocean we have issues with our site media library. We are using a premade image, running ubuntu on cyberportal with openlitespeed on it.

Our root www folder is /home/sitename/public_html/ and everything inside that is set to be under www-data ownership (we tried different options as well). While the whole dir is owned by www-data our media library can’t be updated and wordpress triggers the error (can’t move file to the folder, etc).

Even worse, site library can access all of the existing media (the ones that we moved manually) and display them properly, but all of the newly updated/crated posts and media won’t show properly. It looks like while posting something the media/file is saved but then it gets removed from a featured image (for example) and its thumbnail is broken. We can access the image through a direct link.

I tried everything I could find, from scripts to fix the permissions, through cyberpanel fix permissions and ssh but everything failed. Does anyone have any clue what this could be? Again, only images uploaded now are broken, not the ones that are there already.

Please advice

Just to add on top of that, I’ve tried spinning up a brand new instance of droplet with the only cyberpanel on it, installed the WP and facing the exact same issues.

Thanks @neweracloud, I tried that but no luck.