Error while running experiments


#1

Hi there,

I made a complete and error-free source installation of NRP on my laptop, using Ubuntu 16.04.

I connect to service by :

 -  http://localhost:9000/#/esv-private

And when I run the example or created experiments, I get this error:

 Internal server error: trigger() takes at least 2 arguments (1 given) (host: localhost)

What do you think about it? What might be the problem in my case?

Thank you all!


#2

Hi,

Could you please let us know which experiment you are trying to launch? Also, in the console where you start the nrp backend services (cle-start), is there any other error?

Regards,
Manos


#3

i have new question …

i was unable to open mooc collab !!
error comes like this :

400 : Bad Request
oauth callback made without a token

what should i have to do in order to run it properly ?
thanks in advance
peace :smile:


#4

It seems like this is an unrelated question, could you please open a a new thread with details on the problem on the correct thrad? This specific thread is about neurorobotics, try to post your question on the collab thread.

Regards,
Manos


#5

ok :frowning: i will do what u have said…


#6

Hi,

Thanks for the answer. It is for any experiment and yes, there is also the same error in console as follows:

2018-10-31 16:15:49,646 [uWSGIWorker1] [hbp_nrp_back] [ERROR]  trigger() takes at least 2 arguments (1 given)
Traceback (most recent call last):
  File "/home/canberk/.local/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/canberk/.local/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "./hbp_nrp_backend/rest_server/__init__.py", line 31, in error_router
    return original_handler(e)
  File "/home/canberk/.local/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/canberk/.local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/canberk/.local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/canberk/.local/lib/python2.7/site-packages/flask_restful/__init__.py", line 480, in wrapper
    resp = resource(*args, **kwargs)
  File "/home/canberk/.local/lib/python2.7/site-packages/flask/views.py", line 88, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/canberk/.local/lib/python2.7/site-packages/flask_restful/__init__.py", line 595, in dispatch_request
    resp = meth(*args, **kwargs)
  File "./hbp_nrp_backend/rest_server/__SimulationService.py", line 186, in post
    sim.state = "initialized"
  File "./hbp_nrp_backend/simulation_control/__Simulation.py", line 242, in state
    self.__lifecycle.accept_command(new_state)
  File "/home/canberk/Documents/NRP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/simulation_lifecycle.py", line 182, in accept_command
    self.__machine.events[command].trigger()
TypeError: trigger() takes at least 2 arguments (1 given)

What could it be?

Best Regards


#7

Hi,

Could you run the configure_nrp script in $HBP/user-scripts ? If this does not help, I would advise you to execute
update_nrp update all script again in user-scripts. Seems like something went silently wrong during the installation. Could you also tell me if the environment variable $NRP_INSTALL_MODE is set to user? Just echo $NRP_INSTALL_MODE from a terminal. If everything is ok, then we will have to dig a bit deeper.

Regards,
Manos


#8

My output for this:

  $ echo $NRP_INSTALL_MODE
    user

I also did this : configure_nrp and it executes well. Followingly, I executed update_nrp update all. But I still get exactly the same error.

Is it really about the number of arguments passed to this trigger function?


#9

Hi,

It could be that something went wrong with the python packages installation. Can you check if there is a folder called platform_venv in ~/.opt/platform_venv ? If it is there, remove it and execute the update_nrp build script. Another possibility that I see is that you have a flask package installed locally in ~/.local , whih could be a different version than the one that we use. You can do a pip freeze and find all the packages related to flask and then pip remove flask-related-stuff just to be sure that they are not messing with our code.

Regards,
Manos


#10

Hey guys,

I have exactly the same problem.

Based on the posts above I first tried update_nrp update all with no success. I also echoed $NRP_INSTALL_MODE, which was set to user.

Then I ran pip freeze, and removed any flask stuff I noticed. I also wiped out the ~/.opt/platform_venv/ folder. Next I ran update_nrp build all. Alas, the problem was still there.

To ensure that the flask version that was being used came from the NRP installer, after I had erased ~/.opt/plafform_venv/ and ran 'update_nrp` \ I ran ~/.opt/platform_venv/bin/python, and in python:

import flask
flask._file_
‘/home/z/.opt/platform_venv/local/lib/python2.7/site-packages/flask/init.pyc’

which suggests that the flask module used by the platform was put there by the NRP installer.
At this point I don’t really know how to proceed.


#11

Hi Sergio,

Can you try the same python code but without activating the virtual env? Just from a new terminal try

python
import flask
flask.__file__

My suspicion is that there is a system flask install with sudo pip that is messing with the one that the NRP is using. If this is the case running

sudo pip freeze | grep flask
sudo pip uninstall flask-related-stuff 

should do the trick. Hope it helps!

Regards,
Manos


#12

Hi Sergio,

If Manos instructions didn’t solve your problem already, you could check the version of transitions in platform_venv:

source ~/.opt/platfom_venv/bin/activate
pip freeze | grep transitions

Expected value: transitions==0.4.0

It is possible that you have another installation of the python module named transitions which interfers with the one used by the NRP.

Best regards,
Luc


#13

Once again, thank you Luc and Manos.

I did not have flask installed outside of the virtual environment, but I did have transitions==0.6.9 . Manually removing the transitions module and running update_nrp build all solved the problem.