Kitware / HPCCloud

A Cloud/Web-Based Simulation Environment
https://kitware.github.io/HPCCloud/
Apache License 2.0
50 stars 23 forks source link

Getting "TypeError: Cannot read property '_id' ..." repeatedly in console when running pyfr #527

Closed chetnieter closed 7 years ago

chetnieter commented 8 years ago

I see the following error in the console when running pyfr in DEMO mode. The pyfr simulation appears to be running without any issue however.

TypeError: Cannot read property '_id' of undefined at t.render (http://localhost:8888/HPCCloud.js:27:29835) at _renderValidatedComponentWithoutOwnerOrContext (http://localhost:8888/HPCCloud.js:88:10961) at _renderValidatedComponent (http://localhost:8888/HPCCloud.js:88:11097) at _updateRenderedComponent (http://localhost:8888/HPCCloud.js:88:10403) at _performComponentUpdate (http://localhost:8888/HPCCloud.js:88:10204) at updateComponent (http://localhost:8888/HPCCloud.js:88:9482) at receiveComponent (http://localhost:8888/HPCCloud.js:88:8593) at Object.receiveComponent (http://localhost:8888/HPCCloud.js:10:24) at _updateRenderedComponent (http://localhost:8888/HPCCloud.js:88:10443) at _performComponentUpdate (http://localhost:8888/HPCCloud.js:88:10204) at updateComponent (http://localhost:8888/HPCCloud.js:88:9482)

TristanWright commented 8 years ago

The tracelog unfortunately doesn't help much here. I've made some changes to error catching in the toaster in #529 which were leading to some I saw.

What page were you on, what were you trying to do?

chetnieter commented 8 years ago

I would have missed the error altogether but I saw it flash at the bottom of the page which is the toaster is correct. I am trying to reproduce right now but I didn't see it in the most recent pass.

TristanWright commented 8 years ago

What page were you on, what were you trying to do?

chetnieter commented 8 years ago

Simulation view - the error occurred after pressing the 'Run Simulation' button.

TristanWright commented 8 years ago

Was it a rerun?

chetnieter commented 8 years ago

I don't believe so but after a fresh vagrant destroy and DEMO=1 vagrant up the error I get appear to be different than originally reported and then prfr errors out. I now get in the celery logs but not the console the following. I do have the R constant defined, but if I re-enter it on the Input view then pyfr runs without error.

[2016-09-20 17:08:11,752: ERROR/Worker-4] Exception raise by task.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/hpccloud/cumulus/cumulus/taskflow/__init__.py", line 117, in wrapped
    return func(celery_task, *args, **kwargs)
  File "/opt/hpccloud/hpccloud/server/taskflows/hpccloud/taskflow/pyfr.py", line 348, in setup_input
    update_config_file(task, client, *args, **kwargs)
  File "/opt/hpccloud/hpccloud/server/taskflows/hpccloud/taskflow/pyfr.py", line 183, in update_config_file
    ini_file_id = kwargs['input']['iniFile']['id']
KeyError: 'id'

I do see the following when I press Rerun but it doesn't prevent me from re-running the simulation. I do see an error flash in the toaster area when this happens.

screen shot 2016-09-20 at 1 21 38 pm

chetnieter commented 8 years ago

Ugh - tried again with a new simulation and was not able to reproduce the KeyError: id error.

TristanWright commented 8 years ago

The error I have in mind will only happen after a rerun.

TristanWright commented 8 years ago

The image of that error too #529 should clear up.

chetnieter commented 8 years ago

Could there be something going on with the input boxes for the constants where if the value is entered but the input box never gets unselected then the value doesn't get set. I will try to reproduce one more time.

chetnieter commented 8 years ago

Ok - I tried an experiment. I created a new simulation where I intentionally left out the R constant. When I try and run it I get the exact same KeyError: id as before along with the line R = retval = fun(*args, **kwargs).

TristanWright commented 8 years ago

The local model is updated with the oninput event, not onblur. The model is then sent to the server when the component unmounts: https://github.com/Kitware/HPCCloud/blob/master/src/workflows/pyfr/pyfr-simput/components/steps/Input/index.js#L114-L116

chetnieter commented 8 years ago

Ok - I was able to recreate the issue with the following:

  1. Destroyed and recreated/provisioned VM
  2. Created new project and simulation
  3. Simulation errors out when I hit Run Simulation.
  4. SImulation errors out again (same errors) when I try and re-run.
  5. Switch back to Input View - but do nothing else
  6. Switch back to Simulation View - simulation runs now.

I think the R constant thing was a red herring. I did notice looking at the taskflow start request that in the request payload iniFile is empty for steps 3-4 but after 5 it is not empty. If I create a new simulation in same project I get the same behavior. Errors out presumable due the iniFile field being empty but after clicking back to the Input View it runs and iniFile field is populated.

chetnieter commented 8 years ago

One last data point. Creating a simulation, Clicking to the Simulation view, don't run, click back to the Input view, click to the Simulation view and run works. I will be having nightmares about Simput at this point ;)

TristanWright commented 8 years ago

I'm looking first at how the ini file is empty. The ini file in girder looks ok and has the R prop. Interesting...

TristanWright commented 8 years ago

@chetnieter try out #531

TristanWright commented 7 years ago

closed with #531