Network connection lost error

Hi guys, I am just starting out and installed Coronium on Digital Ocean (Ubuntu) last night.  I can log into my Admin just fine.  When I tried to run the below simple codes:

local mc = require( “mod_coronium” )

mc:init({ appId = “104.236.92.29”, apiKey = “myAPI Key” })

mc:appOpened()

I get this error:

2016-04-01 22:43:22.764 Corona Simulator[990:26305] ERROR: network request failed: http://104.236.92.29/1/analytics/opened [-1005: The network connection was lost.]

Apr 01 10:43:22.765: error: Timed out

Apr 01 10:43:22.766: errorCode: -1

Can anyone please give me some ideas about what might be causing this problem, and where I should begin looking?    I’m just starting out so don’t really have any idea what’s happening here.   :huh:

PS. Do I need to add a domain first for this to work?  Currently I don’t have a domain name yet.

Hi,

That’s odd, the code looks good. And no, you don’t need a domain name.

It sounds like you are probably running 1.93.5, do you have the latest client as well?

https://bitbucket.org/develephant/mod_coronium/get/default.zip

I’ll also take a look. Thanks for reporting.

Cheers.

Hi Chris

Did you solve this? I just setup a new install on Digital Ocean and it all seems fine except in terms of being able to ssh in etc. but I get the same errors.

ERROR: network request failed: http://104.111.11.11/1/analytics/opened[-1005: The network connection was lost.] 

error: Timed out

errorCode: -1

 

(I changed the IP address as I didn’t want to post the the real IP. )

 

Chris

Hi,

So I am still trying to figure out exactly why this issue is happening, but it seems if you reload Coronium at least once, then it starts working, even on subsequent server reboots.

Try logging in as your coronium user and issue the following on the command line:

sudo service coronium reload

And then try your app again. Let me know if that changes anything.

Cheers.

Yeah that seems to fix it.

Hi,

That is a temporary solution of course. I’m marking it as a bug.

Thanks for reporting.

Cheers.

There is something strange though with the Digital Ocean setup, when I add a user it adds it ok but id I manually delete it from the coronium cloud admin I get ‘Could not be deleted.’ but the user has been deleted. It started acting weird when updating cloud code as well by not running the updated code even though I checked on the server that the code had changed.

I don’t get any of this on the EC2 AWS setup

Hi,

Yeah, I saw the ‘could not delete’, its on the fix list.

The major issue seems to have to do with the Lua code cache. Which was recently turned on by default (that was not the case before a month ago), so try:

sudo coronium-tools cacheoff

If that doesn’t work, try direct:

sed ‘/s/lua_code_cache on;/lua_code_cache off;/’ -i /usr/local/openresty/nginx/conf/nginx.conf

Reboot, try again. 

The AWS images are generally locked at a version, the Ubuntu installer will always be bleeding edge. Something to consider.

Most of this should be resolved soon with the next major release.

Cheers.

I get this error on  sed ‘/s/lua_code_cache on;/lua_code_cache off;/’ -i /usr/local/openresty/nginx/conf/nginx.conf

sed: -e expression #1, char 5: extra characters after command

Try it without the semi-colons.

Cheers

same

Hi,

I think I see the issue; me typing to hastily.  :unsure:

Try:

sudo sed ‘s/lua_code_cache on/lua_code_cache off/’ -i /usr/local/coronium/conf/coronium.conf

yeah makes sense now, and it works :slight_smile:

Hi Chris,

I seem to be having the same issue. I was finally able to get the HTTPS issue resolved but now having a new issue.

It seems to be attempting to call “http://” rather than “https://”. Note: app opened seems to be working, seems this is happening after calling mc:run. 

I have tried the steps in the thread above and verified I’m using the latest mod_coronium.lua file.

local mc = require( “mod_coronium” )

mc:init({ appId = globals.appId, apiKey = globals.apiKey, https = true })

mc:appOpened()

 

ERROR: network request failed: http://___my IP address here____/1/code/checkForUser [-1004: Could not connect to the server.]

error: Timed out

errorCode: -1

Runtime error

…(stack traceback details)…

result: Opened

 

Thanks,

Jeremiah

Hi,

That’s odd, the code looks good. And no, you don’t need a domain name.

It sounds like you are probably running 1.93.5, do you have the latest client as well?

https://bitbucket.org/develephant/mod_coronium/get/default.zip

I’ll also take a look. Thanks for reporting.

Cheers.

Hi Chris

Did you solve this? I just setup a new install on Digital Ocean and it all seems fine except in terms of being able to ssh in etc. but I get the same errors.

ERROR: network request failed: http://104.111.11.11/1/analytics/opened[-1005: The network connection was lost.] 

error: Timed out

errorCode: -1

 

(I changed the IP address as I didn’t want to post the the real IP. )

 

Chris

Hi,

So I am still trying to figure out exactly why this issue is happening, but it seems if you reload Coronium at least once, then it starts working, even on subsequent server reboots.

Try logging in as your coronium user and issue the following on the command line:

sudo service coronium reload

And then try your app again. Let me know if that changes anything.

Cheers.

Yeah that seems to fix it.

Hi,

That is a temporary solution of course. I’m marking it as a bug.

Thanks for reporting.

Cheers.

There is something strange though with the Digital Ocean setup, when I add a user it adds it ok but id I manually delete it from the coronium cloud admin I get ‘Could not be deleted.’ but the user has been deleted. It started acting weird when updating cloud code as well by not running the updated code even though I checked on the server that the code had changed.

I don’t get any of this on the EC2 AWS setup