StrataFrame Forum

Server Times Out

http://forum.strataframe.net/Topic22211.aspx

By Marcel Heitlager - 3/5/2009

When trying to connect to ES it times out.  Also when I check status.aspx it says no clients have connected to this server.  It is in a directory that requires SSL connection.

The test form does a simple query:

'-- Build the Query
loSQLCmd.CommandText = "SELECT * FROM pws_Statements"

'-- Fill the business object using the command
me.FillDataTable(loSQLCmd)

The connection is as follows:

Dim ds As New EnterpriseDataSourceItem("", _
"www.aeswebaccess.com/aes/es", 443, "myKey", _
New SqlDataSourceItem(""))

'-- Configure the compression and encryption (optional)
ds.IsCompressed = True
ds.IsEncrypted = False
ds.EncryptionKey = New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4}
ds.EncryptionVector =
New Byte() {1, 2, 3, 4, 5, 6, 7, 8}

'-- Add the EnterpriseDataSourceItem
DataLayer.DataSources.Add(ds)

I turned encryption off for testing.  "myKey" matches the key that status.aspx shows.  So does the host address.  The virtual directory is matches the physical path. Trying ports 80 and 8080 gives me an error, because it requires 443.

When I click submit it seems to send the query. Then my harddrive gets busy for a while and finally within about a minute it times out. (timeout is set at default)

I do have another oleDB connection that is on local drive to visual foxpro database that is handled through connection manager and has its own DataSourceKey.

Any thoughts on what I'm missing?  Could this be a problem with the connection string to the database? I made sure I have read/write permissions through NT AUTHORITY/Network account.  The connection string is:

<ConnectionString>server=MyServer\SQLEXPRESS;integrated security=SSPI;database=test_database</ConnectionString>

OK that's all I got! I'll shut up and listen now.Tongue

By Marcel Heitlager - 3/5/2009

Oh, one more thing.

I lifted the mac address from the server using ipconfig /all

I double checked it and seems to be correct.

OK, that it!Ermm I think.

By Greg McGuffey - 3/6/2009

If a lot of data is returned by your test command, you might try limiting the data, using TOP (e.g. Select TOP 10....). If it returns, then you know you have a simple time out issue and need to figure out how to change that setting. I see nothing obviously wrong here (but then I'm no expert on the subtleties of ES)
By Trent L. Taylor - 3/6/2009

One other thing to consider here is adjusting the timeout.  You can do this directly on the SqlCommand when you send it down the pipe as well as adjust the defaults on the server.  The first thing I would check would try would be setting the command timeout on the SqlCommand to get around this.  Also, like Greg mentioned, you may be pulling back more information that you need.  Also, if you are saving large amounts of data such as bitmaps, etc. then you could also use a Blob push (which is another thread and topic) to save this asynchrously.  There are a lot of options here, but before we dive into something more complex, just adjust the timeout on the SqlCommand and see if that resolves your issue. 
By Marcel Heitlager - 3/6/2009

Hi guys,

Thanks for the reply.  I adjusted the timeout on the SQLCommand to 360.

The error actually say "Operation timed out" when I execute the command.  Here's the the issue though.  I'm returning an empty dataset because the table is empty.  (eventually it might have 1000 records though that need to come back for processing).

Also when I run the routine, and check status.aspx, it never shows any unique clients connected or anything. When I attempt to connect to the ES, shouldn't it at least show somebody trying to connect? THe timeout on ES is like over a day now.  Could something be blocking the request?  All the websites over SSL work fine.

Any other ideas?

By Trent L. Taylor - 3/6/2009

OK...so this has nothing to do with a query then...it sound smore like a connectivity issue.  At this point it sounds like you are not cnnecting to the ES web service then.  Once connected, you SHOULD see the MAC addresses of the connected clients.  So you might want to start digging around the IIS security permissions as well as any routers, firewalls, etc. that you have around the web server.
By Marcel Heitlager - 3/6/2009

I noticed at status.aspx under server name (site Name): it states Development SDK. Does that impact what I named the site?  Hostname says: www.aeswebaccess.com/aes/es

Also are the any web service extensions that need to be allowed?  I have ASP.NET v. 2.0.50727 allowed.  I thought the requests just went over HTTP or HTTPS.

I turned off windows firewall also with no luck.

I checked IIS security settings.  It requires 128 bit SSL connection.

 

By Marcel Heitlager - 3/6/2009

OK, I'm closer to a solution.

WHen I turned off SSL 128 bit for that site and changed to port 80, my mac address now shows when I make the request.

Now I just get a "The remote server returned an error: (500) Internal Server Error." message.  The stack trace is as follows:

   at System.Net.HttpWebRequest.GetResponse()
   at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.SendRequestCore(BaseParams Params, RemoteDataSourceCommand Command)
   at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.ᜀ(DbCommand A_0, Boolean A_1, String A_2)
   at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack)
   at MicroFour.StrataFrame.Data.DataLayer.GetDataTable(DbCommand Command, Boolean RegisterNotification)

