timed out errors on Android

I’m having terrible issues on Android, I’m very often getting ‘timed out’ errors for a messaging system I’ve built, but the weird thing is; this is inconsistent with iOS which seems ok.

I’m using coronium:run to call a server function which amongst other things calls coronium.mongo:getObject , coronium.mongo:updateObject or  coronium.mongo:createObject depending on various things.

Where can I start in debugging this for Android if ios is ok? Are there any known issues that might cause this either on the Coronium side or the Corona SDK side?

Hi,

What version does your control panel read, and where are you hosting?

Cheers.

Hi Chris. I guess it’s Beta 1.92 if the bottom left version is what’s to go by (?) …

Hi,

I’ve had no other reports of this issue specifically, and with what info you’ve provided it’s a little ambiguous what could be triggering the timeout. I would think about moving up to a more recent version.

Are you seeing anything in the error log?

cat /home/coronium/logs/error.log

Let me know.

Cheers.

Have you done a tutorial or some instructions on how to update to the latest version? I’m on DigitalOcean with 1.92.

There were some entries in the error.log but they seemed old so I cleared and re-saved it. I’m guessing that’s how you clear it right? Now none are coming up but the problem obviously persists. I’ll keep an eye on the log.

Hi.
I checked the error log and saw this today. Any idea what it means? Could this be my problem?

2016/03/30 22:20:18 [error] 10705#0: \*67981 access forbidden by rule, client: 95.45.254.121, server: , request: "GET /1/code/createUser HTTP/1.1", host: "104.236.57.1" 2016/03/30 23:29:38 [error] 10705#0: \*67982 access forbidden by rule, client: 86.47.80.146, server: , request: "GET /1/code/createUser HTTP/1.1", host: "104.236.57.1"

Also, would you be able to instruct me on how to update Coronium?
Cheers

Hi Julius,

What data storage are you using? Just Mongo? or MySQL as well?

I’ll put together some notes for moving to an updated version.

Cheers.

@develephant. Yea, it’s just Mongo I’m using.
If it helps you to help me, I’m happy to send you my server lua functions? I’d really appreciate getting past this bug.

Do you have any notes for me on moving to an updated Coronium version?

Cheers.

Hi,

For Mongo its pretty simple, you need to log in SSH and:

sudo mongodump -o mongo-coronium.bson

move the .bson file on the new box, import:

sudo mongorestore mongo-coronium.bson

You should then only need to move your cloud code.

Let me know if you run into any problems. I am fairly sure your error is permissions based. But that’s being addressed in the next release.

Cheers.

I’m having the same problem juliusbangert is having. Odd thing is that I am running another app, pointing to the same coronium server, and it connects no problem. iOS connects without a problem too. So does the simulator, no problem. But one of my apps gets a “timed out” error whenever it tries to connect with the android version of the app. I don’t see anything in the error report at /home/coronium/logs/error.log. 

Also, my permissions for android in build settings are:

"android.permission.INTERNET",
            “android.permission.ACCESS_NETWORK_STATE”,
            “android.permission.WRITE_EXTERNAL_STORAGE”,

I’m running Coronium 1.93.1.

Hi,

Can you let me know what your Corona Simulator version is?

Thanks.

Hi Chris.

I only just noticed your reply about doing a Coronium update, thanks. Please could you explain a bit more…

So far I have made an SSH connection to the Coronium server and run the following two commands after each other…

sudo mongodump -o mongo-coronium.bson

sudo mongorestore mongo-coronium.bson

 

Is that correct? What do I need to do next?

Will this fix the permissions based error you suspect is my problem?

I’m running Version 2016.2861 (2016.4.9).

Hi,

@julius - Do you mind sending me  your cloud file. I think I might have a lead on the issue (chris at coronalabs dot com). 

@loyola - Are you calling cloud code when you have the timeout issue?

Let me know.

Cheers.

@develephant. I’ve sent you the server lua files. Cheers.
__________________________________________________

With regards to the update; I just ran these two commands :

sudo mongodump -o mongo-coronium.bson

sudo mongorestore mongo-coronium.bson

Is that enough? Or was there something else I had to do? Restart server or something?

Hi Julius,

I have been working through a transfer script and it is a bit more complicated (with my apologies, the info I gave you about Mongo will not give the output we need). Some of the data is stored in the MySQL database, as well as a few config files that have to be moved. 

Let me look at the code first, I have a couple Coronium boxes running to do some comparisons. It could be a simple client issue since the core and the client have fragmented some. 

I’m running the corona sdk code for appOpen and addEvent in particular. Using http://docs.coronium.io/en/latest/client/Analytics/

The code in question works as desired in both the simulator and ios devices. I also used identical code on another app and it also works on android there. Although my build settings are described in my initial post, it makes me wonder if there is some obscure setting in Android that won’t let me make an API call from the client to my AWS cloud based (ubuntu) server where I’m running coronium.

@loyola - I have started on a massive quest to figure this out, and appreciate your input. And, I too suspect something with Android, but have nothing concrete to back it up with yet.

These are the harder ones to debug, because if it works on other platforms, it should work on all the platforms. And nothing has really changed in that area of the code base.

I’ve got my phone all tethered up to the Android monitor (Wi-Fi off) and can get a successful round-trip on Android 6.0.1 with Coronium 1.92 (which it should), I was watching the device logs and the data is returned.

[lua]

05-09 10:08:58.457: I/Corona(31616): result:

05-09 10:08:58.458: I/Corona(31616):    user:

05-09 10:08:58.458: I/Corona(31616):       profile:

05-09 10:08:58.458: I/Corona(31616):          accessId: 

… (and so on)

[/lua]

I don’t have any other Android versions to test on, so there could be something there. My test is also imperfect because what I really need is a compiled APK that throws the error. Because it could also be caused by some other element that the Coronium client isn’t playing nice with.

@loyola - Julius is on DigitalOcean, and your on AWS so it’s probably not a host issue.

@develephant, appreciate you looking into this. I can zip or tarball either my project code or a compiled APK and give you the url to it if you’re able to email me offline. Are you able to access my email in the system?