Dev/build error on Amazon Lightsail

Silverstripe Version: 4.2

Question:

I’ve just uploaded a new site to Amazon Lightsail. Whenever I go to run a dev/build it comes back with an error:

# [Warning] chmod(): Operation not permitted
### GET /dev/build?flush=1&flushtoken=21224ce3ab5f801e4e55e342db5b3ca4
Line  **357**  in  **/opt/bitnami/apache2/htdocs/vendor/league/flysystem/src/Adapter/Local.php**

followed by the same error repeated again.
If I scroll down the page the dev/build still seems to work, although the table names keep ending up as lower case.

May be several issues going on here. It’s the first time I’ve used Lightsail, and it looks like a good hosting platform, if I can sort these issues out.

The ‘operation not permitted’ warning is usually down to ownership or permissions. Does the user running the web server process have ownership of the files in question?

As far as I can tell the user should be ‘bitnami’, and I have set permissions on the assets folder to 777

Found the answer for anyone else running into this issue:
User should be ‘daemon’
Run the following command in the CLI
sudo chown -R daemon:daemon /opt/bitnami/apache2/htdocs/public/assets