Still not quite there. But making progress (sloooooowly).

By Marcel Heitlager - 3/6/2009

The status on the error is: System.Net.WebExceptionStatus.ProtocolError
By Trent L. Taylor - 3/6/2009

Still hard to give a direct answer at this point.  But one thing you may consider is turning on debugging for the data source to make sure that the query is properly formatted.  Next, (or maybe first) restart IIS to make sure that the application pool gets recycled.  To turn on debugging for a data source, do the following:

MicroFour.StrataFrame.Data.DataBasics.DataSources("").SetDebugOn(...)
By Marcel Heitlager - 3/6/2009

Thanks Trent, but still nothing.  I keep on getting the same error, and I've tried every permutation of connection strings, port 80, port 443, using SQLServer Authentication and not.  Tried various connection strings. Tried with and without datasource keys.  I've restarted IIS a gazillion times, I rebooted the server, kicked the server, yelled at it. I reinstalled Strataframe on my side and ES on the server side (BTW I'm using the latest Beta version). 

Below is debug information on one of the attempts:

Command #: 1
Timestamp: 2009-03-07 01:29:22.750
General Command Settings
Command Type: Text
Object Type: System.Data.SqlClient.SqlCommand
Connection String: http://www.aeswebaccess.com:80/aes/es/RemoteDataSource.ashx
Transaction: False
Command Settings
CommandText: Select st_email from pws_Statements where st_key = '1ab'
Command Parameters
N/A No parameters are defined

below is what shows on status.aspx

Server Name (site name):Development SDK
Registered Name:Marcel Heitlager
Registered Company:Advanced Education Services, Inc.
Serial Number:[my serial number]
Server Hostname:www.aeswebaccess.com/aes/es
License Expiration Date:2/9/2010
Allowed Clients:2
Allowed Hosts to Status.aspx:127.0.0.1 / 10.12.14.0 - 10.12.14.255 / 63.127.169.0 - 63.127.169.255
Serialization Type:Standard
SMTP Settings
SMTP Server & Port:10.12.14.16:25
Email From Address:es@aeswebaccess.com
Email To Addresses:heitlager@mindspring.com
SMTP AuthNo
Data Sources
(SqlDataSourceItem)
DataSourceKey:
Type:MicroFour.StrataFrame.Data.SqlDataSourceItem
Assembly:MicroFour StrataFrame Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7
Connection String:Data Source=AESWEBACCESS\SQLEXPRESS;Initial Catalog=Test_PPMEmailService; User Id=myID; Password=myPassword;
Is Encrypted:Yes
Encryption Key:{default numbers }
Encryption IV:{default numbers}
Is Compressed:Yes
Transaction Timeout:1h 0m 0s
Recognized Client List
It shows 1 client has connected

I'm beginning to wonder if it has to do with where the web service is located.  www.aeswebaccess.com root directory does not use secure socket layer.  Everything under the /aes directory requires 128 bit ssl encryption except the /aes/es directory in which I set the do not require ssl option. When I had it set on it wouldn't even connect to the ES on port 443 (port 80 of course returned an access denied error).  It would just time out. After turning it off I can connect to port 80 but I then get the error in my previous post.  I wonder if I need to try moving the ES server to the root like www.aeswebaccess.com/es, unless you might have another idea. 

The bad thing is, I thought this would be the easy part, and I've been stuck on it for 2 days now.  Oh well. Crazy

By Marcel Heitlager - 3/7/2009

OK I've tried some other things.

Tried to add a new record with the following debug info:

Command #: 1
Timestamp: 2009-03-07 21:54:41.93
General Command Settings
Command Type: Text
Object Type: System.Data.SqlClient.SqlCommand
Connection String: http://www.aeswebaccess.com:80/aes/es/RemoteDataSource.ashx
Transaction: False
Command Settings
CommandText: INSERT INTO [dbo].[pws_Statements] ([st_Key], [st_StudentFullName], [st_PmtDueDate], [st_Email], [st_AmountDue], [st_Message]) VALUES (@st_Key, @st_StudentFullName, @st_PmtDueDate, @st_Email, @st_AmountDue, @st_Message);
Command Parameters
@st_Key: '123411' [DbType: AnsiString | Size: 20 | Direction: Input | SourceColumn: st_Key | SourceVersion: Current]
@st_StudentFullName: '' [DbType: AnsiString | Size: 52 | Direction: Input | SourceColumn: st_StudentFullName | SourceVersion: Current]
@st_PmtDueDate: '1/1/1800 12:00:00 AM' [DbType: DateTime | Size: 0 | Direction: Input | SourceColumn: st_PmtDueDate | SourceVersion: Current]
@st_Email: 'heitlager@mindspring.com' [DbType: AnsiString | Size: 52 | Direction: Input | SourceColumn: st_Email | SourceVersion: Current]
@st_AmountDue: '0' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: st_AmountDue | SourceVersion: Current]
@st_Message: '' [DbType: AnsiString | Size: 102 | Direction: Input | SourceColumn: st_Message | SourceVersion: Current]

