Project-OMOTES / issues-and-project

0 stars 0 forks source link

Cannot do 'split & add joint' when a pipe is not in the main area #1

Closed lfse-slafleur closed 12 months ago

lfse-slafleur commented 1 year ago

Related logs:

HTTP/1.1 200) 2 headers in 100 bytes (1 switches on core 52)
[pid: 8|app: 0|req: 48428/48413] 172.24.0.10 () {56 vars in 2602 bytes} [Thu Sep 21 13:25:12 2023] POST /socket.io/?EIO=4&transport=polling&t=Ogtwdpv&sid=A-t5TXW0KTYE_pDTAAIL => generated 2 bytes in 0 msecs (HTTP/1.1 200) 3 headers in 149 bytes (1 switches on core 63)
{"event": "received: split_conductor", "level": "info", "logger": "uwsgi_file_app", "timestamp": "2023-09-21T13:25:13.771005Z"}
[pid: 8|app: 0|req: 48430/48414] 172.24.0.10 () {60 vars in 2788 bytes} [Thu Sep 21 13:25:13 2023] POST /socket.io/?EIO=4&transport=polling&t=Ogtwe3h&sid=iSAgCdg9bePWwBHpAAIR => generated 2 bytes in 1 msecs (HTTP/1.1 200) 3 headers in 149 bytes (1 switches on core 25)
{"event": "Error in SocketIO handler: cannot unpack non-iterable NoneType object", "level": "error", "logger": "uwsgi_file_app", "timestamp": "2023-09-21T13:25:13.771543Z"}
{"event": "Socket IO message: command", "level": "error", "logger": "uwsgi_file_app", "timestamp": "2023-09-21T13:25:13.771705Z"}
{"event": "Socket IO arguments: ({'cmd': 'split_conductor', 'id': '9902f0c4-2356-484a-80e8-43cdd2adbd91', 'location': {'lat': 52.002228236493224, 'lng': 4.364168643951417}, 'mode': 'add_joint'},)", "level": "error", "logger": "uwsgi_file_app", "timestamp": "2023-09-21T13:25:13.771829Z"}
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask_socketio/__init__.py", line 751, in _handle_event
    ret = handler(*args)
  File "app.py", line 2388, in process_command
    conductor, container = ESDLAsset.find_asset_and_container(area, cond_id)
  File "./esdl/processing/ESDLAsset.py", line 94, in find_asset_and_container
    asset, ar = find_asset_and_container(subarea, asset_id)
TypeError: cannot unpack non-iterable NoneType object
ewoudwerkman commented 1 year ago

I can't reproduce this on the nwn-poc nor in my local deployment. What I tried:

  1. create a new area
  2. select this area
  3. add a pipe in that new area
  4. Split and add joint of that pipe

Can anyone reproduce the issue?

lfse-slafleur commented 1 year ago

@FJanssen-TNO Do you have any insights on how to reproduce?

FJanssen-TNO commented 1 year ago

Yes I was able to reproduce this error, it actually occured again when I was just making an ESDL for the training tomorrow. I can share the ESDL with you @ewoudwerkman.

I've tried refreshing, reloading and signing out and in again, but that all didn't help

edwinmatthijssen commented 1 year ago

Please attach the ESDL file to this issue and describe the things you do to reproduce the error

FJanssen-TNO commented 1 year ago

I've reproduced the error with the same steps as Ewoud used, however in between some steps I've done multiple other steps, that I can't recall.

  1. Create new areas
  2. Change names of these areas
  3. Multiple other steps where components have been added to the sub areas or the main area
  4. Select area
  5. Add a pipe to the new area, between two assets that already exist in the same area
  6. Top right in ESDL layers: unselect 'Area' (otherwise I cannot click on the pipe)
  7. Split and add joint of the pipe

I've also tried step 5 without connecting it to other assets, but still step 6 does not work.

See attached ESDL file the pipes that I cannot split are: Pipe_783a and Pipe_48af. They exist in area Kluyverpark.

Demo_areas.txt

edwinmatthijssen commented 1 year ago

Thanks, I'm now able to reproduce the error both in the NWN POC MapEditor as in the HESI one.

edwinmatthijssen commented 1 year ago

Issue has been found and fixed. After building a new NWN container, new version can be deployed

ewoudwerkman commented 1 year ago

The whole recursive loop to find the asset and its container could be replaced by 2 lines of code:

conductor = esh.get_by_id(active_es_id, cond_id)
container = conductor.eContainer()
edwinmat commented 1 year ago

Yes, isn't this code from long before the birth of the energy system handler?

ewoudwerkman commented 1 year ago

Probably ;-)

lfse-slafleur commented 12 months ago

@FJanssen-TNO Could you try to see if this error is now indeed fixed on production? Just as a confirmation before we close this issue. We have released 23.9.0 on POC production that should contain a fix for this.

FJanssen-TNO commented 12 months ago

Yes the error is indeed fixed. I checked it with the ESDL file which was not able to handle it before.

lfse-slafleur commented 12 months ago

Thanks @FJanssen-TNO ! Closing the issue.