I have migrated an Umbraco install to a new server.
However, I now get a 500 server error whenever I try and open a media file.
I can upload files successfully to the root 'media' folder but I cannot seem to then navigate to these files.
Does anyone know what could be causing this?
As other poeple have mentioned, ideally we need to see the error message. Additionally, can you check if your server can serve up files of that type from other location? If so then it's a permissions issue (check the permissions on the old server match the new one, remember to give read, write and modify permissions to "IIS_IUSRS", "Network Service" and "IUSR" Windows accounts), but if you cannot serve any files of that type at all then you need to add the MIME extensions (added in IIS - see here)
This link suggests touching the global.asax, while this one makes me wonder whether you removed the Label datatype by any chance.
What version of Umbraco are you using? I would also look in the database, in the UmbracoLog table for any errors that might point you in the correct direction.
What type of media files don't work? Is it just certain extensions? Or everything (including images)?
If it is simply certain extensions, you may need to verify that IIS is allowing those extensions.
Related
When I open the Umbraco (7.6.3) backoffice, I'm unable to view or make changes to templates. It seems like other functionality is unaffected, and I can create & edit specific pages. However, attempting to open the templates themselves just leads to a white screen. This problem exists across browsers:
Other screens render just fine:
What gives?
Checking the console when attempting to load gives an interesting error:
Error: Argument 'Umbraco.Editors.Templates.EditController' is not a function, got undefined...
Resolution:
The issue seemed to be caused by outdated files in the Umbraco folder. Copying most directories over from packages\UmbracoCms.7.6.3\UmbracoFiles\umbraco\ seems to have done the trick.
Looking at the changelog, it seems like the JS folder was the most influential in getting this fixed.
Are you sure that you're on 7.6.3? The UI appears to be pre-7.6 (I can tell because the colours haven't been updated).
If you have just upgraded, it's possible that your browser has cached the JS which is used - hard refresh your browser to see if the UI updates.
Umbraco also uses a dependency service to compile all of the used JS/CSS files together into one large one. This service will not be used if your website is in debug mode. Either:
Turn debug mode on in the Web.config
Delete any files in the \App_Data\ClientDependency\ folder as this is where the cached compiled files are kept (these will be regenerated)
My first thought would be file permissions.
Have you run the health check for permissions in the developer section? Need to make sure that your application pool user has write permissions on the Views folder.
I'm developing an ASP.NET MVC 5 application that use KendoUI . If I run the project under IIS Express everything works fine... if I use IIS Local I got the following exception when I try to load a view
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
Additional information: Invalid file name for file monitoring: 'C:\svn\Projects\xxx\trunk\xxx\Views\Shared\EditorTemplates'. Common reasons for failure include:
- The filename is not a valid Win32 file name.
- The filename is not an absolute path.
- The filename contains wildcard characters.
- The file specified is a directory.
- Access denied.
I've just searched on google and someone suggest to disable under Debug->Exception the throw exception checkbox but if I do so I wouldn't get the view displayed since the output is just javascript...
Anyone has found a solution to this problem?
Thanks
Some things you could try:
Directory Access
Check to ensure your 'C:\svn\Projects\xxx\trunk\xxx\Views\Shared\EditorTemplates' directory is available to the application.
First, determine what user account the IIS application pool assigned to the application.
Open Internet Information Services (IIS) Manager.
Expand the server name.
Expand Sites.
Click the node with the site in question.
Click the Basic Settings... link in the right pane.
Note the name of the application pool in the top right box, and click Cancel.
Click the Application Pools node in the left pane.
Find the application pool with the name from step 6, and check the value in the Identity field.
Now, the Identity could either be a built-in account (such as NetworkService, LocalSystem, LocalService, or ApplicationPoolIdentity), or it could be a local or domain user (if you are using Active Directory).
If it is a local or domain user, you just need to open the 'C:\svn\Projects\xxx\trunk\xxx\Views\Shared\EditorTemplates' directory in Windows Explorer, right-click on it, and choose Properties. Click the Security tab, and make sure the user is in the list. If not, click Edit..., then click Add..., and add the user to the list. Ensure it has enough permission to read the directory.
If using a built-in user, you could either switch it to a local user, or see this answer for the command to add permissions to the built-in account.
templateName Parameter
One thing in particular to check is the templateName parameter of #Html.Editor() or #Html.EditorFor() in all of your views (or anywhere else you may happen to be calling it). This parameter should correspond with one of the formats here.
The most common usage is to specify just the name of the template. For example, if you specify MyTemplate for this field, it will search several directories for the file (see the above document), ending up with ~/Views/Shared/EditorTemplates/MyTemplate.<extension>, where extension will be .cshtml, .vbhtml, .aspx, or .ascx. This is the directory in your error message, so you should check these references thoroughly.
Even if you are not specifying the parameter explicitly, MVC uses a convention that the file name matches your view model name.
File Format
This is a long shot, since your application is running under IIS Express it shouldn't be the case. But you could try searching to see if there is any code in your application specifying a file in the 'C:\svn\Projects\xxx\trunk\xxx\Views\Shared\EditorTemplates' directory.
If so, make sure that the file name
Doesn't contain invalid Windows filename characters.
Is an absolute path, or is calling Environment.MapPath or Server.MapPath to resolve to an absolute path.
Doesn't contain a ? or a *.
Doesn't have a directory specified where a file name should be.
Clear your Temporary ASP.NET Files
I found a potential answer here.
You could attempt to clear your ASP.NET temporary files pertaining to the current application. Note that there are a few different places where they can be lurking depending on your framework version and bitness.
<Drive>:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
<Drive>:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
<Drive>:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files
<Drive>:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
If you have the project open in Visual Studio, it will not let you delete the relevant files. Ultimately, you should close Visual Studio before deleting the files, but I found that leaving it open on the first attempt is a good way to determine which of the folders contains the application in question because you will get a message that the files are locked. Knowing that location can be useful if you have additional problems.
I am trying to access a fonts folder in my site in production.
I am using Hoefler Frere Jones fonts and it basically asks to add the fonts into the site. It keeps giving me a not found error when I try to access the /fonts/165137 folder but when I type in /fonts/165137/1D3CD1EB968865CCC.css I can see the file.
I wondered what the correct way is to do this for rails?
All I basically need to do is add the fonts to my site and make the sub folders accessible in them so they can be found when moving the sites fonts to production but I keep getting 403 errors.
Can anyone suggest what the issue is?
when I try to access the /fonts/165137 folder
/fonts/165137 - is a directory and probably directory listing is disabled by your webserver that's why you're getting the error. And check paths to the font-files from the css-file.
Good day lovely computer peoples!
I've uploaded a .dmg file to my server, but when I test to see if it is downloadable by pointing the web browser to it's place in the directory (i.e. using it's URL) I get a 404.
Any possible ideas of why this could be happening?
Thanks
EDIT 1
I realize that the 404 means that it can't find the item, but I'm staring at both addresses (the one in the browser and the one in the FTP client that I use) and they seem identical. I have some underscores in the name of the .dmg. Could that be the problem?
You need to make sure you add a mime type for the file extension. Most servers now days do not allow access to files that don't have explicit file extension declarations in their list of mime types.
You didn't say what server you're using so I can't give you specific instructions on how to do it but in most servers it's fairly easy. Just google your webserver name and "add mime type" with the quotes.
The myfile.dmg is not found. Double check the file location and the URL you are pointing to.
I have an ASP.NET MVC website that works in tandem with a Windows Service that processes file uploads. For easy maintenance of the site, I'd like the log file for the Windows Service to be accessible (to me, only) via the website, so that I can hit http://myserver/logs/myservice to view the contents of the log file. How can I do that?
At a guess, I could either have the service write its log file in a "Logs" folder at the top level of the site, or I could leave it where it is and set up a virtual directory to point to it. Which of these is better - or is there another, better way?
Wherever the file is stored, I can see that there's going to be another problem. I tried out the first option (Logs folder in my website), but when I try to access the file via HTTP I get an error:
The process cannot access the file 'foo' because it is being used by another process.
Now, I know from experience that my service keeps the file locked for writing while it's running, but that I can still open the file in Notepad to view the current contents. (I'm surprised that IIS insists on write access, if that's what's happening).
How can I get around that? Do I really have to write a handler to read the file and serve it to the browser myself? Or can I fix this with configuration or somesuch?
PS. I'm using IIS7 if that helps.
Unfortunately I'm afraid you'll have to write a handler that will open the file, and return it to the client.
I've written an IIS Manager extension that displays server log files, and what I've noticed that even the simple
System.IO.File.OpenRead("")
can still run in the same problem, and return the same error.. It was kind of confusing.
In the end I used
System.IO.File.Open("", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
and I could easily open the file while the server was writing logs to it :)
I think the virtual directory is an "okay" solution, if you add the directory (application) with READ ONLY rights + perhaps "BROWSE directory" too (so you can see the folder contents rendered by the IIS).
(But once you do that, you should consider that you also anonymous access to that folder - unless you enable authentication, so watch out for "secret" contents of the logfiles that you might expose? just a thought.)
Another approach, I prefer myself, is to make a MVC/ASP.NET page that does the lookup in the folder by normal code, so that you 100% can filter whatever data is shown in the HTML.
You can open the files as TextStream's and in Read Only mode.
If it's a problem to gain access to the logfolder, I would use the virtual directory with READ ONLY access and then program something that renders the logfiles as HTML on my screen and with my detail levels. Perhaps even add some sort of "login" first. But it all depends on your security levels and contents of logfiles.
is this meaningfull to you? if not, please explain more, as I've been through this thought a few times already for similar situations.