Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR [pnnl.goss.core.client.GossClient] - publish error when starting a simulation #1770

Open
Tylores opened this issue Apr 4, 2024 · 0 comments
Assignees

Comments

@Tylores
Copy link

Tylores commented Apr 4, 2024

Describe the bug
The error throws after the first simulation runs as expected and shuts down. The next run the connection times out due to the following error:

2024-04-04 21:07:13,503 Thread-71 ERROR [pnnl.goss.core.client.GossClient] - publish error
javax.jms.JMSException: Received an error: temp-queue://ID:90cc8416fe49-39177-1712264675860-4:42:4
at org.fusesource.stomp.jms.StompJmsExceptionSupport.create(StompJmsExceptionSupport.java:59)
at org.fusesource.stomp.jms.StompChannel.sendMessage(StompChannel.java:203)
at org.fusesource.stomp.jms.StompJmsSession.send(StompJmsSession.java:708)
at org.fusesource.stomp.jms.StompJmsSession.send(StompJmsSession.java:654)
at org.fusesource.stomp.jms.StompJmsMessageProducer.send(StompJmsMessageProducer.java:157)
at org.fusesource.stomp.jms.StompJmsMessageProducer.send(StompJmsMessageProducer.java:124)
at pnnl.goss.core.client.DefaultClientPublisher.publish(DefaultClientPublisher.java:136)
at pnnl.goss.core.client.GossClient.publish(GossClient.java:508)
at gov.pnnl.goss.gridappsd.process.ProcessEvent.sendData(ProcessEvent.java:387)
at gov.pnnl.goss.gridappsd.process.ProcessEvent.onMessage(ProcessEvent.java:274)
at pnnl.goss.core.client.GossClient$1.run(GossClient.java:398)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.fusesource.stomp.client.ProtocolException: Received an error: temp-queue://ID:90cc8416fe49-39177-1712264675860-4:42:4
at org.fusesource.stomp.client.CallbackConnection.processStompFrame(CallbackConnection.java:110)
at org.fusesource.stomp.client.CallbackConnection.access$000(CallbackConnection.java:33)
at org.fusesource.stomp.client.CallbackConnection$1.onTransportCommand(CallbackConnection.java:61)
at org.fusesource.hawtdispatch.transport.TcpTransport.drainInbound(TcpTransport.java:713)
at org.fusesource.hawtdispatch.transport.TcpTransport$6.run(TcpTransport.java:592)
at org.fusesource.hawtdispatch.internal.NioDispatchSource$3.run(NioDispatchSource.java:209)
at org.fusesource.hawtdispatch.internal.SerialDispatchQueue.run(SerialDispatchQueue.java:100)
at org.fusesource.hawtdispatch.internal.pool.SimpleThread.run(SimpleThread.java:77)
2024-04-04 21:08:10,234 Thread-37 WARN [pnnl.goss.core.client.GossClient] - No username received in stomp message
2024-04-04 21:08:12,248 Thread-52 INFO [gov.pnnl.goss.gridappsd.log.LogManagerImpl] - 1712264892246|gov.pnnl.goss.gridappsd.process.ProcessEvent|639448363|RUNNING|system|INFO
New process id generated with new process type

To Reproduce

if __name__ == "__main__":
    try:
        cim_profile = 'rc4_2021'
        cim = importlib.import_module('cimgraph.data_profile.' + cim_profile)
        mrid = IEEE123_APPS

        feeder = cim.Feeder(mRID=mrid)
        params = ConnectionParameters(
            url="http://localhost:8889/bigdata/namespace/kb/sparql",
            cim_profile=cim_profile)

        bg = BlazegraphConnection(params)
        print(bg)
        network = FeederModel(
            connection=bg,
            container=feeder,
            distributed=False)
        utils.get_all_data(network)

        gapps = GridAPPSD(username='system', password='manager')
        print(gridappsd.utils.get_gridappsd_address())
        models = gapps.query_model_info()['data']['models']
        for model in models:
            if model['modelId'] == mrid:
                system = ModelInfo(**model)

        system_config = PowerSystemConfig(
            GeographicalRegion_name=system.regionId,
            SubGeographicalRegion_name=system.subRegionId,
            Line_name=system.modelId
        )

        model_config = ModelCreationConfig(
            load_scaling_factor=1,
            schedule_name="ieeezipload",
            z_fraction=0,
            i_fraction=1,
            p_fraction=0,
            randomize_zipload_fractions=False,
            use_houses=False
        )

        start = datetime(2024, 1, 1)
        epoch = datetime.timestamp(start)
        duration = timedelta(minutes=7).total_seconds()

        sim_args = SimulationArgs(
            start_time=epoch,
            duration=duration,
            simulator="GridLAB-D",
            timestep_frequency=1000,
            timestep_increment=1000,
            run_realtime=False,
            simulation_name=system.modelName,
            power_flow_solver_method="NR",
            model_creation_config=asdict(model_config)
        )

        sim_config = SimulationConfig(
            power_system_config=asdict(system_config),
            simulation_config=asdict(sim_args)
        )

        sim = Simulation(gapps, asdict(sim_config))
        app = PowerFactor(gapps, sim)
        # gapps.subscribe(t.simulation_output_topic(sim.simulation_id), app)
        # profiles = read_csv('data/time-series.csv')
        # dispatch = []
        # for idx, row in profiles.iterrows():
        # print("Iteration:\n", row)
        # setpoints = app.dispatch(row['Loadshape'], row['Solar'])
        # dispatch.append(setpoints)
#
        # dispatch = dispatch_serialize(dispatch)
        # plot(dispatch, profiles)

        while sim._running_or_paused:
            time.sleep(0.1)

        sim.stop()

    except Exception as e:
        print(e)
        sim.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants