Large Media Storage

Hi,
I have a problem with Large Media. Im trying to use it on netlify cms and Hugo.
All configuration is created by following netlify cms and netlify documentation. When I upload files manually to git, by pushing files, my images are uploaded, and I can see them in LM tab in the netlify dashboard. The problem is, I can’t see them in netlify cms. There is only blob files in the media view, and all uploads created from cms are sended directly to github repository as regular files.
When I’m trying to use some photo in my Hugo page, there is a problem during build I think, because all addresses to photos will change to something like this: https://d33wubrfki0l68.cloudfront.net/43ad412b49b4dfd7deab10b1a8d30001a45d7c83/ea1e3/images/mateusz.jpg

my netlify cms config:

    backend:
      name: git-gateway
      branch: master # Branch to update (optional; defaults to master)
      media_folder: static/images
      public_folder: /images

my Hugo config:

    baseURL = "https://mateuszcholewka.pl/"
    theme = "hugo_theme_pickles"
    DefaultContentLanguage = "pl"
    languageCode = "pl-pl"
    Title = "Mateusz Cholewka"
    copyright = "© Copyright 2020"

Hi @mtk3d, welcome to the community :slight_smile:
The way the CMS works with Large Media is by trying to read the .lfsconfig and .gitattributes files from the repo, and using the content/existence of those files to detect large media.
Can you share your browser network traffic while loading the CMS (do a full refresh please)?
Specifically, you should see requests go out to these files.
Thanks!

Hi @erez
Thanks for fast answer :smiley:
Here is a screenshot of networks tab from CMS:


Above that, there is only an admin/ request.
I can’t see any requests for those files. My CMS version is 2.9.1

Be aware that Netlify Large Media is not compatible with Netlify’s built-in asset optimization: Large Media requirements and limitations | Netlify Docs

1 Like

Thanks, that is my first problem solution

Thanks for sharing it :slight_smile: In that case the CMS should send a request to retrieve the media folder static/images content. Can see see that one (with the response)?
I think I was mistaken before and you actually need to open the media folder to see the requests for .lfsconfig and .gitattributes.

Here is the images request I think, with the response:


When I will select the Media tab, there is nothing there, no requests.

And this may be helpful

Thanks, I think we’re getting somewhere. Can you verify your CMS version as shown in the browser console logs?
The requests for .gitattributes and .lfsconfig should be the ones starting with 74f1 and f496 (the sha for those files in GitHub).
Does the responses for those make sense?

Here is the console output:

netlify-cms-app 2.12.10
netlify-cms-core 2.25.0
netlify-cms 2.10.46

Yes those requests are correct, decoded content is valid, but still when I’m trying to upload images, they are saved directly in github repository, I can’t see them in Large Media in Netlify.

Example output of those requests:

{
  "sha": "74f1c6a3280643db9dad39952ca59c139239d43b",
  "node_id": "MDQ6QmxvYjI1NjY1MTk3Mjo3NGYxYzZhMzI4MDY0M2RiOWRhZDM5OTUyY2E1OWMxMzkyMzlkNDNi",
  "size": 53,
  "url": "https://api.github.com/repos/mtk3d/mateuszcholewka/git/blobs/74f1c6a3280643db9dad39952ca59c139239d43b",
  "content": "c3RhdGljL2ltYWdlcy8qKiBmaWx0ZXI9bGZzIGRpZmY9bGZzIG1lcmdlPWxm\ncyAtdGV4dAo=\n",
  "encoding": "base64"
}

Decoded files:

[lfs]
	url = https://3196762b-a721-4c1e-8210-803944d84ac5.netlify.app/.netlify/large-media
static/images/** filter=lfs diff=lfs merge=lfs -text

That’s very odd.
I’ve just tested on an example repo I have with similar configuration and the files shows up in GitHub correctly:
https://github.com/erezrokah/netlify-cms-large-media/commit/e206c8153ff537f3d6069be71497954ebb02cebf
I have the same versions as you.
Can you share the requests when uploading a new image? Are there any console logs/errors? Are current images (uploaded with LFS) display correctly or broken? Are there no requests to .netlify/large-media paths at all?
Sorry for all the questions (and also if I’m asking something you’ve already mentioned) - I’m trying to be as clear as possible.

Also, can you post the full config.yml? Going to https://mateuszcholewka.pl/admin fails to load it.

The config file is here https://mateuszcholewka.pl/admin/config.yml. I had problems too with a load it, but then I added slash at the end of address: Content Manager, and all works fine then.

Current images sent with LFS by regular git commit are displayed correctly.
There are no any others .netlify/large-media requests

Here are all requests sended during image upload:

Only error logs that I have is favicon.ico 404 error

I’m puzzled by this as if the CMS doesn’t detect large media it shouldn’t be able to show the current files. For large media it should read the pointer file then send a request to the large media service. Can you try deleting the browser cache just to be sure? If it’s displaying large media files there must be some requests to the large media service.

How are the existing files shown in GitHub? Similar to this?
image

Sorry, my mistake. You asked about displaying those photos in CMS, and I was talking about photos on the page. In CMS I can’t see those files correctly, here is the request for photos which are uploaded to Large Media by manual commit:


I’m trying to run those things in incognito mode too, but get the same result, so cache is not a problem I think.

Thanks for your patience, I think I tracked down the issue and this is a bug introduced by the recent change from netlify.com to netlify.app.
The CMS checks for LFS using this code:
netlify-cms/implementation.ts at b151bdfd7311472eaa1861e9fc17546a3658a083 · netlify/netlify-cms · GitHub which only matches netlify.com.
I’ll submit a fix in the CMS repo soon.

1 Like

I changed address to .com, and all works fine now. Thank you very much for help.

1 Like

Linking the fix fix(large-media): match netlify.app as lfs host by erezrokah · Pull Request #3642 · netlify/netlify-cms · GitHub.
Thanks again for your patience!

Update - this should be fixed with the latest version (netlify-cms@2.10.47 )