Then I created a vfp database, and tried to go that route.  The datasource.config is as follows:

<DataSources>
 <DataSource DataSourceKey="Test1">
  <ConnectionString>Provider=VFPOLEDB.1;Data Source="E:\Inetpub\wwwroot\aeswebaccess.com\aes\somedir\dir2\test_PPMEmailService.dbc"</ConnectionString>
  <TypeFullName>MicroFour.StrataFrame.Data.VfpDataSourceItem</TypeFullName>
  <TypeAssemblyName>MicroFour StrataFrame Base</TypeAssemblyName>
  <TypeAssemblyVersion>1.6.0.0</TypeAssemblyVersion>
  <TypeAssemblyCulture>neutral</TypeAssemblyCulture>
  <TypeAssemblyPublicToken>99fe9917f71608a7</TypeAssemblyPublicToken>
  <IsEncrypted>True</IsEncrypted>
  <IsCompressed>True</IsCompressed>
  <EncryptionKey>1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4</EncryptionKey>
  <EncryptionVector>1,2,3,4,5,6,7,8</EncryptionVector>
  <TransactionTimeout>3600</TransactionTimeout>
 </DataSource>
</DataSources>

Could there be a problem with the connection string syntax?

Appmain looks like this:

Dim ds As New EnterpriseDataSourceItem("testClient", _
"www.aeswebaccess.com/aes/es",80,"Test1", _
New VfpDataSourceItem("testClient"))

'-- Configure the compression and encryption (optional)
ds.IsCompressed = True
ds.IsEncrypted = True
ds.EncryptionKey = New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4}
ds.EncryptionVector =
New Byte() {1, 2, 3, 4, 5, 6, 7, 8}

'-- Add the EnterpriseDataSourceItem
DataLayer.DataSources.Add(ds)

