Update question

Heya, got a question, im running a server with version 0.8.3 atm and was wondering if there is a guide somewhere to how i upgrade to the latest version 0.8.5? i have tried a few different ways like running the osp-config.sh, tested both the update and the install new server setting but cant seems to get it to work after, luckily im running it on a hypervisor so can always revert back to a snapshot. Another thing i was gonna try was to export the settings from the 0.8.3 version and import them on the newer version but cant find where todo that in the newer version. Other that that this is a great software and love to see it evolve, Big thanks for all the work. // MiTTnick

I believe you want to:
cd /opt/osp
Then run: git pull
If you get an error run “git stash”
Then after that you want to run the osp-config.sh file and upgrade the server

Did that, but the site stops working with this showing up in the browser:
"An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx."

anything in /opt/osp/logs/osp-error.log?

log file

You can download the logfile from that link, if you dont want to i can past the full content here.

For whatever reason, the pip package bleach was not downloaded.

You can install it by running:
sudo pip3 install bleach

Had the exact same issue as the OP. Installing bleach removed the error, but now I get a new one (and I suspect the OP too, so I’m updating this thread)

  File "/usr/local/lib/python3.7/dist-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/workers/ggevent.py", line 162, in init_process
    super().init_process()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/util.py", line 358, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/osp/app.py", line 202, in <module>
    security = Security(app, user_datastore, register_form=Sec.ExtendedRegisterForm, confirm_register_form=Sec.ExtendedConfirmRegisterForm, login_form=Sec.OSPLoginForm)
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1063, in __init__
    app, datastore, register_blueprint=register_blueprint, **kwargs
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1209, in init_app
    self._check_modules("pyqrcode", "TWO_FACTOR or UNIFIED_SIGNIN")
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1256, in _check_modules
    raise ValueError("{} is required for {}".format(module, config_name))
