Foxx import from another app in a periodic job throws error on Windows 7

51 views
Skip to first unread message

Mihaela

unread,
Feb 3, 2016, 4:24:49 AM2/3/16
to ArangoDB
Hello,

I have installed ArangoDB 2.7.3 on Windows 7, 64 bit.

I have an use case where one Foxx application A exposes some functionality in a repository that I want to use in another Foxx application B so that I do not have to duplicate that particular code. The application B actually starts a job that is triggered periodically which calls the exported functionality from A. The problem is that sporadically the job throws an error that it does not find the exported module..but after a while it recovers.

I have added the two applications on Github: https://github.com/mphoenixo/arangodb.git

Has anyone experienced this before? I have built the applications using the documentation from ArangoDB but maybe I'm still missing something.


The stacktrace for the error follows:

2016-02-02T15:48:56Z [7380] ERROR TypeError: Cannot read property 'repo' of undefined
2016-02-02T15:48:56Z [7380] ERROR   at d:/install/ArangoDB 2.7.3/var/lib/arangodb-apps/_db/DataPushLandingZone/foxx-import-app-example/APP/scripts/myJob.js:3:25
2016-02-02T15:48:56Z [7380] ERROR   at [object Object].Module.run (D:\install\ArangoDB 2.7.3\bin\../share/arangodb/js/common/bootstrap/modules.js:1420:10)
2016-02-02T15:48:56Z [7380] ERROR   at ArangoApp.loadAppScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:458:24)
2016-02-02T15:48:56Z [7380] ERROR   at executeAppScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:510:18)
2016-02-02T15:48:56Z [7380] ERROR   at Object.runScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:814:10)
2016-02-02T15:48:56Z [7380] ERROR   at Object.exports.work (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/queues/worker.js:118:8)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:6:60)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:9:15)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:9:27)
2016-02-02T15:48:56Z [7380] ERROR 
2016-02-02T15:48:56Z [7380] ERROR Running script "MyJob" not possible for mount "/foxx-import-app-example":
2016-02-02T15:48:56Z [7380] ERROR TypeError: Cannot read property 'repo' of undefined
2016-02-02T15:48:56Z [7380] ERROR   at d:/install/ArangoDB 2.7.3/var/lib/arangodb-apps/_db/DataPushLandingZone/foxx-import-app-example/APP/scripts/myJob.js:3:25
2016-02-02T15:48:56Z [7380] ERROR   at [object Object].Module.run (D:\install\ArangoDB 2.7.3\bin\../share/arangodb/js/common/bootstrap/modules.js:1420:10)
2016-02-02T15:48:56Z [7380] ERROR   at ArangoApp.loadAppScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:458:24)
2016-02-02T15:48:56Z [7380] ERROR   at executeAppScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:510:18)
2016-02-02T15:48:56Z [7380] ERROR   at Object.runScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:814:10)
2016-02-02T15:48:56Z [7380] ERROR   at Object.exports.work (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/queues/worker.js:118:8)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:6:60)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:9:15)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:9:27)
2016-02-02T15:48:56Z [7380] ERROR 
2016-02-02T15:48:56Z [7380] ERROR Job 47455086883 failed:
2016-02-02T15:48:56Z [7380] ERROR [ArangoError 3103: failed to invoke module
2016-02-02T15:48:56Z [7380] ERROR File: d:/install/ArangoDB 2.7.3/var/lib/arangodb-apps/_db/DataPushLandingZone/foxx-import-app-example/APP/scripts/myJob.js]
2016-02-02T15:48:56Z [7380] ERROR   at [object Object].Module.run (D:\install\ArangoDB 2.7.3\bin\../share/arangodb/js/common/bootstrap/modules.js:1425:20)
2016-02-02T15:48:56Z [7380] ERROR   at ArangoApp.loadAppScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:458:24)
2016-02-02T15:48:56Z [7380] ERROR   at executeAppScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:510:18)
2016-02-02T15:48:56Z [7380] ERROR   at Object.runScript (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:814:10)
2016-02-02T15:48:56Z [7380] ERROR   at Object.exports.work (d:/install/ArangoDB 2.7.3/share/arangodb/js/server/modules/org/arangodb/foxx/queues/worker.js:118:8)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:6:60)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:9:15)
2016-02-02T15:48:56Z [7380] ERROR   at eval (<anonymous>:9:27)

Thanks,
Mihaela

Mihaela

unread,
Feb 8, 2016, 4:42:21 AM2/8/16
to ArangoDB
I have retried this on Arango 2.8.1 and I did not see this error anymore so it might have been fixed. I'll keep it under observation.

Alan Plum

unread,
Feb 9, 2016, 4:53:16 AM2/9/16
to ArangoDB
Hi Mihaela,

theoretically this could happen if a job is executed after a restart before Foxx is initialised. However importing the Foxx service should force it to be loaded even if it wasn't loaded at the time, so this Should Never Happen (TM).

If you can reproduce this problem on 2.8.x, please open a GitHub issue with steps to reproduce. This kind of edge case tends to be notoriously difficult to debug.


Cheers,

Alan
Reply all
Reply to author
Forward
0 new messages