And again the result is the same (internal server error [500].  Debug is as follows:

Command #: 2
Timestamp: 2009-03-07 22:56:31.609
General Command Settings
Command Type: Text
Object Type: System.Data.OleDb.OleDbCommand
Connection String: http://www.aeswebaccess.com:80/aes/es/RemoteDataSource.ashx
Transaction: False
Command Settings
CommandText: INSERT INTO pws_statements (st_key, st_studentfullname, st_pmtduedate, st_email, st_amountdue, st_message) VALUES (?, ?, ?, ?, ?, ?);
Command Parameters
Param0: '123411' [DbType: AnsiString | Size: 18 | Direction: Input | SourceColumn: st_key | SourceVersion: Current]
Param1: '' [DbType: AnsiString | Size: 50 | Direction: Input | SourceColumn: st_studentfullname | SourceVersion: Current]
Param2: '1/1/1800 12:00:00 AM' [DbType: DateTime | Size: 0 | Direction: Input | SourceColumn: st_pmtduedate | SourceVersion: Current]
Param3: 'heitlager@mindspring.com' [DbType: AnsiString | Size: 50 | Direction: Input | SourceColumn: st_email | SourceVersion: Current]
Param4: '0' [DbType: Double | Size: 0 | Direction: Input | SourceColumn: st_amountdue | SourceVersion: Current]
Param5: '' [DbType: AnsiString | Size: 254 | Direction: Input | SourceColumn: st_message | SourceVersion: Current]

Could it be a permission setting?  The problem is I have another asp.net site running in aes/onepay directory (es is in aes/es) without a proble. Now the web.config contains the <authentication mode="Windows" /> line, but the web.config for the other site is the same.

I apologize for the lengthy emails, I'm just trying to eliminate possibilities.

Thanks,

Marcel

By Greg McGuffey - 3/10/2009

I think this one got missed...bump.
By StrataFrame Team - 3/11/2009

Do you have an SMTP server that you can configure within the web.config file for the ES?  Whenever the ES returns an error 500, it's because it has thrown an unexpected exception.  The error handler within the ES catches those exceptions and emails the exception details to the address configured within the web.config.  Make sure that's configured, then try it again, and let me know what the exception says when it gets emailed to you.
By Marcel Heitlager - 3/11/2009

OK,

Got the smtp server working. Sent me the following message:

Enterprise Server Error

Message:

This server is not licensed to run on the requested hostname.

Client IP:

75.104.220.239

Details:

Exception
This server is not licensed to run on the requested hostname.

Source : MicroFour StrataFrame Enterprise Server

Stack Trace:
at MicroFour.StrataFrame.Enterprise.Server.RemoteDataSource.
ᜀ(String A_0)
at MicroFour.StrataFrame.Enterprise.Server.RemoteDataSource.ProcessRequest(HttpContext context)

On my end, the application is located at www.aeswebaccess.com/aes/es.  IIS shows the application name as es. I registered the ES with you as www.aeswebaccess.com/aes/es.  So, what did I do wrong?

Thanks,

Marcel

By Trent L. Taylor - 3/12/2009

That is the problem.  I have reset your account.  Set the hostname as www.aeswebaccess.com and try again.
By Marcel Heitlager - 3/14/2009

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOh!!!

So you mean to say that trying to solve the S&L, Mortgage, Banking, Detroit, Job, Economic, Iraq, Iran,  Afghanistan, Pakistan, and Uncle Stan crisis was redundant. All I needed to do was type www.aeswebaccess.com and that would have been enough.

You were right.  It works now!BigGrin

So next time, if anyone gets an error 500 or timeout, the first thing to do is check to see if you're even connecting to the server by checking status.aspx.  Then if you're running make sure your smtp server is up.  BTW - I wasn't getting any email messages because when I later checked the Event Viewer it said the mailbox wasn't available.  Make sure that the SMTP server allows relay messages from the localhost.  That allowed ES to send the email through, so I could receive the telltale error report.  (Of course everyone else allready knew that)

Thanks for the help guys,

Marcel

By Trent L. Taylor - 3/15/2009

Glad you got it going! BigGrin
By lastcanary - 3/16/2010

I have the same timeout problem. Could you please reset my account so that I can change my hostname?



Thanks
By Trent L. Taylor - 3/16/2010

Done. You should be good to go. Smile
By lastcanary - 3/16/2010

Unfortunately it didnt work.



Here is my code:



//-- Create the data source

EnterpriseDataSourceItem ds = new EnterpriseDataSourceItem("",

"192.168.1.147", 80, "MyDataSourceKey",

new SqlDataSourceItem("MyDataSourceKey"));



//-- Configure the compression and encryption (optional)

ds.IsCompressed = true;

ds.IsEncrypted = true;

ds.EncryptionKey = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4 };

ds.EncryptionVector = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };



//-- Add the EnterpriseDataSourceItem

DataLayer.DataSources.Add(ds);



The IP address of the server is 192.168.1.147.



Could youo please help?
By Trent L. Taylor - 3/17/2010

Well, your first problem is that you are using an IP address instead of a hostname. The host name is used not only for resolution, but for licensing. I have reset your account so that you can activate this again, but you will need to use a hostname versus an IP address. You can use the hosts file on your local machine to re-route the IP to a host name which will then allow you to work off of your local machine (or another internal machine) without the need for a direct IP connection.



Let's start here and we will see if that gets you going.
By lastcanary - 3/17/2010

Thank you for the answer. I dont know how to use hosts file. Could you please help?
By Trent L. Taylor - 3/18/2010

There are a ton of articles that you can find through a Google search. But in short, the hosts file short circuits the DNS for a host name. So if you wanted the domain "www.mydevmachine.com" to point to your localhost, then it would look like this in the hosts file:



127.0.0.1 www.mydevmachine.com




You can locate the hosts file here:



c:\windows\system32\drivers\etc\hosts