server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

[16.0] Unable to install sentry-sdk dependency: urllib3 conflict

Open kamzata opened this issue 1 year ago • 3 comments

sentry-sdk installation is not possible on Odoo 16 due to urllib3 conflict.

venv16 ~ pip install sentry-sdk

Collecting sentry-sdk
  Using cached sentry_sdk-2.0.1-py2.py3-none-any.whl (266 kB)
Requirement already satisfied: certifi in ./venv16/lib/python3.10/site-packages (from sentry-sdk) (2023.11.17)
Collecting urllib3>=1.26.11
  Using cached urllib3-2.2.1-py3-none-any.whl (121 kB)
Installing collected packages: urllib3, sentry-sdk
  Attempting uninstall: urllib3
    Found existing installation: urllib3 1.26.5
    Uninstalling urllib3-1.26.5:
      Successfully uninstalled urllib3-1.26.5
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
requests 2.25.1 requires urllib3<1.27,>=1.21.1, but you have urllib3 2.2.1 which is incompatible.
Successfully installed sentry-sdk-2.0.1 urllib3-2.2.1

Module

Sentry

Bug Description

sentry-sdk requires a minor urllib3 version

To Reproduce

Affected versions:

  • [ ] 16.0

Steps to reproduce the behavior:

  1. pip install sentry-sdk

Expected behavior sentry-sdk working

Additional context Odoo 16.0 on Ubuntu 22.04 using Python 3.10.12

kamzata avatar Apr 30 '24 00:04 kamzata

Hi @kamzata, this error occurs because Odoo requires urllib3 == 1.26.5 and sentry-sdk > 1.9.0 required urllib3 >= 1.26.11 (https://github.com/OCA/server-tools/pull/2649). If you go to requirements.txt (https://github.com/OCA/server-tools/blob/16.0/requirements.txt) you can see that you must install sentry_sdk equal to or lower than 1.9.0 version.

Try to install sentry_sdk but indicating the version (pip3 install sentry_sdk==1.9.0). In theory, doing this should work.

angelvilaplana avatar May 01 '24 16:05 angelvilaplana

Thanks, now it seems to work. Should I install all other dependencies as well ( pip install -r server-tools/blob/16.0/requirements.txt ) ?

I wanted to self-host the Sentry server but since Sentry doesn't seem to be open source anymore and since it's not as lightweight as I thought, I opted for GlitchTip which uses the Sentry SDK anyway.

Do you know GlitchTip? What do you think about?

It would be great to have error tracking for both backend and Odoo frontend. I'd be happy to help in the next future but I'm approaching Odoo just now.

kamzata avatar May 01 '24 19:05 kamzata

Hi @kamzata, Great! I'm glad it works now. In principle, if you only want to install the sentry module, with that dependency it would be enough. Because if you go to the module manifest you can see that it only requires that dependency.

The truth is that in the company where I work we've Sentry SaaS version and self-hosted. And the truth is that the self-host docker compose is huge. I didn't know about GlitchTip. I find it interesting. Maybe I'll try it too. In principle, if it's use Sentry SDK should work the same.

angelvilaplana avatar May 01 '24 21:05 angelvilaplana