Http Status Codes
|500||Internal Server Error|
Other errors occur frequently. As you try the various solutions listed here, consider restarting your server after making a change. To be extra sure, click on the top node in the Connections panel, the one that lists your server, not one that lists a site. Choose Restart.
The 401.3 Error
- make sure you have IUSR as one of the users for your directory.
- Edit Permissions | Security | Edit. Then add IUSR
The Dreaded File Permissions Error: Errno 13
The directory where you put your scripts needs to support the "authenticated user" identity. This means you need to write click on the directory, select properties, turn the Security page, and add "Authenticated Users" as one of the "Group or user names." This user should have modify and write permissions." This should be given to the directory automatically, but if it is not, then you should add it. I did this, and my Errno 13, message about not having write permissions went away.
It is perhaps worth adding that I got this error on folders that I downloaded from a third party (one of my students), and pasted into an existing web site. This meant I was not the one who created the directory. It was created on a student's machine; he zipped up the folders, sent his archive to me, and I unzipped it into an existing site.
A key point to grasp here is that if you give users anonymous access to your web site, then they run as one of the "Authenticated Users."
Traceback (most recent call last): // CODE OMITTED HERE IOError: [Errno 13] Permission denied: 'SomeFile.data'
Note that Errno 2 can also be related to this problem. Sometimes the reason a file does not exist is because the script that should have created it did not have the right permissions.
What else can go Wrong: 404.2?
One dark and rainy night, I got a 404.2 error on my Windows Server. The error message I got in the browser was actually very informative, but I had trouble decipering it: "The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server."
The fix was quite simple:
- Bring up the IIS Manager
- Switch to Features View, and go to the server node. The is often the one that has the same name as your server. Other than the Start Page, it is the top node in the tree.
- Find the ISAPI and CGI Restrictions App. This only appears on this top node. You won't find it on the other nodes.
- Make sure that the application you want to run is listed and that the restriction is set to Allowed.
In my case, the problem was simply that I was pointing to the wrong copy of Python. I had installed it twice on my system. In my Handler Mapping I pointed at one copy of Python.exe, and in this setting I was pointing at the other copy. The moment I brought them into sync, things started working for me.
Internal Server Error: 500.19
This error frequently points at a Web.Config that does not have the appropriate permissions. I fix it by right clicking on the web.config file in the Windows Explorer. Select properties. If the file is blocked, choose unblock. Turn to the security page. Select Edit and Add iis_iusrs. Make sure to check the name. Sometimes you might also have a section in the web.config file that is not valid without adding more permissions. Try removing sections from the file.
These can result from creating malformed HTML or XML. Try running simple scripts that you know are right and see if they work. Try running your Python script from the command line, and then taking the output and running it through the XML validator:
If you get a 502.2 error with 0x0000000 error id, then you may have left off the %s %s bit when setting up the Script Handler for Python. See this page for details: