Webapp kills Apache

  1. 3 weeks ago

    Tony L

    Jan 2 Pre-Release Testers, Xojo Pro Hong Kong

    Hi all,

    Is there any possible reason that a Xojo Web app would kill the Apache? The symptom is when the same app is opened more than once in the same PC, all other users will be kicked out and the web server has to be restarted again. But this does not happen to all machines, only some machines in the office cause this problem.

    Environment: Ubuntu 16.04.3 LTS + Apache: 2.4.18 + Xojo 64-bit deployment

    Thanks in advance.

  2. Anthony C

    Jan 2 Pre-Release Testers, Xojo Pro GraffitiSuite Developer

    Is there anything in the Apache logs related to the crash?

  3. Greg O

    Jan 2 Xojo Inc Somewhere near Raleigh, NC

    Check memory usage on that server. When available memory gets low, the OS will sometimes kill off non-essential processes... like Apache.

  4. Tony L

    Jan 2 Pre-Release Testers, Xojo Pro Hong Kong

    Here is the print screen of the error log:

    https://drive.google.com/open?id=1V8kHhoDbOetUwRI-VkkfxruzIGkoxtBV

  5. Derk J

    Jan 2 Pre-Release Testers, Xojo Pro

    If you have 2 instances you should have uniqe app identifier.

    If you upload using ftp, try using binary upload mode.

    Not sure what’s actually happening here, could be a memory issue (circular reference?)

  6. Tony L

    Jan 2 Pre-Release Testers, Xojo Pro Hong Kong
    Edited 3 weeks ago

    Unique identifier? Can be changed at run-time? Some more information, if the user entered an incorrect password in the Login page which is the first page when the app loads, the app kills immediately. However, the app design is just showing a message box telling the user has entered an incorrect password, nothing else.

    @Derk J , I just copy everything in the build folder generated by Xojo to the Linux Samba, not by ftp. The app runs ok if correct password is entered.

  7. Greg O

    Jan 3 Xojo Inc Somewhere near Raleigh, NC
    Edited 3 weeks ago

    @Tony L Unique identifier? Can be changed at run-time? Some more information, if the user entered an incorrect password in the Login page which is the first page when the app loads, the app kills immediately. However, the app design is just showing a message box telling the user has entered an incorrect password, nothing else.

    Does it “crash” when you run the app locally in the IDE? If so, you should be able to step through and figure out what’s causing it.

  8. Derk J

    Jan 3 Pre-Release Testers, Xojo Pro

    @Tony L Unique identifier? Can be changed at run-time? Some more information, if the user entered an incorrect password in the Login page which is the first page when the app loads, the app kills immediately. However, the app design is just showing a message box telling the user has entered an incorrect password, nothing else.

    @Derk J , I just copy everything in the build folder generated by Xojo to the Linux Samba, not by ftp. The app runs ok if correct password is entered.

    If that's true, try it in a browser (safari or chrome) with developer tools, then show the page source and see the console. Leave the page source window of the browser open and go back to your web app and fill in the form, wrong (to get the crash) see what the browser is writing in the console.

    OR: show us some code that's inside the function or event that handles the form. It could be your doing something wrong.

  9. Tony L

    Jan 3 Pre-Release Testers, Xojo Pro Hong Kong

    @Greg OLone , nothing wrong when running locally ( thru Xojo debugger if I do not get your meaning wrong). Also if I entered the login information correctly, the app runs perfectly.

    @Derk J , thanks for your advise, will have it a try.

  10. last week

    Tony L

    Jan 11 Pre-Release Testers, Xojo Pro Hong Kong

    Well.... tired of having the Apache down always..... Would somebody can help to have a look at my app

    https://drive.google.com/open?id=13Z1z9jtDoDS3obpcsmlXq5M8_Vzy0VMv

    The symptom is: when somebody tries to login with invalid login information, sometimes (not always) the app will make down the Apache which then leads to all users using the app being killed. The app keeps running well if it can bypass the login problem, crashing seems only appears during login. The codes regarding login is in folder Interface -> System Login.

    Another thing is, I noticed that errors keep recording in the Apache Error Log:

    https://drive.google.com/open?id=1V8kHhoDbOetUwRI-VkkfxruzIGkoxtBV

    This doesn't seem to relate to the login problem as errors keep recording every 6 seconds around even the app is keep on running or I killed all the processes in Apache.

    To me, its a big and important project. Please someone kind enough to give some advises. Thanks very much in advance again.

  11. Greg O

    Jan 11 Xojo Inc Somewhere near Raleigh, NC

    From what you've described and the error log you provided I really don't think Apache is crashing. I would totally believe that your app is crashing though.

    At first glance, let me suggest that you add a handler for App.UnhandledException and start logging what gets sent there. The way your app is configured right now, if an exception occurs, your app will definitely quit.

  12. Tony L

    Jan 11 Pre-Release Testers, Xojo Pro Hong Kong

    Thanks Greg, I added the following codes to event UnhandledException for both app and session, but it doesn't seem catch anything:

    dim rec as new DatabaseRecord
    dim id as integer
    
    rec.IntegerColumn("AppSession") = 2
    rec.IntegerColumn("Number") = error.ErrorNumber
    rec.Column("Message") = error.Message
    rec.Column("Reason") = error.Reason
    id = session.InsertRecord(app.UnicornDatabaseName, "ERRORLOG", rec, "app.UnhandledException", 1) //my insert statement
    
    return false
  13. Tony L

    Jan 12 Pre-Release Testers, Xojo Pro Hong Kong

    Just found out that I have a bug in a module (not login module) that fires the session.UnhandledException when an exception occurs. The event actually works when an exception occurs, but it doesn't fire when login fails then make the app crash, which means it is not an Exception error?

  14. Greg O

    Jan 12 Xojo Inc Somewhere near Raleigh, NC

    Not necessarily, but let’s check something else.

    Have you checked the system logs? Specifically look for logs related to your app. If it’s being forcibly quit, it may be giving us a clue.

  15. 6 days ago

    Tony L

    Jan 14 Pre-Release Testers, Xojo Pro Hong Kong

    Finally, figured out what happened.... I used to put all codes in the WebButton Action event, just don't know why for the Login button, the codes are in the MouseDown event. After I put back the codes to the Action event, the problem is gone. Will MouseDown event of a WebButton make crash the app?

  16. Greg O

    Jan 15 Xojo Inc Somewhere near Raleigh, NC

    @Tony L Finally, figured out what happened.... I used to put all codes in the WebButton Action event, just don't know why for the Login button, the codes are in the MouseDown event. After I put back the codes to the Action event, the problem is gone. Will MouseDown event of a WebButton make crash the app?

    It shouldn’t. It’s just another event. Now it could be that MouseDown was also being sent to another control as well so more code than you thought was being run.

  17. Tony L

    Jan 15 Pre-Release Testers, Xojo Pro Hong Kong

    But what I have done is simply add an Action event to the button, copy the codes from MouseDown event, then delete the MouseDown event, nothing else.

  18. Greg O

    Jan 15 Xojo Inc Somewhere near Raleigh, NC

    I understand. What you dont know though is the relationship between MouseDown and Action in the JavaScript framework itself. The Action event fires later than all of the MouseDown events on the page because it’s actually connected to MouseUp, so while making this change sounds simple, it drastically changes the order that the events fire.

    My guess is that the code in this event somehow relies on something else having previously run and now that it’s running later, the state is as it should be.

  19. Tony L

    Jan 15 Pre-Release Testers, Xojo Pro Hong Kong

    It is no doubt that I do not know much about the framework, sorry about that. But your guess reminds me that codes put in the Open event and in Shown event are not the same. I once put codes to create a container at runtime in Open event caused me troubles, then I put them in the Shown event and the problem was gone :)

  20. 5 days ago

    Greg O

    Jan 16 Xojo Inc Somewhere near Raleigh, NC

    @Tony L It is no doubt that I do not know much about the framework, sorry about that.

    No need to apologize. Our event handling on the browser has some subtle issues that make it difficult to track this stuff down sometimes.

or Sign Up to reply!