<p>Ok, so I have figured out why this wasn't working. 
When clicking on reset asset indexes It was always popping up an alert saying that another asset was missing. I already knew this, and it was something I intended on dealing with later. So I clicked OK and as the progress indicator continued to run along with the Tick Icon, I assumed it continued to update everything else, skipping over the error.
But it turns out this isn't the case. The function halts at the error. So once I fixed this other missing asset, everything worked.
It is a little misleading having the progress animation and tick icon still work when in fact nothing is happening.
thanks for all your help. :)</p>

CC BY-SA 3.0
2018-04-05T09:38:14.643Z
Thanks great find, ridiculous issue, terrible error reporting
joep
CC BY-SA 3.0
2017-10-02T09:16:25.920Z
2017-10-02T09:16:25.920Z
ToddPadwick
<p>I have an asset directory which is set to</p>

<pre><code>{basePath}assets/images/products/
</code></pre>

<p>I know my basePath is right as it works on other asset sources.</p>

<p>My entry upload location for products is set to:</p>

<pre><code>{slug}/static/studio
</code></pre>

<p>However I get the following error when uploading assets:</p>

<pre><code>upload failed. error uploading the file: The folder "/var/www/html/assets/images/products/carambola-earrings/static/studio/" does not exist
</code></pre>

<p>I have tried 'updating asset indexes'. But no luck. I have also double checked that the assets/images/products/ directory exists.</p>

<p>I am also checked the permissions are set to '775' for '/var/www/html'</p>

<p>Any help greatly appreciated :)</p>

CC BY-SA 3.0
2017-09-29T18:10:26.103Z
Is the Asset field you're setting the `{slug}/static/studio` upload location inside of a Matrix field or stand-alone?
Brad Bell
CC BY-SA 3.0
2017-09-29T18:11:42.887Z
Also, who is the user:group owner of `/var/www/html/assets` and what user:group is your web server running as?
Brad Bell
CC BY-SA 3.0
2017-09-30T10:25:53.243Z
The asset field is not in a matrix.. its just a regular entry field in the product. 
The server is running as root. here is the folder permissions:
    `drwxrwxr-x 2 root     root       4096 Sep 29 08:31 products`

my assets folder is set to

    `drwxrwxr-x 9 www-data www-data 4096 Sep 20 10:31 assets`
ToddPadwick
CC BY-SA 3.0
2017-10-01T22:41:16.423Z
Any reason your web server isn't running as www-data:www-data? That'll probably solve your issue so you don't have to open up permissions to 777.
Brad Bell
CC BY-SA 3.0
2017-10-02T08:02:41.077Z
I have now tried changing all to www-data:www-data by using the following command. 
`sudo chown www-data:www-data -R html`
still no luck though unfortunately.
ToddPadwick
<assets><slug>
Dynamic Subfolder Paths - folder does not exist even after updating asset directories in settings
# Dynamic Subfolder Paths - folder does not exist even after updating asset directories in settings

(Asked by: username_0 on 2017-09-28)

I have an asset directory which is set to
{basePath}assets/images/products/

I know my basePath is right as it works on other asset sources.
My entry upload location for products is set to:
{slug}/static/studio

However I get the following error when uploading assets:
upload failed. error uploading the file: The folder "/var/www/html/assets/images/products/carambola-earrings/static/studio/" does not exist

I have tried 'updating asset indexes'. But no luck. I have also double checked that the assets/images/products/ directory exists.
I am also checked the permissions are set to '775' for '/var/www/html'
Any help greatly appreciated :)

**Tags:** assets, slug
> **Comments:**
> **username_1**: Is the Asset field you're setting the `{slug}/static/studio` upload location inside of a Matrix field or stand-alone?  
> **username_1**: Also, who is the user:group owner of `/var/www/html/assets` and what user:group is your web server running as?  
> **username_0**: The asset field is not in a matrix.. its just a regular entry field in the product.  The server is running as root. here is the folder permissions:     `drwxrwxr-x 2 root     root       4096 Sep 29 08:31 products`  my assets folder is set to      `drwxrwxr-x 9 www-data www-data 4096 Sep 20 10:31 assets`  
> **username_1**: Any reason your web server isn't running as www-data:www-data? That'll probably solve your issue so you don't have to open up permissions to 777.  
> **username_0**: I have now tried changing all to www-data:www-data by using the following command.  `sudo chown www-data:www-data -R html` still no luck though unfortunately.  

---

## 1 answers

### Answer by username_0 on 2017-10-02. Score: 2 | Accepted answer

Ok, so I have figured out why this wasn't working.
When clicking on reset asset indexes It was always popping up an alert saying that another asset was missing. I already knew this, and it was something I intended on dealing with later. So I clicked OK and as the progress indicator continued to run along with the Tick Icon, I assumed it continued to update everything else, skipping over the error.
But it turns out this isn't the case. The function halts at the error. So once I fixed this other missing asset, everything worked.
It is a little misleading having the progress animation and tick icon still work when in fact nothing is happening.
thanks for all your help. :)

> **Comments:**
> **username_2**: Thanks great find, ridiculous issue, terrible error reporting  

---

