0

I'm attempting to test ArangoDB with its Java driver. I'm testing it on CentOS 6.6. I've been getting the following error:

15:48:01.151 [main] DEBUG com.arangodb.http.HttpManager - [REQ]http-POST: url=http://127.0.0.1:8529/_api/gharial?waitForSync=true, headers=null, body={"name":"test","edgeDefinitions":[{"collection":"FriendsWith","from":["Profile"],"to":["Profile"]}],"orphanCollections":[]}
15:48:01.267 [main] DEBUG com.arangodb.http.HttpManager - [RES]http-POST: statusCode=503
15:48:01.269 [main] DEBUG com.arangodb.http.HttpManager - [RES]http-POST: text=<html><head><title>Service Unavailable</title></head><body><p>This service is temporarily not available. Please check the log file for errors.</p></body></html>
Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
    at com.google.gson.JsonParser.parse(JsonParser.java:65)
    at com.google.gson.JsonParser.parse(JsonParser.java:45)
    at com.arangodb.BaseArangoDriver.createEntity(BaseArangoDriver.java:209)
    at com.arangodb.BaseArangoDriver.createEntity(BaseArangoDriver.java:309)
    at com.arangodb.impl.InternalGraphDriverImpl.createGraph(InternalGraphDriverImpl.java:80)
    at com.arangodb.ArangoDriver.createGraph(ArangoDriver.java:4242)
    at Program.main(Program.java:76)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1573)
    at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1423)
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:546)
    at com.google.gson.stream.JsonReader.peek(JsonReader.java:429)
    at com.google.gson.JsonParser.parse(JsonParser.java:60)
    ... 11 more

Process finished with exit code 1

I've attempted to reboot the service as well as reinstalling. The log file contains the following lines:

2015-08-12T08:06:27Z [22123] ERROR TypeError: Cannot read property 'save' of undefined                                   
2015-08-12T08:06:27Z [22123] ERROR   at createQueue (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/queues.js:109:15)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/queues.js:394:1               
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)               
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)          
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:755:21)             
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                  
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx.js:33:18                           
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)    
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)                   
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)              
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:772:21)                 
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                  
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:32:24                       
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:1395:2                      
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)    
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)           
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9                             
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)                                                                               
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)                 
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)            
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)                  
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)                       
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)           
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)            
2015-08-12T08:06:27Z [22123] ERROR                                                                                                           
2015-08-12T08:06:27Z [22123] ERROR [ArangoError 3103: failed to invoke module                                                                
2015-08-12T08:06:27Z [22123] ERROR File: /usr/share/arangodb/js/server/modules/org/arangodb/foxx/queues.js]                                  
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1420:20)              
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)                             
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)                        
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:755:21)                           
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)          
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                            
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx.js:33:18                                     
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)              
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)                             
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)                        
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:772:21)                           
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)          
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                            
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:32:24                                 
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:1395:2                                
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)              
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)
2015-08-12T08:06:27Z [22123] ERROR
2015-08-12T08:06:27Z [22123] ERROR [ArangoError 3103: failed to invoke module
2015-08-12T08:06:27Z [22123] ERROR File: /usr/share/arangodb/js/server/modules/org/arangodb/foxx.js]
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1420:20)
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:772:21)
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:32:24
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:1395:2
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)
2015-08-12T08:06:27Z [22123] ERROR
2015-08-12T08:06:27Z [22123] ERROR Cannot compute Foxx application routes: [ArangoError 3103: failed to invoke module\nFile: /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js]
2015-08-12T08:06:27Z [22123] ERROR [ArangoError 3103: failed to invoke module
2015-08-12T08:06:27Z [22123] ERROR File: /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js]
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1420:20)
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)
2015-08-12T08:06:27Z [22123] ERROR
navewein
  • 1
  • 2
  • Can you follow the advice and have a look at the logfile? Which arangoDB version are you using? Which way did you install it? The problems may relate to arangodb not being able to access the files in the js/ folder in a proper way. – dothebart Aug 12 '15 at 07:50
  • Hey @dothebart , I've added the log output. I'm using ArangoDB 2.6.4, and I've installed it with rpm. – navewein Aug 12 '15 at 08:13
  • can you revalidate whether */usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js* exists and is accessible by the arangod? Do you have SELinux enabled? – dothebart Aug 12 '15 at 09:30
  • The gharial.js file exists, I'm not sure how to check if arangod has access to it. I don't seem to have SELinux on my system. Thank you for your help. – navewein Aug 13 '15 at 06:40
  • try `sudo -u arangodb cat /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js` – dothebart Aug 13 '15 at 07:35
  • I get the files content, so I think it means it's ok. – navewein Aug 13 '15 at 10:54
  • Ok, the problem itself is, that the _queuues collection doesn't exist. you can use `db._create('_queues', {isSystem: true});` in the arangosh to create it. Since this collection should be auto-created, can we elaborate a little deeper why its missing? Did you disable foxx-queues? or create your own database? – dothebart Aug 14 '15 at 13:31
  • Thank you. That solved my problem. I was also missing the _graphs collection so I added it in the same manner. I guess I'm to blame for this problem. Before I started using Arango with java I created a few collections of my own, and later I wanted to delete them. So I did it with a simple for loop through java (i.e for each collection delete it). I did so without knowing of the system collections. I guess I should've realized the connection between the deletions and the problem but some time has passed between them. Sorry about that and thank you very much. – navewein Aug 17 '15 at 11:04
  • can you mark this question as solved? – dothebart Nov 24 '15 at 11:57

1 Answers1

1

The user has removed is system _graphs collection which is used for graph management inside of ArangoDB.

The corrosponding error message was a bit confusing and was improved with a newer ArangoDB version.

The solution was to recreate the the collection by specifying it will be a system collection:

db._create("_graphs", {isSystem: true})
dothebart
  • 5,972
  • 16
  • 40