[SOLVED] Cannot upload to lower level folders

Nextcloud version: 15
Operating system and version: Ubuntu 18.04
Apache or nginx version:. Apache 2.4.29
PHP version: 7.1

The issue you are facing:

Unable to upload files to lower level folders.

For example:

I can upload to /var/www/nextcloud/data/(user)/files/Games/

But not
/var/www/nextcloud/data/(user)/files/Games/Data

What’s strange is that I can move uploaded files from …/Games to …/Games/Data, but cannot upload to the data folder directly.

I have tried setting permissions to the entire directory structure to 777, but no luck.

Any suggestions on how to resolve?

Just an update.

I am able to upload through WebDav, but not the NC Client or directly with a browser.

I figured it out. Seems like MySQL stores file permissions and for whatever reason the permissions did not save properly for that sub folder.

I ran
sudo -u www-data php occ files:scan (user) -v

And things seem to be working as expected now.