Support #3654
openUnhandled exception occurs when running some Wt example as ISAPI in IIS 8.
Description
Hello,
Here is the issue I am having when running "Hangman" or a "Blog" examples.
They work fine when using wthttp connector. But, they cause an the following error when running them
as ISAPI in IIS 8 on both Windows 8.1 64bit or Windows Server 2012 64bit: "An unhandled exception occured in w3wp.exe [5064]".
On windows 8.1 I then see a "Visual Studio Just-in-time debugger" window. In Windows Server 2012 IIS 8 just crashes and
requires a restart. It is important to note that examples like "Hello" or "Dialog" works fine with ISAPI on IIS 8.
I gave 'write' permission to the IIS user account to write to the examples folder, so, can not figure out what is
the root cause. All other steps are properly done based on the Wt doc page at
http://redmine.emweb.be/projects/wt/wiki/ISAPI_on_Microsoft_IIS
Wt compiled to target 64bit platform on Windows 8.1 64bit using Visual Studio Express 2013 using Boost 1.56.
Also, IIS 8 can not even log this error in the error log file. I can only attach the Application Error from Windows Log:
Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x5215df96
Faulting module name: KERNELBASE.dll, version: 6.3.9600.17278, time stamp: 0x53eebf2e
Exception code: 0xe06d7363
Fault offset: 0x000000000000606c
Faulting process id: 0x1a10
Faulting application start time: 0x01cffb0ffa71bb1b
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 384aa452-6703-11e4-8258-3c970ed1aad3
Faulting package full name:
Faulting package-relative application ID: ¶
Thanks very much.
Updated by Koen Deforche about 10 years ago
- Status changed from New to InProgress
- Assignee set to Wim Dumon
Updated by Wim Dumon about 10 years ago
Hey Alan,
Hangman and Blog are indeed two applications that try to write a database to the approot directory, so that could very well be the issue. Are you absolutely sure that you configured the approot correctly, and that the w3wp.exe process has write permissions to that directory? I'd have to set up a Windows 8 development system to test this, which would take a reasonable high amount of time and frustration...
Best regards,
Wim.
Updated by Alan Parson about 10 years ago
Hello Wim,
I found this very similar problem at:
http://stackoverflow.com/questions/5437723/iis-apppoolidentity-and-file-system-write-access-permissions
but still could not understand what else I should do in addition to giving IIS_IUSERS
a 'write' permission to the folder. I don't want you to spend your time on this as I am probably missing something
here. I will try to play with this a bit on my own.
Thanks for help!
Updated by Wim Dumon about 10 years ago
Hey Alan,
I must admit that I never fully researched this, I believe I made the folder full-access for anything. Interesting post on stackoverflow, seems to provide useful information.
Best regards,
Wim.
Updated by Alan Parson almost 10 years ago
Hello there,
Unfortunately, I was not able to tackle the reported problem. I even had to close my Windows hosting
account as I could not move on with using ISAPI in IIS 8 on Windows Server 2012 R2.
I wonder, is there any alternative Web server solution for Windows platform that would work with Wt framework?
I would love to keep Windows Server 2012 R2 for my future solutions based on Wt.
Please advise.
Thank you.
Updated by Wim Dumon almost 10 years ago
I'd recommend to configure IIS as a reverse proxy for a wthttpd that listens on the localhost address (127.0.0.1). I think that's a much easier approach to configure than the ISAPI connector.
Best regards,
Wim.
Updated by Alan Parson almost 10 years ago
Thanks very much, Wim.
I will try this option.
Regards.
Updated by Robert Tomek almost 9 years ago
This issue is still here. The documentation should state that the isapi plugin only works for IIS 6 or something.
What's interesting is that when I run my isapi plugin w/dbo (and Auth::AuthWidget) it will create a brand new sqlite database, but when it tries to register a new user it will crash. The db-journal file will be created and still exists after the crash, but the database does not get updated. If I use a previously created database, it will crash upon trying to login as well. My assumption is that there is an issue with modifying files, but not with reading or writing new ones.
Updated by Wim Dumon almost 9 years ago
I'm not convinced the ISAPI plugin doesn't work with IIS 8. This really seems like an access rights issue. There's nothing related to IIS in the code for file accesses for IIS plugins, the normal open/read/write/... calls are used.
Wim.
Updated by Robert Tomek over 8 years ago
It looks more like a write lock with the sqlite database. Like I stated above, it will create the database and tables and it will create a .journal file. It just never completes the update transaction. The file is locked, an exception (error) occurs and the login never completes because it can't update the timestamp for last login.
Updated by Robert Tomek over 8 years ago
Actually, I'm testing with Postgres now, and I think it's the Auth module that has the issue, not the Dbo module.
Using the exact same code, my login page on the httpd version shows both 'Lost password' and 'Register' below the Login button. The isapi version only shows 'Register'. The Registration widget is also missing the email field on the isapi version even though the code has:
@
myAuthService.setEmailVerificationEnabled(true);
myAuthService.setEmailVerificationRequired(true);
@
I noticed this activity on the Registration widget using either database connector.
Updated by Robert Tomek over 8 years ago
OK, there was one line different between my two main() functions that explained the missing email field. I'm getting a strong login before it crashes with postgres, at least.
Updated by Robert Tomek over 8 years ago
So it turns out something was trying to write to the DefaultAppPool's home dir, which it couldn't find. I guess that's what happens when you share DLLs between a web app and a desktop application.