1
votes

I have created a foxx app for a mobile app I am working on. But, the URL's I have exposed sometimes work correctly but sometimes they fail with following response:

{"error":true,"code":404,"errorNum":404,"errorMessage":"unknown path 'contactspace/initiateRegistration'"}

I did not face this issue when I tested the app in dev environment. I am not able to figure the reason for the issue. How can I debug the problem ?

Thanks,

Vikas Tandi

1
Have you consulted the server's log for any errors? A 404 might occur if there is an error in a route and the application cannot be mounted. Your log will be full of errors in this case, revealing the place the error initiated from. - stj
I have looked at logs at /var/log/arangodb/arangod.log. For successful calls there are no errors in logs and in case of 404 there are no log entries. If there are any issues why it will work sometimes. Ideally it should not work a single time. - Vikas Tandi
Are you using the development mode, or are you using the production mode? Did you try logging inside the route to see if it is triggered at all via require('console').log()? What do you mean by "Ideally it should not work a single time"? - moonglum
in case of development mode it is working fine. The intermittent failures are coming in case of production environment. Yes I am logging info in every action. So, for example in case of action initiateRegistration the following information is getting logged:2014-12-05T15:08:03Z [2584] INFO starting the action initiateRegistration.The request json : {"phoneNumber":"8106466688","country":"India"} 2014-12-05T15:08:03Z [2584] INFO initiate registration node created : {"_id":"contactspace_contactCard/313476971915","_rev":"313476971915","_key":"313476971915"} - Vikas Tandi
But. sometimes the action fails with response { "error": true, "code": 404, "errorNum": 404, "errorMessage": "unknown path 'contactspace/initiateRegistration'" } to the calling code and for this failed call there are no log entries. So, the action sometimes works properly with successful log entries but sometimes fails with above error. Hope it's clear now. - Vikas Tandi

1 Answers

1
votes

I can finally confirm it was a problem that had nothing to do with the actual code of your Foxx application.

We have been struggling to reproduce the issue for quite a while, but were able to do so and fix the problem today.

A fix for this has been pushed in the 2.3, 2.4 and devel branches, and will be shipped with ArangoDB 2.3.5, 2.4.1 and 2.5.