core.data.get mongo problem..

Hi - I think the Mongo problem still exists. I am trying to get data on the client side via a simple query, and I keep getting this error: Internal error. Check server log.

Here is the code I used:

local function apiListener( evt )

  if evt.error then

    print(evt.error)

  else

    print(evt.result) – result holds the data object

  end

end

core.data.get({source=“drivers”, query={loopRoute = “Bondi Beach”} }, apiListener)

Please advise,

Thanks

I am using the latest 2.4 version with the patch applied

Hi,

I’ll take a look.

-dev

Hi,

So I just ran some tests, and everything is responding as it should.

From the client, a save:

local function onResponse(e) core.debug(e) end core.data.save({source="drivers", data = { loopRoute = "Bondi Beach" }}, 

(core.debug is a handy tool, FYI.)

And I was able to successfully retrieve it with:

local function onResponse(e) core.debug(e) end core.data.get({source="drivers", query={ loopRoute = "Bondi Beach" }}, onResponse)

result: \_id: 5a774aceecf04f5605000001 loopRoute: Bondi Beach

So, what makes this a bit difficult is not knowing your data structure of the return. A few things to try:

Do any of the logs show a message that might provide information on the failed query?

Are you able to recreate the scenario I demonstrated above?

Are you creating the records on the server-side, or via the client-side data module? If you create them server-side, it is best to run your queries server-side using the full Mongo module with the find method.

Is the Mongo server running? You can check this by logging in as the coronium user and then on the command line run:

coronium status

If Mongo is not running, which can happen rarely during updates, then as the coronium user reboot to see if it will pop back up:

sudo reboot -h

After the reboot, log back in and check the status again.

If those items fail to resolve, or point to any possible reason for the issue, then the next step is to move over to my support email (which I will send to you through a DM), and I can look at the server directly. This generally involves temporarily changing the coronium user password. (I do this often for users, and I’m fully qualified :wink: ).

Let me know.

-dev

Thanks for that. In answer to your questions:

  • Put in debug code - it gives me this:

error: Internal error. Check server log.

                    status: 500

                    tt: 514.112

  • Running this on client side.

  • Checked if Mongo was running and it gave me this:

>> Checking process nginx…

 

nginx IS Running.

 

 

 

 

 

 

I just tried running your example on its own and it still gave me this error when trying to retrieve it:

Feb 05 09:43:47.343 error: Internal error. Check server log.

                    status: 500

                    tt: 215.736

Feb 05 09:43:47.397 error: Internal error. Check server log.

Feb 05 09:43:47.397 status: 500

                    tt: 160.251

It did save the record, but can’t get the record.

I have also secured my server (i.e. HTTPS webmin)

Hi,

Well, something is certainly not right on the server. I’m sending you my support email, I’d like to take a look.

-dev

I am using the latest 2.4 version with the patch applied

Hi,

I’ll take a look.

-dev

Hi,

So I just ran some tests, and everything is responding as it should.

From the client, a save:

local function onResponse(e) core.debug(e) end core.data.save({source="drivers", data = { loopRoute = "Bondi Beach" }}, 

(core.debug is a handy tool, FYI.)

And I was able to successfully retrieve it with:

local function onResponse(e) core.debug(e) end core.data.get({source="drivers", query={ loopRoute = "Bondi Beach" }}, onResponse)

result: \_id: 5a774aceecf04f5605000001 loopRoute: Bondi Beach

So, what makes this a bit difficult is not knowing your data structure of the return. A few things to try:

Do any of the logs show a message that might provide information on the failed query?

Are you able to recreate the scenario I demonstrated above?

Are you creating the records on the server-side, or via the client-side data module? If you create them server-side, it is best to run your queries server-side using the full Mongo module with the find method.

Is the Mongo server running? You can check this by logging in as the coronium user and then on the command line run:

coronium status

If Mongo is not running, which can happen rarely during updates, then as the coronium user reboot to see if it will pop back up:

sudo reboot -h

After the reboot, log back in and check the status again.

If those items fail to resolve, or point to any possible reason for the issue, then the next step is to move over to my support email (which I will send to you through a DM), and I can look at the server directly. This generally involves temporarily changing the coronium user password. (I do this often for users, and I’m fully qualified :wink: ).

Let me know.

-dev

Thanks for that. In answer to your questions:

  • Put in debug code - it gives me this:

error: Internal error. Check server log.

                    status: 500

                    tt: 514.112

  • Running this on client side.

  • Checked if Mongo was running and it gave me this:

>> Checking process nginx…

 

nginx IS Running.

 

 

 

 

 

 

I just tried running your example on its own and it still gave me this error when trying to retrieve it:

Feb 05 09:43:47.343 error: Internal error. Check server log.

                    status: 500

                    tt: 215.736

Feb 05 09:43:47.397 error: Internal error. Check server log.

Feb 05 09:43:47.397 status: 500

                    tt: 160.251

It did save the record, but can’t get the record.

I have also secured my server (i.e. HTTPS webmin)

Hi,

Well, something is certainly not right on the server. I’m sending you my support email, I’d like to take a look.

-dev