cgi not responding properly

  1. 4 months ago

    Alexandre C

    Feb 21 Pre-Release Testers, Xojo Pro Brazil

    Hi!

    As requested, a new thread here.

    Alexandre

  2. Greg O

    Feb 22 Xojo Inc Somewhere near Raleigh, NC

    Ok, let me see if I can figure this out...

  3. Alexandre C

    Mar 4 Pre-Release Testers, Xojo Pro Brazil

    Hi!

    Any news? Any clue?

    Alex

  4. 3 months ago

    Tobias B

    Mar 7 Pre-Release Testers, Xojo Pro Bern, Switzerland
    Edited 3 months ago

    As I've written in the other thread I'd have a look to TimeOut within the Apache Configuration (Or anything that is between the App and the net like a reverse proxy). From your server all the push requests get a error-reply after 40 sec. Other servers like the one from @Christian+Schmitz do send a HTTP 504 after 120s. I've seen other apps/servers responding gracefully (HTTP 200) after 180s. There is also a Feedback Case on the cgi Timeout Issue: Feedback Case #49528
    I'm unsure, thus, if these TimeOuts on push long polling XHRs are the cause of your issues. But it seem worth to give it a try.

  5. Alexandre C

    Mar 8 Pre-Release Testers, Xojo Pro Brazil

    @Tobias B As I've written in the other thread I'd have a look to TimeOut within the Apache Configuration (Or anything that is between the App and the net like a reverse proxy). From your server all the push requests get a error-reply after 40 sec. Other servers like the one from @Christian+Schmitz do send a HTTP 504 after 120s. I've seen other apps/servers responding gracefully (HTTP 200) after 180s. There is also a Feedback Case on the cgi Timeout Issue: Feedback Case #49528
    I'm unsure, thus, if these TimeOuts on push long polling XHRs are the cause of your issues. But it seem worth to give it a try.

    Hi!

    But this can occur even USING the webapp?

    Because using or not the problem is the same!

    Alex

  6. olivier v

    Mar 8 Pre-Release Testers, Xojo Pro Europe (France)

    @Alexandre C But this can occur even USING the webapp?

    yes. I don't know CGI. But with a standalone reverse proxy app under apache, it's important. The Apache configuration is important.

  7. Alexandre C

    Mar 10 Pre-Release Testers, Xojo Pro Brazil

    I changed Apache timeout from 20 to 300 seconds. Same problem!

  8. Tobias B

    Mar 12 Pre-Release Testers, Xojo Pro Bern, Switzerland
    Edited 3 months ago

    I tested again with Safari on the the URL you've posted in the other thread. Still the "push" requests do get a HTTP 504 Gateway Timeout answer after 40 sec.

    -image-

    Later I saw a "ping" request beeing unanswered because of a Connection Reset. This lead to the client side JS showing the "The application has gone off-line." message and starting the offline-polling. That polling is apparently directing the wrong URL polling "http://alemac.com.br/cgi-bin/test/xojo/ping" instead of "http://alemac.com.br/cgi-bin/test/test.cgi/xojo/ping" which is, imho, a bug on its own affecting the CGI target: Feedback Case #51525. This is causing lots of (correct) 403 or 404 errors.

    But still, your configuration change seems not to be active or at least not helping with the 504 messages. Nor do I understand why the connection of the "ping" call was reset.

    You do have some logging in the App to confirm it is not crashing / the same instance is running continuously, don't you?

  9. Alexandre C

    Mar 12 Pre-Release Testers, Xojo Pro Brazil

    @Tobias B Later I saw a "ping" request beeing unanswered because of a Connection Reset. This lead to the client side JS showing the "The application has gone off-line." message and starting the offline-polling. That polling is apparently directing the wrong URL polling "http://alemac.com.br/cgi-bin/test/xojo/ping" instead of "http://alemac.com.br/cgi-bin/test/test.cgi/xojo/ping" which is, imho, a bug on its own affecting the CGI target: Feedback Case #51525. This is causing lots of (correct) 403 or 404 errors.

    But still, your configuration change seems not to be active or at least not helping with the 504 messages. Nor do I understand why the connection of the "ping" call was reset.

    English, please…

    @Tobias B You do have some logging in the App to confirm it is not crashing / the same instance is running continuously, don't you?

    No. In this case, it's a simple cgi app. the app does nothing.

  10. Greg O

    Mar 12 Xojo Inc Somewhere near Raleigh, NC

    That polling is apparently directing the wrong URL polling "http://alemac.com.br/cgi-bin/test/xojo/ping" instead of "http://alemac.com.br/cgi-bin/test/test.cgi/xojo/ping" which is, imho, a bug on its own

    On Xojo Cloud, that’s perfectly legal.

  11. Alexandre C

    Mar 12 Pre-Release Testers, Xojo Pro Brazil

    Ok. That's causing the cgi to not respond properly?

    If i understood correctly, it's a bug on xojo cgi itself, right?
    If yes, any idea when it'll be fixed?

    Alex

  12. Tobias B

    Mar 12 Pre-Release Testers, Xojo Pro Bern, Switzerland

    @Alexandre C English, please…

    I'm sorry if anything I said was not understandable, I'm not a native speaker.

    @Alexandre C If i understood correctly, it's a bug on xojo cgi itself, right?

    The issue with the path for the reconnect ping (#51525) which seem to require a special webserver configuration (present at Xojo Cloud) is just a second thing preventing the automatic re-connect. I think it is negligible here.

    I tested again with Chrome and Safari from Switzerland. The connection reset did not happen again, both browsers keep the connection just fine. But still the "push" POSTs receive a 504 after 40 seconds - which alone should not cause a disconnect. I'm out of ideas here.

  13. Greg O

    Mar 13 Xojo Inc Somewhere near Raleigh, NC
    Edited 3 months ago

    Edit: I thought you said your server was on Xojo Cloud, but I see that it's not.

    I too am at a loss. We have hundreds of customer apps running on Xojo Cloud built with various versions of Xojo which are not encountering these issues, including a few of ours.

    @Alexandre C - no, it is not a bug in the cgi script. Every Xojo web app cgi script is identical. If something were wrong, they’d all be failing.

    The issue with the path for the reconnect ping (#51525) which seem to require a special webserver configuration (present at Xojo Cloud) is just a second thing preventing the automatic re-connect. I think it is negligible here.

    That’s not what I said. On Xojo Cloud, the servers are configured to allow the cgi script to behave as an index file so that they don’t have to appear in a he url... and since the trailing “xojo/ping” is virtual, it should work just fine. This configuration is not required for the feature to work.

    The 504 Gateway error indicates that the app simply isn’t responding in the time that Apache thinks is long enough, about 40 seconds in this case, and yes, that is too long for a web app to take to respond. Humans get frustrated at 3 seconds, 40 is an eternity.

    App crashes are usually the culprit, but if the app isn’t crashing, the second most likely scenario is that the app is hung because it’s waiting for something. If your app connects to another service or server, make sure those are “always” available, that the appropriate firewall ports are open and if something unexpected happens that your app doesn’t crash if it gets no result (like an empty result from an HTTPSocket when you are expecting json).

    The next most common issue is that your app has a method that takes a lot of cpu for an extended period of time, effectively locking out the browsers until it’s finished. This usually occurs because of an unyielding tight loop in your code. A common example is retrieving a large recordset and sending all those rows to a listbox at once. It’s a double whammy actually because you pull the records in a loop and then all that data has to be sent to the browser.

  14. Greg O

    Mar 13 Xojo Inc Somewhere near Raleigh, NC
    Edited 3 months ago

    Ok, so I've jut gone to http://alemac.com.br/cgi-bin/test/test.cgi and your app is definitely taking too long to respond. looking at the debug tools, I'm seeing latencies between 4 and 7 seconds to return the built in pictures which are all below 10 kilobytes, heck, the Shown event on the page is taking 6 seconds to respond and the response is actually empty.

    There's are a few possibilities:

    1. The server is really busy and the app is not getting enough time to respond.
    2. The app is really busy (as in my previous post, but that doesn't seem likely given the url I'm using)
    3. The server is throttling or killing the app (which I'm beginning to think is the most likely scenario)

    Lets get some specifics about your server as I see that you are not on Xojo Cloud.

    1. Is this a private or shared server? That is, are you paying for a full Virtual Private Server or is this simply a hosting account?
    2. What is the OS & Version your server is using? cat /etc/os-release should get that for us.
    3. How many CPU cores do you have and how much memory is available? If you have shell access, running the command "top" will give us this info.
  15. Greg O

    Mar 13 Xojo Inc Somewhere near Raleigh, NC
    Edited 3 months ago

    @Alexandre C - On that sample app, please download the following file:

    https://www.dropbox.com/s/h8wwc2lyh9vlcsa/ServerPingFix.xojo_binary_code?dl=1

    drop that file into the project and then drag an instance to WebPage1 (or whatever page is shown there). This may not solve the overall problem, but may help with the ping problem.

  16. Alexandre C

    Mar 13 Pre-Release Testers, Xojo Pro Brazil
    Edited 3 months ago

    @Greg OLone The server is really busy and the app is not getting enough time to respond.

    i'll check

    @Greg OLone The app is really busy (as in my previous post, but that doesn't seem likely given the url I'm using)

    i think it's not, as you could see on sample app

    @Greg OLone The server is throttling or killing the app (which I'm beginning to think is the most likely scenario)

    i need to check.

    @Greg OLone Lets get some specifics about your server as I see that you are not on Xojo Cloud.
    Is this a private or shared server? That is, are you paying for a full Virtual Private Server or is this simply a hosting account?

    https://www.knownhost.com/managed-ssd-vps.html
    mine is a MVPS-3

    @Greg OLone What is the OS & Version your server is using? cat /etc/os-release should get that for us.

    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"

    CENTOS_MANTISBT_PROJECT="CentOS-7"
    CENTOS_MANTISBT_PROJECT_VERSION="7"
    REDHAT_SUPPORT_PRODUCT="centos"
    REDHAT_SUPPORT_PRODUCT_VERSION="7"

    @Greg OLone How many CPU cores do you have and how much memory is available? If you have shell access, running the command "top" will give us this info.

    4 cores, 6GB

    top - 09:37:22 up 7 days, 18:21, 1 user, load average: 0.59, 24.33, 122.19 Tasks: 80 total, 1 running, 77 sleeping, 1 stopped, 1 zombie %Cpu(s): 21.3 us, 3.7 sy, 0.0 ni, 75.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 6291456 total, 2433172 free, 2209344 used, 1648940 buff/cache KiB Swap: 0 total, 0 free, 0 used. 3919776 avail Mem

  17. Alexandre C

    Mar 13 Pre-Release Testers, Xojo Pro Brazil

    @Greg OLone @Alexandre C - On that sample app, please download the following file:

    https://www.dropbox.com/s/h8wwc2lyh9vlcsa/ServerPingFix.xojo_binary_code?dl=1

    drop that file into the project and then drag an instance to WebPage1 (or whatever page is shown there). This may not solve the overall problem, but may help with the ping problem.

    Done!

    new_instance

  18. Alexandre C

    Mar 13 Pre-Release Testers, Xojo Pro Brazil
    Edited 3 months ago

    Jason, from xojo's support, uploaded my previous cgi to xojo cloud.
    as expected, worked fine!

    http://67.205.169.107/test-Dev/

    so the problem is a configuration on my server. i just need to know which configuration is!

    the strange is that only occurs on MAC clients, not WINDOWS

    Alex

  19. Greg O

    Mar 13 Xojo Inc Somewhere near Raleigh, NC

    @Alexandre C Done!

    new_instance

    Ok, did you upload that app to your server?

  20. Alexandre C

    Mar 13 Pre-Release Testers, Xojo Pro Brazil

    @Greg OLone Ok, did you upload that app to your server?

    Yes, but i'm sorry, did not kill the actual cgi.

    You can try now.

  21. Newer ›

or Sign Up to reply!