View Full Version : Why TU2 fails to connect, when server can be accessed via IE?
Elleah
06-08-2005, 03:06 AM
Hi,
I would like to ask what will be the possible reason or cause why TU2 fails to connect to the server, when it is verified that user can access the server via IE?
It has been said that TU2 automatically detects the proxy settings of the user. I didn't touch anything in the Proxy Setting, I've only pass a nil value into the ProxyData variable which is the default, isn't it? So that I can get the default proxy settings of the user.
I am just wondering why TU2 fails to connect? Do you have any idea about this?
Thanks for the help in advance.
Regards,
Elleah
Hi Elleah,
I'm not sure what the problem could be from the description you have given me. In order to figure out what the problem may I'll need you to answer a few questions:
1) How are you attempting to access the server files? What action are you using TrueUpdate.GetServerFile() or HTTP.Download()?
2) What does the log file say? (Enabled under Project | Options) The log file is usually a good source of information if something goes wrong in your TrueUpdate project. I.e. what is the error that you are receiving? Check Application.GetLastError() and HTTP.GetHTTPErrorInfo().
3) Are you using version 2.0.1.0?
Elleah
06-08-2005, 08:24 PM
Hi Mark,
Here are my answers to your questions:
1. At first I am using TrueUpdate.GetServerFile() to get the list of the server location. Once success, in my server script I was trying to get the file size of the Update file using HTTP.GetFileSize() action. I guess this is where it fails. Because I have out in an error message for this, once it fails.
2. Actually, I didn't look at the log file yet, I will be asking my user to send me acopy of it. I am only using HTTP.GetLastError().
3. Yes I am using version 2.0.1.0.
I hope this will help you.
Thanks,
Elleah
Hi Elleah,
From your last post I am unsure if you are checking HTTP.GetHTTPErrorInfo() or Application.GetLastError(), either way what is the error that you are getting?
Perhaps you could post the code that is causing the problem so that we can look at it and perhaps spot any issues.
Once you get the log file from your user post the relevant contents here.
Elleah
06-12-2005, 10:29 PM
Hi Mark,
Below is the snippet of my code, I am trying to read the Update file size on the server, but some of my user won't able to connect to the server.
function ReadStatus (Message)
StatusDlg.SetTitle("Please wait...");
StatusDlg.SetMessage("Connected to server");
StatusDlg.SetStatusText("Reading " ..g_UpdateFile.." from www.myserver.com");
end
g_UpdateSize = HTTP.GetFileSize("http://www.myserver.com/"..g_UpdateFile, MODE_BINARY, 30, 80, nil, nil, ReadStatus);
ErrResultUpdate = Application.GetLastError();
My user still doesn't forward the log file.
I hope this can help.
Thanks,
Elleah
Hi Elleah,
We still need to now what the value of the error code that you are getting is, what is the value of ErrResultUpdate? Is it used to display an error message? If so what is that error message? If not what do you do with ErrResultUpdate?
Is it possible that g_UpdateFile may be set incorrectly? How do you set this value?
I could not see anything wrong with your script other then the fact that your callback function should return true or false.
i.e.
return not(StatusDlg.IsCancelled());
or
return true;
Elleah
06-13-2005, 08:47 PM
Hi Mark,
I'm still waiting for the logfile from our user, because here in my PC I can't replicate the problem. What I am doing in the ErrResultUpdate, is trying to display the error message, as below:
SessionVar.Set("%ErrorMessage%", "An error occured while reading file size".."\r\n".._tblErrorMessages[ErrResultUpdate]);
I do set the g_UpdateFile as follow:
g_UpdateFile = "MyUpdate.zip";
I think it doesn't have anything to do with g_UpdateFile.
Thanks.
Elleah
06-14-2005, 04:15 AM
Hi Mark,
Attached is the Update Log File of the user, for your reference.
And the Script under my Status Dialog is as below:
1 --Shows the status dialog
2 function ReadStatus (Message)
3 StatusDlg.SetTitle("Please wait...");
4 -- StatusDlg.ShowProgressMeter(true);
5 -- StatusDlg.SetMeterRange(1,100);
6 -- StatusDlg.SetMeterPos(35);
7 StatusDlg.SetMessage("Connected to server");
8 -- StatusDlg.SetMeterPos(70);
9 StatusDlg.SetStatusText("Reading " ..g_UpdateFile.." from www.ihgibp.com");
10 -- StatusDlg.SetMeterPos(100);
11 end
12
13 --Shows the Status Dialog
14 StatusDlg.Show(0, false);
15 StatusDlg.ShowProgressMeter(false);
16
17 --Script for getting the file size of update files in the server
18 if (g_index == 1) then
19 g_UpdateSize = HTTP.GetFileSize("http://www.myserver.com/tu2/"..g_UpdateFile, MODE_BINARY, 30, 80, nil, nil, ReadStatus);
20 g_UpdateSize = Math.Round((g_UpdateSize/1000000),2).." MB";
21
22 g_FullSize = HTTP.GetFileSize("http://www.myserver.com/tu2/"..g_FullUpdateFile, MODE_BINARY, 30, 80, nil, nil, ReadStatus);
23 g_FullSize = Math.Round((g_FullSize/1000000),2).." MB";
24 -- Dialog.Message("File Size",g_FullSize);
25 else
26 g_UpdateSize = FTPWI.GetFileSize("ftp.myserver.com"..g_UpdateFile, "anonymous", "anonymous@anonymous.com", MODE_BINARY, 30, 21, true, ReadStatus);
27 g_UpdateSize = Math.Round((g_UpdateSize/1000000),2).." MB";
28
29 g_FullSize = FTPWI.GetFileSize("ftp.myserver.com"..g_FullUpdateFile, "anonymous", "anonymous@anonymous.com", MODE_BINARY, 30, 21, true, ReadStatus);
30 g_FullSize = Math.Round((g_FullSize/1000000),2).." MB";
31 -- Dialog.Message("File Size",g_UpdateSize);
32 end
The error Script: Status Dialog, Line 11 (2502) quite confuse me, because line 11 only contain end.
And by the way, what does error code 3602 means, it is not listed on the lists of error codes.
Thanks,
Elleah
Hi Elleah,
I have noticed three things form looking at your script and your log file:
1) Your HTTP callback function does not return a value. From the Help File: "The callback function should return a Boolean value (true or false) indicating whether the download should continue." This means that after the callback function is called, TrueUpdate will check the last value on the stack to determine whether or not it should continue. Since you are not specifying any value the results are unpredictable.
I would advise that you update your script to return a true or a false.
2) You are getting error 2502, which is a "Could not open request error." This is a slightly strange error that basically means that the Internet connection failed open our request for the HTTP file. This occurs very early on in the download stage before any downloading actually occurs.
It can occur for a variety of reasons, which should be stored in the HTTP.GetHTTPErrorInfo() table. There is a chance that this error is being caused by what I have mention in reason 1. (i.e. The callback is causing the open request to cancel)
3) You are never checking to see if any of the GetFileSize actions fail, i.e. return –1. You should get in the habit of checking the return value from the GetFileSize actions, and if it fails, either log the HTTP.GetHTTPErrorInfo() to your log file, or display it on the screen for your user.
The reason that the error code line is being reported as line 11 is because of the callback function. Occasionally callback functions will throw off the error code line numbering. This may also mean that the error is occurring in your callback function, although the only possible error that I could see would be that g_UpdateFile is equal to nil.
Error 3502 is: "An error occurred while executing the server script." I have made an entry into our bug database to get that error code added to the documentation.
Try updating your script with my suggestions, and see if that fixes the problem.
Elleah
06-14-2005, 08:43 PM
Hi Mark,
Yesterday, I have already incorporated your suggestion in my script. I've placed a return value of true in my call back function and get the Application.GetLastError(). I am still waiting for the result with the user.
I have also noticed that when I am using a HTTP.GetHTTPErrorInfo(), why is it that it is returning an error code 0 and telling that process was successfully completed, when I've checked using the Application.GetLastError() that the problem was the URL can't be found. Why does the HTTP.GetHTTPErrorInfo() can't actually get the real error taht occurs. Do you have any suggestion with this?
Thanks,
Elleah
Hi Elleah,
HTTP.GetHTTPErrorInfo() should contain correct error information after an HTTP action, but if you use it be sure to check both the number and the status.
In your case I'm guessing that the number is 0 and that status is 404. The reason that the number is 0 in this case is because to WinInet, no "error" has occurred, the connection to the server was made and the server returned status 404 (file not found) but the attempt did not fail.
Remember that the number value is not a TrueUpdate error code, it is the WinInet error code.
If you are concerned about this try using this action as demonstrated in the help file:
HTTP.Download("http://www.asitehere.com/file.ext", "c:\\file.ext",MODE_BINARY, 20, 80, nil, nil, nil);
if (Application.GetLastError() ~= 0) then
local http_error = HTTP.GetHTTPErrorInfo();
local error_text = http_error.Message .. "\r\nServer Status: " .. http_error.Status;
Dialog.Message("HTTP Error: " .. http_error.Number, error_text, MB_OK, MB_ICONEXCLAMATION);
end
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.