Answers.Body: <p>I got an emailed response from Andris from P&amp;T: </p>
  
  <blockquote>
    <p>That indicates that at some point Craft was unable to index a file,
    leaving some corrupt data. If you look at craft_assetfiles table,
    you'll notice that at least one entry has the dateModified column set
    to null. Removing those should fix the issue for you. Probably the
    best way to remove them would be to actually delete the records from
    the craft_elements table, that have the matching IDs. The cascading
    delete should remove all related records.</p>
    
    <p>Please do make backups before tampering with the database, though!</p>
  </blockquote>
  
  <p>Deleting the records fixed the issues. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-13T07:53:37.300Z
Answers.LastActivityDate: 2018-06-13T07:53:37.300Z
Answers.UserDisplayName: Florian
Answers.Body: <p>I actually also just came across this issue, just wanted to add that in my case the culprit was folder ownership within the <code>storage/runtime/compiled_templates/</code> folder. It was part of a new deploy, and ran into several issues with permissions. Setting the correct owner fixed the issue.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-11T18:11:13.607Z
Answers.LastActivityDate: 2019-10-11T18:11:13.607Z
Answers.UserDisplayName: KSP
Body: <p>I have a number of assets resources all set to upload to the same amazon s3 bucket. Two of my four assets resources show "An unknown error occurred" twice when I view them in <code>/admin/assets</code>. </p>
  
  <p><a href="https://i.sstatic.net/PrBWz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PrBWz.png" alt="an unknown error occurred"></a></p>
  
  <p>The files in the folder do not show up. In the logs the following error appears: </p>
  
  <p><code>Error: Call to a member function format() on null in /apps/cms/craft/app/helpers/AssetsHelper.php:81</code></p>
  
  <p>When I click Upload files I can upload files, but they do not show up once the upload has finished (no files are shown). They do get uploaded to s3 though. The message "an unknown error occurred" appears again. </p>
  
  <p>Subfolders in that same folder show up perfectly and have all of their content visible and it is possible to upload new images without a hitch.</p>
  
  <p>How can I get the top level folders to work again? What could cause this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-07T19:12:56.317Z
Comments.Text: Maybe the path is incorrect? Have you rebuilt the search index and asset index?
Comments.UserDisplayName: Clark Nelson
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-08T07:00:57.903Z
Comments.Text: asset index yes, search index no. Path seems to be correct, subfolders are working and two other asset sources with similar settings are working fine.
Comments.UserDisplayName: Florian
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-08T07:09:21.787Z
Comments.Text: Updating the search index didn't solve the issue.
Comments.UserDisplayName: Florian
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-09T08:32:49.140Z
Comments.Text: For whatever reason your dateModified property is null instead of a valid DateTime. You could temporarily change the code and see if the error disappears or contact pixel and tonic about it since it's likely a bug
Comments.UserDisplayName: Robin Schambach
Tags: <assets><s3><filesystem>
Title: "An unknown error occurred" in assets screen
ThreadText: # "An unknown error occurred" in assets screen
  
  (Asked by: username_0 on 2018-06-07)
  
  I have a number of assets resources all set to upload to the same amazon s3 bucket. Two of my four assets resources show "An unknown error occurred" twice when I view them in `/admin/assets`.
  
  [![an unknown error occurred](https://i.sstatic.net/PrBWz.png)](https://i.sstatic.net/PrBWz.png)
  
  The files in the folder do not show up. In the logs the following error appears:
  
  `Error: Call to a member function format() on null in /apps/cms/craft/app/helpers/AssetsHelper.php:81`
  
  When I click Upload files I can upload files, but they do not show up once the upload has finished (no files are shown). They do get uploaded to s3 though. The message "an unknown error occurred" appears again.
  
  Subfolders in that same folder show up perfectly and have all of their content visible and it is possible to upload new images without a hitch.
  
  How can I get the top level folders to work again? What could cause this?
  
  **Tags:** assets, s3, filesystem
  
  > **Comments:**
  > **username_1**: Maybe the path is incorrect? Have you rebuilt the search index and asset index?  
  > **username_0**: asset index yes, search index no. Path seems to be correct, subfolders are working and two other asset sources with similar settings are working fine.  
  > **username_0**: Updating the search index didn't solve the issue.  
  > **username_2**: For whatever reason your dateModified property is null instead of a valid DateTime. You could temporarily change the code and see if the error disappears or contact pixel and tonic about it since it's likely a bug  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-06-13. Score: 2 | Accepted answer
  
  I got an emailed response from Andris from P&T:
  
  > That indicates that at some point Craft was unable to index a file,
  > leaving some corrupt data. If you look at craft\_assetfiles table,
  > you'll notice that at least one entry has the dateModified column set
  > to null. Removing those should fix the issue for you. Probably the
  > best way to remove them would be to actually delete the records from
  > the craft\_elements table, that have the matching IDs. The cascading
  > delete should remove all related records.
  >
  > Please do make backups before tampering with the database, though!
  
  Deleting the records fixed the issues.
  
  
  ---
  
  ### Answer by username_3 on 2019-10-11. Score: 1
  
  I actually also just came across this issue, just wanted to add that in my case the culprit was folder ownership within the `storage/runtime/compiled_templates/` folder. It was part of a new deploy, and ran into several issues with permissions. Setting the correct owner fixed the issue.
  
  
  ---
  
  