ValueError: pyqrcode is required for TWO_FACTOR or UNIFIED_SIGNIN```

Yes, got the same errors

Since we both come from 0.8.3 where there wasn’t 2FA, could it be a missing DB column ? Or a value missing where it shouldn’t be NULL or something.

Just tried updating to 0.8.7. Unfortunately, still the same error. :frowning:

EDIT, wait, no, actually it’s different.

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/workers/ggevent.py", line 162, in init_process
    super().init_process()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/workers/base.py", line 119, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/workers/base.py", line 144, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/app/wsgiapp.py", line 49, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.7/dist-packages/gunicorn/util.py", line 358, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/osp/app.py", line 202, in <module>
    security = Security(app, user_datastore, register_form=Sec.ExtendedRegisterForm, confirm_register_form=Sec.ExtendedConfirmRegisterForm, login_form=Sec.OSPLoginForm)
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1063, in __init__
    app, datastore, register_blueprint=register_blueprint, **kwargs
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1209, in init_app
    self._check_modules("pyqrcode", "TWO_FACTOR or UNIFIED_SIGNIN")
  File "/usr/local/lib/python3.7/dist-packages/flask_security/core.py", line 1256, in _check_modules
    raise ValueError("{} is required for {}".format(module, config_name))

FYI I did “git pull” and upgraded using osp-config.sh.

So for some reason it sounds like your upgrade/install process never ran the requirements.txt upgrades/installs. I did look at the installer and I did see that the installer was missing the requirements.txt upgrade under a single component install of OSP-Core, but if a single server install was done, it should have executed the pip update.

You can manually run the pip updates by doing:

sudo pip3 install -r /opt/osp/setup/requirements.txt

I have a bunch of already satisfied requirements:

[email protected]:/opt/osp# pip3 install -r /opt/osp/installs/osp-rtmp/setup/requirements.txt
Requirement already satisfied: alembic==1.0.11 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 1)) (1.0.11)
Requirement already satisfied: aniso8601==7.0.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 2)) (7.0.0)
Requirement already satisfied: Babel==2.7.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 3)) (2.7.0)
Requirement already satisfied: Flask==1.1.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 4)) (1.1.1)
Requirement already satisfied: Flask-BabelEx==0.9.3 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 5)) (0.9.3)
Requirement already satisfied: Flask-Mail==0.9.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 6)) (0.9.1)
Requirement already satisfied: Flask-Migrate==2.5.2 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 7)) (2.5.2)
Requirement already satisfied: Flask-Principal==0.4.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 8)) (0.4.0)
Requirement already satisfied: flask-restplus==0.12.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 9)) (0.12.1)
Requirement already satisfied: Flask-Script==2.0.6 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 10)) (2.0.6)
Requirement already satisfied: Flask-WTF==0.14.2 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 11)) (0.14.2)
Requirement already satisfied: gevent==20.9.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 12)) (20.9.0)
Requirement already satisfied: gevent-websocket==0.10.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 13)) (0.10.1)
Requirement already satisfied: gitdb2==2.0.5 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 14)) (2.0.5)
Requirement already satisfied: GitPython==2.1.11 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 15)) (2.1.11)
Requirement already satisfied: greenlet==0.4.17 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 16)) (0.4.17)
Requirement already satisfied: itsdangerous==1.1.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 17)) (1.1.0)
Requirement already satisfied: Jinja2==2.10.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 18)) (2.10.1)
Requirement already satisfied: Mako==1.0.13 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 19)) (1.0.13)
Requirement already satisfied: passlib==1.7.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 20)) (1.7.1)
Requirement already satisfied: psutil==5.7.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 21)) (5.7.0)
Requirement already satisfied: python-dateutil==2.8.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 22)) (2.8.0)
Requirement already satisfied: python-editor==1.0.4 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 23)) (1.0.4)
Requirement already satisfied: pytz==2019.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 24)) (2019.1)
Requirement already satisfied: smmap2==2.0.5 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 25)) (2.0.5)
Requirement already satisfied: speaklater==1.3 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 26)) (1.3)
Requirement already satisfied: Werkzeug==0.16.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 27)) (0.16.0)
Requirement already satisfied: WTForms==2.2.1 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 28)) (2.2.1)
Requirement already satisfied: requests==2.20.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 29)) (2.20.0)
Requirement already satisfied: xmltodict==0.12.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 30)) (0.12.0)
Requirement already satisfied: flask-limiter==1.1.0 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 31)) (1.1.0)
Requirement already satisfied: gunicorn==20.0.4 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 32)) (20.0.4)
Requirement already satisfied: psycopg2-binary==2.8.5 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 33)) (2.8.5)
Requirement already satisfied: flask-cors==3.0.8 in /usr/local/lib/python3.7/dist-packages (from -r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 34)) (3.0.8)
Requirement already satisfied: SQLAlchemy>=0.9.0 in /usr/local/lib/python3.7/dist-packages (from alembic==1.0.11->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 1)) (1.3.5)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python3.7/dist-packages (from Flask==1.1.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 4)) (7.1.2)
Requirement already satisfied: blinker in /usr/local/lib/python3.7/dist-packages (from Flask-Mail==0.9.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 6)) (1.4)
Requirement already satisfied: Flask-SQLAlchemy>=1.0 in /usr/local/lib/python3.7/dist-packages (from Flask-Migrate==2.5.2->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 7)) (2.4.0)
Requirement already satisfied: six>=1.3.0 in /usr/lib/python3/dist-packages (from flask-restplus==0.12.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 9)) (1.12.0)
Requirement already satisfied: jsonschema in /usr/local/lib/python3.7/dist-packages (from flask-restplus==0.12.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 9)) (3.2.0)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from gevent==20.9.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 12)) (40.8.0)
Requirement already satisfied: zope.event in /usr/local/lib/python3.7/dist-packages (from gevent==20.9.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 12)) (4.5.0)
Requirement already satisfied: zope.interface in /usr/local/lib/python3.7/dist-packages (from gevent==20.9.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 12)) (5.2.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from Jinja2==2.10.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 18)) (1.1.1)
Requirement already satisfied: idna<2.8,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests==2.20.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 29)) (2.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests==2.20.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 29)) (2020.6.20)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests==2.20.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 29)) (1.24.3)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests==2.20.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 29)) (3.0.4)
Requirement already satisfied: limits in /usr/local/lib/python3.7/dist-packages (from flask-limiter==1.1.0->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 31)) (1.5.1)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.7/dist-packages (from jsonschema->flask-restplus==0.12.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 9)) (2.0.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema->flask-restplus==0.12.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 9)) (0.17.3)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema->flask-restplus==0.12.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 9)) (20.2.0)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata; python_version < "3.8"->jsonschema->flask-restplus==0.12.1->-r /opt/osp/installs/osp-rtmp/setup/requirements.txt (line 9)) (3.3.1)

I still get the error pasted before when doing systemctl start osp.target.

Don’t know what’s wrong with me, but I was really confused by that error. I though it was different, but it actually isn’t, sorry.

So to be clear, I still have the ValueError: pyqrcode is required for TWO_FACTOR or UNIFIED_SIGNIN. I just missed that last line in my previous post.

Sorry about that, it gets very confusing.

I apologize. I’m not at home and am on my laptop so I couldn’t pull up the full view of files. I gave the wrong path to the requirements.txt file. The one I posted before was the requirements for osp-rtmp, not osp-core:

sudo pip3 install -r /opt/osp/setup/requirements.txt

That should be the correct requirements file.

1 Like

No worries, take your time. I hope I don’t come accross as that annoying guy who wants everything to work right away. I’m just going straight to the point for efficiency’s sake. :slight_smile:

This time it indeed installed the missing requirements. There was an SQL error after that, but I ran again the upgrade script which this time upgraded the DB, and now it works ! :partying_face:

Great. Just in time for me to push out 0.8.7 to fix some other issues :smiley:

Got it to work aswell.
How i did it:
First i ran: sudo pip3 install bleach
then sudo pip3 install -r /opt/osp/setup/requirements.txt before doing the osp-config.sh.
but server never came online and i noticed in htop that the server was using all the ram and spiked all CPUs alot and it normaly just idle around a few % (its a 16 core epyc). Running the osp-config.sh a second time seems to worked for me. Now its upp and running again.