Search code examples
eclipsevolttron

volttron.platform.vip.agent.core ERROR: Possible conflicting identity


I have been working towards building my agent development skills in Volttron. I am completely new to the platform and trying to understand how to create basic agents that publish and subscribe to the Volttron bus. I'm not alone in this venture and get help from a few other people with experience, but even they are stumped. We are using the same agent files we share through GitHub, but the agent works on their computers and not on mine.

The publishing agent reads from a CSV file that is in the same directory as the agent and is suppose to publish information from the file. I have been careful to map the file directory in my source code to match my setup. I receive the following messages when I start running my publishing agent using eclipse "mars" that's running on Linux Mint 18.1 Serena:

2017-02-02 14:27:22,290 volttron.platform.agent.utils DEBUG: missing file /home/edward/.volttron/keystores/f9d18589-d62b-42b7-bac8-3498a0c37220/keystore.json

2017-02-02 14:27:22,290 volttron.platform.agent.utils INFO: creating file /home/edward/.volttron/keystores/f9d18589-d62b-42b7-bac8-3498a0c37220/keystore.json

2017-02-02 14:27:22,292 volttron.platform.vip.agent.core DEBUG: address: ipc://@/home/edward/.volttron/run/vip.socket

2017-02-02 14:27:22,292 volttron.platform.vip.agent.core DEBUG: identity: None

2017-02-02 14:27:22,292 volttron.platform.vip.agent.core DEBUG: agent_uuid: None

2017-02-02 14:27:22,292 volttron.platform.vip.agent.core DEBUG: severkey: None

2017-02-02 14:27:32,324 volttron.platform.vip.agent.core ERROR: No response to hello message after 10 seconds.

2017-02-02 14:27:32,324 volttron.platform.vip.agent.core ERROR: A common reason for this is a conflicting VIP IDENTITY.

2017-02-02 14:27:32,324 volttron.platform.vip.agent.core ERROR: Shutting down agent.

2017-02-02 14:27:32,324 volttron.platform.vip.agent.core ERROR: Possible conflicting identity is: f9d18589-d62b-42b7-bac8-3498a0c37220

I have done the following:

  1. Created missing file "/home/edward/.volttron/keystores/f9d18589-d62b-42b7-bac8-3498a0c37220/keystore.json". The only thing that happens when I run the agent again is it gives me the same DEBUG message but with a different file name.

  2. I looked into the "volttron.platform.vip.agent.core" file and have no idea what to do in there. I dont want to create more problems for myself.

  3. I have been using the "Volttron's Documentation" to try and trouble shoot, but I always get the same message when ever I try to run any agent. I have had success when testing the platform and running "make-listener" through the terminal, but that's all.

  4. I have been searching the web for the last couple of days and seen similar issues, but when attempting to follow the advise posted to remedy the situation, I have no luck. Error: volttron.platform.web INFO: Web server not started

  5. Reinstalled Volttron, Mint, and Eclipse on my VM a few times to overcome any compatibility issues...

The source code for the agent is as follows:

#testcodeisforpublishingandprinting
import logging
import sys
#import json
from volttron.platform.vip.agent import Agent, Core, PubSub, compat
#from volttron.platform.vip.agent import *
#from volttron.platform.vip.agent import compat
from volttron.platform.agent import utils
from volttron.platform.messaging import headers as headers_mod
from datetime import datetime
#import numpy as NP
#from numpy import linalg as LA

import csv
outdata=open("/home/edward/volttron/testagent/Agent/PredictionfileP.csv","rb")    
Pdata=csv.DictReader(outdata)
Price=[]
for row in Pdata:
    Price.append(float(row['Price'])*0.01)

#from volttron.platform.agent import BaseAgent, PublishMixin, periodic, matching, utils
#from volttron.platform.agent import BaseAgent, PublishMixin, periodic

utils.setup_logging()
_log = logging.getLogger(__name__)

class testagent1(Agent):
    def __init__(self, config_path, **kwargs):
        self.config = utils.load_config(config_path)
        super(testagent1, self).__init__(**kwargs)
        self.step=0
        #print('TestAgent example agent start-up function')
    @Core.receiver('onsetup')
    def onsetup(self, sender, **kwargs):
        self._agent_id = self.config['agentid']
    @Core.receiver('onstart')
    def onstart(self, sender, **kwargs):
        pass       
    @Core.receiver('onstop')
    def onstop(self, sender, **kwargs):
        pass    
    @Core.receiver('onfinish')
    def onfinish(self, sender, **kwargs):
        pass
    @Core.periodic(5)
    def simulate(self):
        self.step=self.step+1#timestep increase
        print('Simulationrunning')
    
        now = datetime.utcnow().isoformat(' ')#time now
        headers = {
            'AgentID': self._agent_id,
            headers_mod.CONTENT_TYPE: headers_mod.CONTENT_TYPE.PLAIN_TEXT,
            headers_mod.DATE: now,
        }
        print(self.step)
        self.vip.pubsub.publish('pubsub', 'testcase1/Step', headers, self.step) 
        print('Simulationupdatingloopingindex')
def main(argv=sys.argv):
    '''Main method called by the eggsecutable.'''
    try:
        utils.vip_main(testagent1)
    except Exception as e:
        _log.exception('unhandled exception')


if __name__ == '__main__':
    # Entry point for script
    sys.exit(main())

I installed my version of Volttron using the 3.5RC1 manual published Jan. 2017.


Solution

  • I am assuming that you are running this from eclipse and not through the installation process. The installation of the agent would specify an identity that would remain for the life of the agent.

    The remaining answer is specific to running within the eclipse environment.

    def main(argv=sys.argv):
        '''Main method called by the eggsecutable.'''
        try:
            # This is where the change is.
            utils.vip_main(testagent1, identity='Thisidentity')
        except Exception as e:
            _log.exception('unhandled exception')
    

    You will have to authorize the agent to be able to connect to the message bus by adding the agent publickey through the auth mechanism. Or you can add the wildcard /.*/ to the credentials of an entry through volttron-ctl auth add.

    Thank you for asking this question. We will are updating the documentation to highlight this.

    You will need to do the following at the command line:

    volttron-ctl auth add
    domain []: 
    address []: 
    user_id []: 
    capabilities (delimit multiple entries with comma) []: 
    roles (delimit multiple entries with comma) []: 
    groups (delimit multiple entries with comma) []: 
    mechanism [CURVE]: 
    credentials []: /.*/
    comments []: 
    enabled [True]: 
    added entry domain=None, address=None, mechanism='CURVE', credentials=u'/.*/', user_id='ff6fea8e-53bd-4506-8237-fbb718aca70d'