West Wind Application Configuration
Server ipal.ipalServer[1] failed to load in time.
Gravatar is a globally recognized avatar based on your email address. Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  All
  Jun 26, 2017 @ 09:24am

I am trying to switch to COM mode and am getting "Server ipal.ipalServer[1] failed to load in time."

App is pretty "bulky" and therefore takes a few seconds to load.

I have 2 set to load and the error appears to happen on the 2nd.

WC Version 6.72

Clue(s)?

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  Rick Strahl
  brett carraway
  Jun 26, 2017 @ 09:59am

I doubt it's the load time that's the problem - COM will wait for quite a while.

However, I'd try loading the COM server from FoxPro or VbScript shell to see if it hangs during load. Remember the security environment might be different or the pathing may not be exactly the same - any failure during startup that hangs FoxPro will hang the load sequence.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  Rick Strahl
  Jun 26, 2017 @ 11:19am

Doh! thanks for the clue. It led me to discover I had set the following in my app.ini.

ShowServerForm=On <>

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  brett carraway
  Jun 26, 2017 @ 12:41pm

To be clear, I had set ShowServerForm=Off

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  Rick Strahl
  brett carraway
  Jun 26, 2017 @ 01:24pm

The server form by itself shouldn't be a problem - although that's UI it works. What doesn't work are dialogs and file open dialogs etc. that can cause problems.

In the future this can help:

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  Rick Strahl
  Jun 29, 2017 @ 11:23am

Still no success. I created a new sample project and was able to get it running as COM no prob.

The IPAL app however does some weird stuff. I've minimized the main program and inserted several calls to the trace method. It appears to load fine. I did find, while in COM mode, it was setting server.cAppIniFile to IPALServer.ini (COM server name) instead of IPAL.ini, but it's using Dot Net config so I don't think this matters (but I did correct to see if made any difference).

Clues: Task mgr shows app as taking several seconds to load while it's memory use increments steadily until peaking at almost 10meg (size of exe). Is this normal? I notice the sample app doesn't do this (tho is much smaller).

It's not recognizing an idle server already in memory I think. I have d key="ServerCount" value="1" and on "Web Connection Module Status Page" if I click "Load One Server", it loads (tho slowly), but if I then try to load another page in the app another server loads and ultimately I get "failed to load on time".

So, I am still grasping at straws... any additional clues?

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  brett carraway
  Jun 29, 2017 @ 11:44am

Also getting below on attempt load another page (besides admin).

"We were unable to retrieve a server instance from the server pool."

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  Rick Strahl
  brett carraway
  Jun 29, 2017 @ 03:50pm

it was setting server.cAppIniFile to IPALServer.ini (COM server name) instead of IPAL.ini, but it's using Dot Net config so I don't think this matters it was setting server.cAppIniFile to IPALServer.ini (COM server name) instead of IPAL.ini, but it's using Dot Net config so I don't think this matters

That's your server ini file, so yes that definitely matters. That's where all of your configuration settings live that configure your FoxPro server, so make sure that file loads properly.

I think the best approach for you likely will be to load the server with FoxPro or Script and see what happens interactively.

Also if you have lengthy load times I also would recommend that you move the code out of the Init/Load sequence so that the server instance can be loaded more quickly. Just leave the initialization code there and do anything else that happens either into an overload of the Process() method with a lFirstRequest flag:

*** add a property to your server (at top)
lFirstLoad = .T.

....

FUNCTION Process()

IF(THIS.lFirstLoad)
   THIS.lFirstLoad = .F.
   THIS.LongConfiguration()
ENDIF

DODEFAULT()
ENDFUNC

FUNCTION LongConfiguration()
*** Do your Slow To Load Stuff here
ENDFUNC

This will ensure your server comes up and defer processing of your long request stuff until after the server has been instantiated. It'll be easier to trouble shoot those issues as you'll get an error message rather than some obscure COM error if something goes wrong.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  Rick Strahl
  brett carraway
  Jun 29, 2017 @ 09:44pm

Brett,

Due to this discussion I've decided to implement some changes in the way Web Connection servers are loading. I've changed the logic so that servers separate the OnInit() and OnLoad() behavior to before and after the Init constructor has fired. The change immediately returns after the OnInit() and provides an instance which makes for much faster initial instance loading and should avoid issues with any timeouts due to slow startup.

This also lets you capture server errors during OnLoad() as errors actually trigger an error message rather that failing with some obscure COM error that can't be reported back to the Web Server.

It'll need a bit more work and will make it into the next Web Connection release.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  Rick Strahl
  Jun 30, 2017 @ 07:25am

Thanks Rick! This may be incentive I can provide mgt to purchase the latest update.

I minimized load code and still getting "took too long to load" related message. I have therefore minimized code in my classic process PRG and noticed it did load successfully, inconsistently.

I have a ton of fox forms / SCX files built into my EXE (still using old forms-to-HTML method). I think this bloats the size of my EXE. So, I am removing these files and rebuilding to test some more.

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  Rick Strahl
  Jun 30, 2017 @ 07:43am

One weird thing I am seeing is a new ipal.exe / com server is loaded (according to processes tab of task mgr) with any request (like HelloWorld).

If on "Web Connection Module Status Page", servers (2) are already loaded and I click unload servers, it starts loading new instances before unloading the latest 2 added. This is inconsistent however.

It's as if there's a timeout on the framework recognizing existing instances.

If I load all (2) servers using "load all servers" and then "unload servers" right away it works as expected (according to task mgr). Note the server listing on the WC page is not always accurate.

Note I am using Dot Net config with IIS 7.5.

Maybe I can test the changes you are making to wwServer ???

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  Rick Strahl
  Jun 30, 2017 @ 07:58am

Another clue:

`o=CREATE("ipal.ipalServer")

? o.ProcessHit("query_string=wwMaint~FastHit")`

works fine. However, is it supposed to unload the server? It does. I've not seen this in previous tests. It could be that I hosed something, but wanted to mention.

Also, now that I am getting COM to load from iPALtestbed/admin/wc.wc?_maintain~Load, If I call the only remaining process method, HelloWorld, I get below.

Com Server Execution Error

The Com server threw an exception during the server method call: String reference not set to an instance of a String. Parameter name: s


Message generated by Web Connection IIS Connector Module

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  brett carraway
  Rick Strahl
  Jun 30, 2017 @ 08:29am

Below is also periodically encountered.

Unable to retrieve a server instance

We were unable to retrieve a server instance from the server pool.

This happens when ipal.exe IS in memory loaded via COM.

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  Rick Strahl
  brett carraway
  Jun 30, 2017 @ 11:39am

I wouldn't worry so much about the size of the EXE - disk load is usually not a huge slowdown. The thing to worry about with slow loads is long Load() times - ie the code that fires to get the server ready. You can use the workaround I posted by offloading some of the load code into the Process() method which would ensure the server can load.

But - how long does it take for server to load? The COM timeout is at least 15 seconds and I sure hope that your server doesn't take that long to come up?

The errors you show indicate that the server is crashing during startup and hanging. Most likely you have some place where a file is not found and a file open dialog pops up which can hang the server.

Make sure that your server runs in UnattendedComMode in YourApp.ini file:

Unattendedcommode=On

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Server ipal.ipalServer[1] failed to load in time.
  Rick Strahl
  brett carraway
  Jul 2, 2017 @ 10:38am

Hi Brett,

I've written up a blog post describing some of the new features coming in 6.15 that should make this debugging scenario a bit easier with a new way that the server loader separates startup code until after an instance has been created.

test

+++ Rick ---

© 1996-2017