Red Hat web app crash at session start

I’ve been running a complex standalone Xojo web app on Red Hat 7.2 for many months without a problem. Today, I moved it to a user account that was just a non privileged user (i.e not root, which my login account is). Now, it crashes the moment a session starts with an unhandled exception. The error message is “Can’t create destination file.” Also, the stack trace is 11 completely blank lines, which is not very helpful.

I’m not creating any files in the session, so what does this message mean? I’ve determined that it’s happening after session.open but before the home page is shown.

Do Xojo standalone web apps require root permissions?
Any suggestions are welcome. Thanks!

What port have you got it listening to ?
That could be one problem if you want to use a port < 1024 as normal users wont be able to do that

  1. Sorry, should have mentioned that in the original post.

Make sure you have IncludeFunctionNames checked. If you’re building as 64-bit, try 32 as that’ll get you a better stack trace.

I suspect it’s trying to write a log file right next to the app. Take a look at:

http://documentation.xojo.com/index.php/WebApplication

There’s an option there for changing the location of the http log and that may fix your issue. Otherwise I’ll have to look at this in the morning to see what other files we need to write on app launch as I can’t think of any off the top of my head.

@Greg O’Lone : yes, IncludeFunctionNames is checked. I can’t build as 32 bit because (I think) there are no 32-bit libraries anymore for Red Hat 7.x. I would love a stack trace that’s not completely blank, though, so maybe I’ll hunt around for those again.

My app does write a log file, but it does it in a world-writable directory; and the log is intact, as I get messages about the app starting and the session starting. I’ve also tried the --logging flag with no success. The last thing in that file is this:

“GET /framework/framework.js HTTP/1.1” 304 274 “-” “keep-alive”

Found the problem:

The app’s HTMLHeader is this:

[code]

[/code] And the app.HandleSpecialURL is this:

[code]try
dim f2 as FolderItem = app.GetResourceFile(request.Path)
if f2 <> nil and f2.Exists then
DEBUGG "Special URL found: " + f2.NativePath
Request.File = f2
request.MIMEType= “text/css”
return true
else
LogError "SpecialURL not found: " + request.Path + " " + f2.NativePath
end if

catch e
LogError "Unknown error in SpecialURL: " + e.Message
return false
try[/code]

The DEBUGG (my own method) at line 4 shows this:

Special URL found: /home/portal/Portal11/Portal Resources/portal.css
Which is correct. However, when HandleSpecialURL returns, the app crashes.

Could it be that the framework is trying to create a file somewhere based on the Request.File ?

When I remove the HTMLHeader and HandleSpecialURL, the app works fine (albeit it looks bad because some styles are missing).

I can work around this by redoing all the styles in the app, but it would be better to know why it’s crashing so I can keep using my custom CSS.

Any thoughts? Thanks!

This should just be a matter of:

yum -y install glibc.i686 glib2.i686 libglib-2.0.so.0 libicu.i686

Quickly skimming the code, it shouldn’t be.

[quote=303616:@Charles Weger]When I remove the HTMLHeader and HandleSpecialURL, the app works fine (albeit it looks bad because some styles are missing).

I can work around this by redoing all the styles in the app, but it would be better to know why it’s crashing so I can keep using my custom CSS.[/quote]
Something else that would help narrow it down would be to load the css into memory and write it directly to the socket like this:

[code]try
dim f2 as FolderItem = app.GetResourceFile(request.Path)
if f2 <> nil and f2.Exists then
DEBUGG "Special URL found: " + f2.NativePath

// These 3 Lines
dim tis as textinputstream = TextInputStream.Open(f2)
Request.Print tis.ReadAll
tis.close

// Request.File = f2
request.MIMEType= "text/css"
return true

else
LogError "SpecialURL not found: " + request.Path + " " + f2.NativePath
end if

catch e
LogError "Unknown error in SpecialURL: " + e.Message
return false
try[/code]

BTW - How big is that css file?

CSS file is only 2 KB. I’ll try writing it directly and see how that works.

On RHEL 7 it could also be security policy voodoo. You may want to try running in permissive mode and seeing if it changes anything for you. Even with file permissions set they way you think they should be applications can still be restricted by policy.

@John Joyce : good call, but the system was already set to permissive in /etc/selinux/config

@Greg O’Lone : your suggestion to use “Request.Print” instead of “Request.File” for the CSS solved the problem. I still don’t understand why, but thanks!