MediaLibrary 404

Brandon Prudent asked on August 10, 2018 01:07

We have a MVC setup, and in the administrative interface the following links work:

http://kadmin/getmedia/a3d3c10c-d7f8-43ab-a76f-96d6da7b4fbb/baker.aspx http://kadmin/Sologic/media/M/baker.jpg

However, the presentation site URLs behave differently:

http://sologic/getmedia/a3d3c10c-d7f8-43ab-a76f-96d6da7b4fbb/baker.aspx (** returns a generic 404 error with no content **)

http://sologic/Sologic/media/M/baker.jpg (** returns our custom 404 page **)

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">

is in the Web.config, and Files Friendly URL extension is set to ".aspx". Excluded URLs is blank.

        var ml = MediaLibraryInfoProvider.GetMediaLibraries().First();
        var files = MediaFileInfoProvider.GetMediaFiles();
        var target = files.First();
        var bin = MediaFileInfoProvider.GetFile(target, ml.LibraryFolder, "Sologic");

returns bin as null. We get the same result across local and staging environments.

Any thoughts?

Recent Answers


Zach Perry answered on August 10, 2018 17:20

Do you have web farm setup correctly? The Media Files should be synced between Kentico and the MVC app via web farm. You can read more here

0 votesVote for this answer Mark as a Correct answer

Brandon Prudent answered on August 10, 2018 17:35

Thanks for the reply, Zach. I thought that might be the case, but I'm having a lot of trouble figuring out what else I could possibly do to push it along. It seems the system is set to 'automatically' sync to the webfarm (which is the same machine). All the web farm page tells me is the current server is 'healthy'. I don't see any sort of way to check if it has done this or force it to sync. Is there a particular setting or function I could use?

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on August 10, 2018 19:36 (last edited on August 10, 2018 19:37)

You should have 2 servers on the web farm page - Kentico admin and the MVC Site. When its the same machine you should add a setting to the web config then set the the servers to manual.

The server name will be whatever you put in this setting:<add key="CMSWebFarmServerName" value="Admin" />

Add that setting to AppSettings for both machines with just different values.

0 votesVote for this answer Mark as a Correct answer

Brandon Prudent answered on August 10, 2018 20:20

I configured it according to https://docs.kentico.com/k11/configuring-kentico/optimizing-website-performance/setting-up-web-farms/configuring-web-farm-servers, and now the web farm page lists two healthy farmers, but still the result is the same.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.