Details
- 
        Type:
Monitor
 - 
        Status: Closed
 - 
            Priority:
 Major
                
             - 
            Resolution: Done
 - 
            Affects Version/s: None
 - 
            Fix Version/s: 2021
 - 
            Component/s: FIWARE-TECH-HELP
 - 
            Labels:
 
- 
                        HD-Chapter:Data
 - 
                        HD-Enabler:Orion
 
Description
Created question in FIWARE Q/A platform on 21-04-2015 at 10:04
Please, ANSWER this question AT https://stackoverflow.com/questions/29766900/i-cant-start-context-broker-due-to-error-starting-rest-interface
Question:
I cant start context broker due to "error starting REST interface"
Description:
When I enter the following command:
/etc/init.d/contextBroker start
I get the following output:
Starting contextBroker...                         cat: /var/run/contextBroker/contextBroker.pid: No such file or directory
pidfile not found                                          [FAILED]
I have two machines where I am practising with context broker and I havent touched the second one in days after I succesfully installed it and managed to receive a post message from a remote weather station.
I see that the directory /var/run/contextBroker/ is actually empty
What should I do to fix this now? reinstal context broker or?
So is this somehow my fault and how do I prevent in the future? I dont want this happening when my app goes live.
EDIT1: the orion version is 0.20.0
EDIT2: I just reinstalled contextBroker and I get the same problem. What are exectly the contents of that directory? Could I maybe just create the files inside?
EDIT3: Since running contextBroker as a system service still yields an unsuccessful start, I also attempted to run it symply by typing:
contextBroker in the command line, after which I get the following response
INFO@14:03:03  contextBroker.cpp[1346]: Orion Context Broker is running
[root@localhost DevF12]# INFO@14:03:03  MongoGlobal.cpp[181]: Successful connection to database
INFO@14:03:03  contextBroker.cpp[1157]: Connected to mongo at localhost:orion
INFO@14:03:03  MongoGlobal.cpp[499]: Database Operation Successful (
)
FATAL@14:03:03  rest.cpp[1013]: Fatal Error (error starting REST interface)
EDIT4: Ok so I tried ps aux | grep contextBroker and the result is:
494       2196  0.0  7.0 688696 135116 ?       Ssl  Apr21   0:02 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/run/contextBroker/contextBroker.pid -dbhost localhost -db orion
root      7299  0.0  6.9 621052 134440 ?       Ssl  04:21   0:00 contextBroker -port 1028
root      8870  0.0  0.0 103256   848 pts/0    S+   08:51   0:00 grep contextBroker
but there simply isnt anything in /var/run/contextBroker/
Should I put contextBroker.pid by myself? and if so, what should the contents be?
EDIT5: I just ran netstat -ntlpd | grep 1026 and the output is:
tcp        0      0 0.0.0.0:1026                0.0.0.0:*                   LISTEN      2196/contextBroker  
tcp        0      0 :::1026                     :::*                        LISTEN      2196/contextBroker 
So I guess nothing else but contextBroker is listening?
2017-05-27 18:05|CREATED monitor | # answers= 1, accepted answer= True