Printer FriendlyEmail Article Link

Spirent TestCenter-Automation: Error: "stcerror in perform: Session folder already exists" reported when creating new session on Lab Server using TCL script

  • When you run TCL script to connect to a Lab server: using the command "stc::perform CSTestSessionConnect -Host X.X.X.X -CreateNewTestSession True"
  • Following Error was observed:​
    • stcerror in perform: Session folder already exists : /home/stc/STC_Server/TestCenterServer2013-08-27_10-34-37/STC/4.00.3926.0000/AutoCreatedSession_00 - UserName/
  • Also possible symptoms: Cannot load xml file when this issue occurs
    • once the script causes this issue, the GUI will also have the issue.
    • ​Connect to it via session manager, any new sessions created may show additional symptoms below.
      • Controller field blank
      • CPU/memory fields of test sessions are blank or otherwise abnormal
  • Spirent TestCenter
  • Lab Server
  • Virtual Lab Server
  • TCL


  • Explanation:
    • The issue occurs when a script connects to the Lab-Server then attempts to create a session (name) that already exists
      • That causes an error “session already exists”
      • The issue with that is that the script should catch this and either destroy that session or connect to the existing session.
        • expected 4.78 to change this behavior
    • Additional issue if script ignores error:
      • An attempt to load a STC-Config.xml file is made and causes the Lab-Server to get into a bad state and no xml files can then be loaded.
        • The work around is to find those scripts and modify them to catch the error and not attempt to load the xml config.
  • Solution:
    • Add command to disconnect from Lab Server ":stc::perform CSTestSessionDisconnect -Terminate true"
    • Also set Environment Variable :
  • ​Work around:
    • ​reboot labsever
    • may need to scp to server and delete all inactive/stale entries


Root Cause
  • The previous session was not closed correctly.

Product : Spirent TestCenter,Automation,Lab Server,API,Session Manager