Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'>=' not supported between instances of 'tuple' and 'int' #3053

Closed
danielboros opened this issue Mar 21, 2024 · 7 comments · Fixed by #3059
Closed

'>=' not supported between instances of 'tuple' and 'int' #3053

danielboros opened this issue Mar 21, 2024 · 7 comments · Fixed by #3059

Comments

@danielboros
Copy link

danielboros commented Mar 21, 2024

Tandoor Version

1.5.15

Setup

Docker / Docker-Compose

Reverse Proxy

No reverse proxy

Other

No response

Bug description

Think it's due to this change:

3489216

divmod returns tuple.

Relevant logs

Environment:


Request Method: GET
Request URL: https://tandoor.home-lab.kud0h.com/system/

Django Version: 4.2.11
Python Version: 3.12.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'django.contrib.postgres',
 'oauth2_provider',
 'django_prometheus',
 'django_tables2',
 'corsheaders',
 'crispy_forms',
 'crispy_bootstrap4',
 'rest_framework',
 'rest_framework.authtoken',
 'django_cleanup.apps.CleanupConfig',
 'webpack_loader',
 'django_js_reverse',
 'hcaptcha',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'cookbook.apps.CookbookConfig',
 'treebeard',
 'debug_toolbar']
Installed Middleware:
['corsheaders.middleware.CorsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'whitenoise.middleware.WhiteNoiseMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cookbook.helper.scope_middleware.ScopeMiddleware',
 'allauth.account.middleware.AccountMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware']



Traceback (most recent call last):
  File "/opt/recipes/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/recipes/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/recipes/cookbook/views/views.py", line 300, in system
    if postgres_ver >= postgres_current:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Exception Type: TypeError at /system/
Exception Value: '>=' not supported between instances of 'tuple' and 'int'
@vabene1111
Copy link
Collaborator

vabene1111 commented Mar 22, 2024

@richid do you want to look into this ? maybe wrap all the code in a try catch so that if it breaks again the system page stays alive and default the PG check to something like unknown

amazing how such a small feature already takes I think the fourth PR to be implemented correctly 😞

@saqibmehmood
Copy link

Hi can work on this bug?

@richid
Copy link
Contributor

richid commented Mar 23, 2024

oof, yes this is an embarrassing bug I introduced. 🤦

Apologies everyone, will have a fix out in a minute.

richid added a commit to richid/recipes that referenced this issue Mar 23, 2024
…TandoorRecipes#3053]

The bug was a missing tuple index introduced in TandoorRecipes#3027. Added the index
and also wrapped everything in a try/catch to prevent future issues.
vabene1111 added a commit that referenced this issue Mar 25, 2024
bug: Fix TypeError at /system due to invalid PostgreSQL values [Closes #3053]
@darnir
Copy link

darnir commented Mar 29, 2024

Any chance we could get a new point release soon? I'm hitting this issue on a new install, which means I can't send new user invite links

@smilerz
Copy link
Collaborator

smilerz commented Mar 29, 2024

Any chance we could get a new point release soon? I'm hitting this issue on a new install, which means I can't send new user invite links

That bug doesn't impact ability to send invites.

@darnir
Copy link

darnir commented Mar 29, 2024

Fair, I was looking at the wrong location.

@danielboros
Copy link
Author

Works in 1.5.16. Thanks!

smilerz pushed a commit to smilerz/recipes that referenced this issue Apr 11, 2024
…TandoorRecipes#3053]

The bug was a missing tuple index introduced in TandoorRecipes#3027. Added the index
and also wrapped everything in a try/catch to prevent future issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants