umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.4k stars 2.66k forks source link

Images picked with media picker are null #15347

Open FrontisFrank opened 9 months ago

FrontisFrank commented 9 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

10.8.0

Bug summary

Recently we update the project from 10.7.0 to 10.8.0. Suddenly we notice images are not being displayed in the website while in the backoffice the image is correctly picked and present in the media library. The image is also available through its media link. I found out I can temporarily find the image in the website if I go to the media library and resave the existing image. But the issue is back as soon the website is released again.

Specifics

Our media library is structured using folder, the issue does not apply to images that are added to the media root folder or 1 sub folder:

Steps to reproduce

I did not test this with a clean install, but as mentioned before we just updated to version 10.8.0

Expected result / actual result

Actual result is that alot of the media used in the site is not displayed, we want all to be images displayed regardless of their position in the media folder tree

github-actions[bot] commented 9 months ago

Hi there @FrontisFrank!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

FrontisFrank commented 9 months ago

Update, in another Umbraco project we upgraded from version 10.7.0 to 10.8.0 we experienced the exact same issue. In this project we reverted the hotfix back to version 10.7.0 and the issue is gone. I believe the cause of this issue must be within version 10.8.0

yawkale commented 9 months ago

try rebuild database cache, it fixed the same issue for me

russellshome commented 9 months ago

I have also experienced this issue. Rebuild of database cache did not help. Most images are affected but not all images. In rich text editor an image will display as broken but click to select and click Image Picker and it will display in the dialog normally. When used in a property, the editor shows the image normally but the view acts as if the value is empty.

russellshome commented 9 months ago

Downgrading the site from 10.8.0 to 10.7.0 seems to be a successful workaround as a short term solution.

FrontisFrank commented 9 months ago

In another github issue for different versions of Umbraco I found a workaround, see issue #15195 I need to add the following to the appsettings.js

  "Umbraco": {
    "CMS": {
      "NuCache": {
        "UsePagedSqlQuery" : false
      },

Then as @yawkale mentions the database cache needs to be rebuild. When I take a look at the published status in Umbraco 1000+ MediaStore items are in cache which is good. image Before the workaround exactly 1000 items were in MediaStore after rebuilding database cache. So approx. 2000 MediaStore items were missing in our case.

@russellshome the hotfix was already released and the Umbraco db was in state of version 10.8.0, therefore downgrading would not be possible in this case.

russellshome commented 9 months ago

I tried "UsePagedSqlQuery" : false And rebuilt the database cache while in version 10.8.0 However, this did not fix the problem. I am certain that there is a problem - I had upgraded two sites to version 10.8.0, found the issue, tried the various changes listed above and then decided to downgrade to 10.7.0. I found no problem downgrading from 10.8.0 to 10.7.0

FrontisFrank commented 9 months ago

I don't know what type of hosting you are using (and I don't know if this has anything to do with it), but we are hosting the website in Azure. Anyhow I think this problem needs a proper fix, especially because this problem is already fixed in other Umbraco versions (v12...)? Again, see github issue #15195

elit0451 commented 9 months ago

Thank you all, we will port back the fix to 10.8 as well 💪

NikRimington commented 9 months ago

@elit0451 is there an eta for a v10 release to address this? Or is there a nightly build that contains it that we can use? We have a large site being hit by this issue after upgrading to 10.8 to fix another issue so rolling back isn't really an option.

@russellshome how did you downgrade as this isn't typically supported?

elit0451 commented 9 months ago

Hi @NikRimington - already on Tuesday next week (12.12)

NikRimington commented 9 months ago

That's great, I don't suppose there is a nightly for this that we can test with I can't see one on the nightly feed?

elit0451 commented 9 months ago

No, until the fix is released, we recommend using the following workaround (mentioned in https://github.com/umbraco/Umbraco-CMS/issues/15195) :

There is a simple workaround for now by disabling cache, but it took me almost five hours to figure out what was the problem when some of my images stopped loading.

"Umbraco": {
"CMS": {
"NuCache": {
"UsePagedSqlQuery" : false
},
jdicker-dc commented 9 months ago

We too had this issue. Resaving an image did bring it back until the Memory Cache was rebuild.

The eventual solution for us was indeed the suggested workaround by settings the UsePagedSqlQuery to false. After that manually deleting the cache and restarting the environments all images were indeed back.

russellshome commented 9 months ago

@russellshome how did you downgrade as this isn't typically supported?

NuGet Package Manager - Updates - Choose Umbraco.Cms - Choose 10.7.0 from the list - Update There doesn't seem to be any issues downgrading from 10.8.0 to 10.7.0

===========

Just to confuse matters, when I tested the same sites this morning that were having issues last week I found that there is now no evidence of a problem in either site after upgrading to 10.8.0.

I tested a third site and that has no issues after upgrading to 10.8.0