gerbil / auto-update-apk-client

Automatically exported from code.google.com/p/auto-update-apk-client
0 stars 0 forks source link

Connect to server timed out #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Added auto-update-apk code.  For testing purposes, changed update interval 
to 3 minutes
2.  Run app with new code to tablet.  See md5sum, the same one listed in the 
applications section in my account
3.  Updated my app, and then uploaded the new apk to account
4.  3 minutes later, see app attempt to check if there's update on the server

What is the expected output? What do you see instead?
I expected the app to be able to successfully contact the server, but on all 
subsequent attempts I get:

"Connect to /173.194.72.121.:80 timed out" or "Connect to /74.125.31.121:80 
timed out"

What version of the product are you using? On what operating system?
AutoUpdateApk.java is from client version 1.7, my tablet is running on Android 
4.3

Please provide any additional information below.

Original issue reported on code.google.com by stephen...@gmail.com on 16 Jul 2014 at 12:02

GoogleCodeExporter commented 9 years ago
I don't see any error messages in the logs, and the servers are getting steady 
traffic for the last 24 hours, there are no sudden drops or visible problems.

Please, check your internet connectivity, can you open google.com from your 
tablet? Can you open auto-update-apk.com from your tablet using browser?

Original comment by lenik.terenin on 16 Jul 2014 at 5:23

GoogleCodeExporter commented 9 years ago
I'm currently in Shanghai, so just thought to try access with VPN, and that 
worked.  Why the heck would this site be blocked by PRC...  I'm also having to 
turn on VPN to access http://www.auto-update-apk.com/  

Where are your servers located?

Original comment by stephen...@gmail.com on 16 Jul 2014 at 6:06

GoogleCodeExporter commented 9 years ago
Servers are located at Google, this might be an issue with PRC.

Unfortunately, this project heavily relies on Google infrastructure of 
distributed high-availability servers, and replicating this infrastructure is 
prohibitively expensive so there's nothing I can really do about it, sorry.

Original comment by lenik.terenin on 16 Jul 2014 at 6:22

GoogleCodeExporter commented 9 years ago
That explains it...  I'm screwed.  Any other solution you'd recommend?  Or 
anyway we can setup for it to go through another non-google server first, such 
as AliCloud?

Original comment by stephen...@gmail.com on 16 Jul 2014 at 6:29

GoogleCodeExporter commented 9 years ago
If you have a server that you can access from your current location, you may 
write a simple script, that will parse parameters and reply "update" or "no 
update" to the /check request, and append an URL to the updated .apk if there's 
one available -- this way you may use AutoUpdateAPK classes without any changes 
(except the different URL to your server).

Original comment by lenik.terenin on 16 Jul 2014 at 6:47

GoogleCodeExporter commented 9 years ago
I'm trying to understand how this would work:

1.  Tablet still runs SilentAutoUpdate, but instead of going to Google server, 
it goes to our own server.  This presumably would require a small change to 
AutoUpdateApk.
2.  The script on our server receives the request from tablet, and replies with 
either an update or no update.  How would the script know if a new .apk exists? 
 Would it check with your server?
3.  If a new update exists, our script appends an URL which tells 
SilentAutoUpdate where to get the updated .apk.  Is this URL for downloading 
the updated .apk is also on our server?

Really appreciate your time in helping to make this work for us.  

Original comment by stephen...@gmail.com on 16 Jul 2014 at 7:18

GoogleCodeExporter commented 9 years ago
You don't have to check with our server, everything happens on your server.

Tablet still runs SilentAutoUpdate class, but you have to replace the URL with 
the URL to your own server. How you will upload updates to your server I don't 
know, maybe ftp or scp or any other way. How your script will check if update 
is available -- I'd calculate checksums or check if there's a new version or 
something like that, again, you have to do it all yourself. AutoUpdateAPK class 
will provide you the current MD5 sum and version as parameters (check $_POST 
variable if writing script in PHP).

If there's no update, script just says back "no update".

If there's an update, script says back two lines:

have update
http://yourserver.com/somedir/updated_apk_2014-07-16.apk

The second line is the URL where the updated file can be downloaded from.

You may change the request and response formats, but you will need to change 
AutoUpdateAPK class as well.

Original comment by lenik.terenin on 16 Jul 2014 at 8:02

GoogleCodeExporter commented 9 years ago
Great, that gets me in the right direction.  Thanks again for your help.

Original comment by stephen...@gmail.com on 16 Jul 2014 at 8:28

GoogleCodeExporter commented 9 years ago
Great, that gets me in the right direction.  Thanks again for your help.

Original comment by stephen...@gmail.com on 16 Jul 2014 at 8:28