TypeError: _handle_job() takes exactly 1 positional argument (5 given)

Hi all, i had viktor version 13.2.1 and everything was working just fine, but after trying to update to the lastest version (13.8.0), an error appear when i try to open an entity in development. i have a ‘simple’ app-type

I updated viktor activating the venv with this command

venv\Scripts\activate

and then typing this command:

pip install --upgrade viktor

pip showed that the upgrade was successful. This are the packages that i have installed:

Package           Version
----------------- --------
asttokens         2.2.1
backcall          0.2.0
colorama          0.4.6
contourpy         1.0.5
cycler            0.11.0
decorator         5.1.1
et-xmlfile        1.1.0
executing         1.2.0
fonttools         4.37.3
ipython           8.7.0
jedi              0.18.2
plotly            5.10.0
prompt-toolkit    3.0.33
pure-eval         0.2.2
Pygments          2.13.0
pyparsing         3.0.9
python-dateutil   2.8.2
python-docx       0.8.11
pytz              2022.2.1
setuptools        63.2.0
six               1.16.0
stack-data        0.6.2
tenacity          8.0.1
traitlets         5.6.0
viktor            13.8.0
viktor-connector  5.17.1
wcwidth           0.2.5

But after running

viktor-cli start

This error appear when try to open an entity like in the first image:

Traceback (most recent call last):
  File "viktor_connector\connector.pyx", line 323, in connector.Job.execute
  File "viktor\core.pyx", line 1780, in viktor.core._handle_job
TypeError: _handle_job() takes exactly 1 positional argument (5 given)

I have a long project with multiple views and inputs, so i will put a resume of the code:

import pandas as pd
import numpy as np
import plotly.graph_objects as go
import traceback

from utils_funcs import *

from viktor import ViktorController
from viktor.parametrization import (
    ViktorParametrization, 
    NumberField, 
    Tab, 
    Section, 
    DownloadButton, 
    TextField, 
    DateField, 
    FileField, 
    MultiSelectField,
    OptionField, 
    IntegerField,
    Table,
    ToggleButton,
    Lookup,
    FunctionLookup,
    BooleanField,
    IsTrue,
    IsFalse,
    And
    )
from viktor.views import GeometryView, GeometryResult, PlotlyView, PlotlyResult
from viktor.core import Storage, File

from viktor.errors import UserError, InputViolation
from viktor.utils import convert_word_to_pdf
from viktor.result import DownloadResult

import funciones
import os
import time
from pathlib import Path
import utils_funcs
from io import BytesIO



class Parametrization(ViktorParametrization):

    tab_p = Tab("Project")

    tab_p.section_1 = Section("General Information")
    tab_p.section_1.project_name = TextField("Project Name")
    tab_p.section_1.location = TextField("Location")
    tab_p.section_1.contractor = TextField("Contractor")
    tab_p.section_1.front_page_image = FileField("Front Page Image", file_types=[".png", ".jpg", ".jpeg"], max_size=5_000_000)
    
    tab_p.section_2 = Section("Report Version")

...



class Controller(ViktorController):
    viktor_enforce_field_constraints = True
    label = "Geomastic App"
    parametrization = Parametrization


    @PlotlyView("Loads", duration_guess=3)
    def boxplots_fuerzas(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda

            formato_servicios = [list(fila.values()) for fila in params.tab_2.section_3.inputs]

            servicios_dataframe = pd.DataFrame(data=formato_servicios,
                columns=[
                    "joints", 
    ....


    @PlotlyView("Moments", duration_guess=3)
    def boxplots_momentos(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda

            formato_servicios = [list(fila.values()) for fila in params.tab_2.section_3.inputs]
            servicios_dataframe = pd.DataFrame(data=formato_servicios,
                columns=[
    ....

 
    @PlotlyView("Basic", duration_guess=25)
    def capacidad_portante_asentamientos(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda
            es_calculo_pilotes_personalizado = params.tab_2.section_pilotes.es_calculo_pilotes_personalizado

            (   servicios_dataframe,
                perfil_dataframe,
                modelacion_dataframe,
                personalizacion_dataframe,
                B,
                L,
    ....



    @PlotlyView("Differential", duration_guess=240)
    def asentamientos_diferenciales(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda

            (   servicios_dataframe,
                perfil_dataframe,
                modelacion_dataframe,
    ....



    @PlotlyView("Construction", duration_guess=120)
    def dimensiones_construccion(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda

            (   servicios_dataframe,
                perfil_dataframe,
                modelacion_dataframe,
                personalizacion_dataframe,

    ....

     
    @PlotlyView("Interaction", duration_guess=85)
    def interaccion_suelo_estructura(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda

            (   servicios_dataframe,
                perfil_dataframe,
                modelacion_dataframe,

    ....


    @PlotlyView("Costs", duration_guess=480)
    def visualizar_presupuesto(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda
    ....



    @GeometryView("3D", duration_guess=240)
    def render_cumplimineto(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda
            es_calculo_pilotes_personalizado = params.tab_2.section_pilotes.es_calculo_pilotes_personalizado

            (   servicios_dataframe,
    ....

        
    @PlotlyView("Optimization", duration_guess=540)
    def precio_vs_costo(self, params, entity_id,  entity_name, **kwargs):
        try:
            es_calculo_cimentacion_profunda = params.tab_2.section_1.cimentacion_profunda

            (   servicios_dataframe,


There are more views but they follow the same pattern.

You can update viktor by modifying requirements.txt and call viktor-cli install. See also Fundamentals - Upgrade VIKTOR version | VIKTOR Documentation

1 Like

Thanks, after re installing everything works fine.

1 Like