skip to Main Content

I am trying to set up PyBOSSA on an AWS EC2 instance running Ubuntu 18.04 LTS. I am following the official instructions and have encountered three errors so far.

  1. sudo apt-get install -y git postgresql postgresql-all postgresql-server-dev-all libpq-dev python-psycopg2 libsasl2-dev libldap2-dev libssl-dev python-virtualenv python-dev build-essential libjpeg-dev libssl-dev libffi-dev dbus libdbus-1-dev libdbus-glib-1-dev libldap2-dev libsasl2-dev python-pip python3-pip redis-server
  2. cd ~
  3. git clone –recursive https://github.com/Scifabric/pybossa
  4. cd pybossa
  5. virtualenv -p python3 env (I’m using Python3 explicitly as my system also has Python 2.7 installed).
  6. source env/bin/activate
  7. pip install -U pip
  8. pip install -r ~/pybossa/requirements.txt

At this point, I start getting error messages… I have copied the stdout and stderr into a file, which I have uploaded here.

I’m not sure if the errors there are what have caused my later errors, but I pushed on through the instructions anyway in hopes it’d work…

  1. cp settings_local.py.tmpl settings_local.py
  2. cp alembic.ini.template alembic.ini
  3. redis-server contrib/sentinel.conf –sentinel

I noted that the Redis server version was 4.0.9 (the instructions say it needs to be v2.6 or greater).

The output from starting the Redis server was as follows:

30284:X 30 Mar 03:09:22.004 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
30284:X 30 Mar 03:09:22.004 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=30284, just started
30284:X 30 Mar 03:09:22.004 # Configuration loaded

…I gather that’s ok…

  1. rqscheduler –host 127.0.0.1

This command wasn’t installed on my system. I tried to use apt to install it, but there was nothing there. I also tried apt install rq rqscheduler rq-scheduler – nothing found. I then Googled and found the website for rq-scheduler, and found that I could install it by running pip install rq-scheduler

That installed correctly. Nonetheless, running the command rqscheduler --host 127.0.0.1 in the terminal still failed: rqscheduler: command not found.

Knowing that it was a Python package, I wondered if maybe I needed to prepend python3 onto the start of the command: python3 rqscheduler --host 127.0.0.1. Response: python3: can't open file 'rqscheduler': [Errno 2] No such file or directory.

I also tried pip3 install rq-scheduler (which installed fine) and then running the command, but encountered the same error.

I would appreciate knowing how to get that running, but for the purpose of this test, I skipped setting up Regis and the scheduler, and continued with the PyBOSSA instructions:

  1. sudo su postgres
  2. createuser -d -P pybossa
  3. (Password set)
  4. createdb pybossa -O pybossa
  5. exit
  6. python3 cli.py db_create

…and then I got this error:

  File "cli.py", line 162
    '''SELECT id, created FROM task_run WHERE created LIKE ('x%')''')
    ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 54-55: truncated xXX escape

I instead tried python cli.py db_create, just in case it’d work, and got a different error:

python cli.py db_create
ValueError: invalid x escape

So I’m seeing three separate issues:

  1. Installing the PyBOSSA-required Python packages.
  2. The issue with the rqscheduler command.
  3. The error when starting the PyBOSSA server.

What do these errors mean?

2

Answers


  1. 1 ) For the installation, try this:

    virtualenv env 
    source env/bin/activate
    sudo apt install python3-pip
    pip3 install -r requirements.txt
    

    Which ended with no error.


    2) Try :

    pip install rq-scheduler==0.9.1
    

    or

    pip3 install rq-scheduler==0.9.1
    

    3) The char need to be escaped (like \) in python.

    So you may alter the cli.py line 162 (using text editor) from:

     '''SELECT id, created FROM task_run WHERE created LIKE ('x%')''')
    

    To:

     '''SELECT id, created FROM task_run WHERE created LIKE ('\x%')''')
    

    But it will be better to be fixed by dev on github …


    CONCLUSION

    According to official documentation,

    PYBOSSA for python 3 We’ve finally migrated PYBOSSA to python 3. We’re
    not going to merge into master until we test it in production a bit
    more, so please, help us by testing it. All you have to do is
    basically, check out the python3 branch (migrate-python3) and run it.
    Then, any bug, issue you find, you just report it and we will be happy
    to help you.

    The PYBOSSA python3 version is freshly migrated so finaly is not very stable … I expect that it will be better to use the PYBOSSA python2.7 branch and follow exactly the documentation.

    And according to official github account they try to make money with support (?…)

    Get professional support You can hire us to help you with your PYBOSSA
    project or server (specially for python 2.7). Go to our website, and
    contact us.

    Login or Signup to reply.
  2. The issue has now been fixed for the master branch (https://github.com/Scifabric/pybossa/pull/1986). You can fetch the new code and use it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search