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

value is not a valid dict (type=type_error.dict) #386

Open
patsevanton opened this issue Dec 26, 2024 · 12 comments
Open

value is not a valid dict (type=type_error.dict) #386

patsevanton opened this issue Dec 26, 2024 · 12 comments

Comments

@patsevanton
Copy link

Hello! I download 1.18 release and get error.

./krr simple -p http://victoria-metrics-01:8428 --prometheus-label=cluster -l prod -n xxxxxx  --allow-hpa

 _____       _               _          _  _______  _____
|  __ \     | |             | |        | |/ /  __ \|  __ \
| |__) |___ | |__  _   _ ___| |_ __ _  | ' /| |__) | |__) |
|  _  // _ \| '_ \| | | / __| __/ _` | |  < |  _  /|  _  /
| | \ \ (_) | |_) | |_| \__ \ || (_| | | . \| | \ \| | \ \
|_|  \_\___/|_.__/ \__,_|___/\__\__,_| |_|\_\_|  \_\_|  \_\


Thanks for using Robusta KRR. If you have any questions or feedback, please feel free to reach out to us at
https://github.com/robusta-dev/krr/issues

Watch our latest video to optimize your workloads and save costs: https://www.youtube.com/watch?v=TYRA2QcDIuI



Running Robusta's KRR (Kubernetes Resource Recommender) v1.18.0
Using strategy: Simple
Using formatter: table

[13:17:07] INFO     Using clusters: ['yc-core-prod-v2']                                                                                                            runner.py:280
           INFO     Prometheus URL is specified, will not auto-detect a metrics service                                                                             loader.py:55
           INFO     Trying to connect to Prometheus for yc-prod-v2 cluster                                                                 prometheus_metrics_service.py:68
           INFO     Using Prometheus at http://victoria-metrics-01:8428 for cluster yc-prod-v2                                prometheus_metrics_service.py:97
           INFO     Prometheus found                                                                                                                                loader.py:74
           INFO     Prometheus connected successfully for yc-prod-v2 cluster                                                                                   loader.py:47
           INFO     Listing scannable objects in yc-prod-v2                                                                                                  __init__.py:96
[13:17:08] ERROR    An unexpected error occurred                                                                                                                   runner.py:349
                    Traceback (most recent call last):                                                                                                                          
                      File "robusta_krr/core/runner.py", line 342, in run                                                                                                       
                      File "robusta_krr/core/runner.py", line 288, in _collect_result                                                                                           
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 579, in list_scannable_objects                                                          
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 582, in <listcomp>                                                                      
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 101, in list_scannable_objects                                                          
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 297, in _list_scannable_objects                                                         
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 297, in <genexpr>                                                                       
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 212, in __build_scannable_object                                                        
                      File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__                                                                                    
                    pydantic.error_wrappers.ValidationError: 2 validation errors for K8sObjectData                                                                              
                    labels                                                                                                                                                      
                      value is not a valid dict (type=type_error.dict)                                                                                                          
                    annotations                                                                                                                                                 
                      value is not a valid dict (type=type_error.dict)          
@aantn
Copy link
Contributor

aantn commented Dec 31, 2024

Hi @patsevanton, is this fixed for you on master? I suspect this is the issue that was fixed by #377

@ryanmt
Copy link

ryanmt commented Jan 7, 2025

I am running into this issue when I allow krr to process a namespace where a Rollout is in use. So, that's at least some level of confirmation that it seems related.

@aantn
Copy link
Contributor

aantn commented Jan 8, 2025

@ryanmt is it fixed for you on master? I believe we merged a fix for this.

@patsevanton
Copy link
Author

wait new release

@ryanmt
Copy link

ryanmt commented Jan 8, 2025

@ryanmt is it fixed for you on master? I believe we merged a fix for this.

I haven't attempted to build locally for testing. I don't do much with python.

@aantn
Copy link
Contributor

aantn commented Jan 13, 2025

Hey all, we've done a new release. Binaries should be in brew in a couple of minutes.
Please help us confirm this is fixed!
We think it is fixed, but we'd like the confirmation from each of you if possible.

@patsevanton
Copy link
Author

same error on 1.19

@aantn
Copy link
Contributor

aantn commented Jan 13, 2025

Can you increase the logging level and see if you get more information? E.g. to understand which type of k8s workload it is failing on?

@patsevanton
Copy link
Author

how set debug loglevel?

@aantn
Copy link
Contributor

aantn commented Jan 14, 2025 via email

@patsevanton
Copy link
Author

./krr simple -p http://victoria-metrics-01:8428 --prometheus-label=cluster -l prod -n omni-mobile  --allow-hpa --verbose

 _____       _               _          _  _______  _____
|  __ \     | |             | |        | |/ /  __ \|  __ \
| |__) |___ | |__  _   _ ___| |_ __ _  | ' /| |__) | |__) |
|  _  // _ \| '_ \| | | / __| __/ _` | |  < |  _  /|  _  /
| | \ \ (_) | |_) | |_| \__ \ || (_| | | . \| | \ \| | \ \
|_|  \_\___/|_.__/ \__,_|___/\__\__,_| |_|\_\_|  \_\_|  \_\


Thanks for using Robusta KRR. If you have any questions or feedback, please feel free to reach out to us at
https://github.com/robusta-dev/krr/issues

Watch our latest video to optimize your workloads and save costs: https://www.youtube.com/watch?v=TYRA2QcDIuI



Running Robusta's KRR (Kubernetes Resource Recommender) v1.19.0
Using strategy: Simple
Using formatter: table

[16:36:58] DEBUG    Creating kubernetes python cli monkey patches                                                                                                    patch.py:10
           DEBUG    Found 15 clusters:                __init__.py:544                     
           DEBUG    Current cluster: yc-core-prod-v2                                                                                                             __init__.py:545
           DEBUG    Configured clusters: []                                                                                                                      __init__.py:547
           INFO     Using clusters: ['yc-core-prod-v2']                                                                                                            runner.py:280
           INFO     Prometheus URL is specified, will not auto-detect a metrics service                                                                             loader.py:55
           INFO     Trying to connect to Prometheus for yc-core-prod-v2 cluster                                                                 prometheus_metrics_service.py:68
           INFO     Using Prometheus at http://victoria-metrics-01:8428 for cluster yc-core-prod-v2                                prometheus_metrics_service.py:97
           INFO     Prometheus found                                                                                                                                loader.py:74
           INFO     Prometheus connected successfully for yc-core-prod-v2 cluster                                                                                   loader.py:47
           DEBUG    History range for yc-core-prod-v2: (datetime.datetime(2025, 1, 14, 11, 36, 59), datetime.datetime(2025, 1, 14, 16, 36, 59))                    runner.py:231
[16:36:59] INFO     Listing scannable objects in yc-core-prod-v2                                                                                                  __init__.py:96
           DEBUG    Namespaces: ['omni-mobile']                                                                                                                   __init__.py:97
           DEBUG    Resources: *                                                                                                                                  __init__.py:98
           DEBUG    Listing HPA-v2s in yc-core-prod-v2                                                                                                           __init__.py:240
           DEBUG    Found 1 HPA-v2 in yc-core-prod-v2                                                                                                            __init__.py:272
           DEBUG    Listing Deployments in yc-core-prod-v2                                                                                                       __init__.py:240
           DEBUG    Listing Rollouts in yc-core-prod-v2                                                                                                          __init__.py:240
           DEBUG    Listing DeploymentConfigs in yc-core-prod-v2                                                                                                 __init__.py:240
           DEBUG    Listing StatefulSets in yc-core-prod-v2                                                                                                      __init__.py:240
           DEBUG    Listing DaemonSets in yc-core-prod-v2                                                                                                        __init__.py:240
           DEBUG    Listing Jobs in yc-core-prod-v2                                                                                                              __init__.py:240
           DEBUG    Listing CronJobs in yc-core-prod-v2                                                                                                          __init__.py:240
           DEBUG    Found 1 Deployment in yc-core-prod-v2                                                                                                        __init__.py:272
           DEBUG    DeploymentConfig API not available in yc-core-prod-v2                                                                                        __init__.py:304
           DEBUG    Found 0 Job in yc-core-prod-v2                                                                                                               __init__.py:272
           DEBUG    Found 0 DaemonSet in yc-core-prod-v2                                                                                                         __init__.py:272
           DEBUG    Found 1 Rollout in yc-core-prod-v2                                                                                                           __init__.py:272
           DEBUG    Found 0 CronJob in yc-core-prod-v2                                                                                                           __init__.py:272
           DEBUG    Found 1 StatefulSet in yc-core-prod-v2                                                                                                       __init__.py:272
           ERROR    An unexpected error occurred                                                                                                                   runner.py:349
                    Traceback (most recent call last):                                                                                                                          
                      File "robusta_krr/core/runner.py", line 342, in run                                                                                                       
                      File "robusta_krr/core/runner.py", line 288, in _collect_result                                                                                           
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 582, in list_scannable_objects                                                          
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 585, in <listcomp>                                                                      
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 101, in list_scannable_objects                                                          
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 300, in _list_scannable_objects                                                         
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 300, in <genexpr>                                                                       
                      File "robusta_krr/core/integrations/kubernetes/__init__.py", line 215, in __build_scannable_object                                                        
                      File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__                                                                                    
                    pydantic.error_wrappers.ValidationError: 1 validation error for K8sObjectData                                                                               
                    labels                                                                                                                                                      
                      value is not a valid dict (type=type_error.dict)   

@aantn
Copy link
Contributor

aantn commented Jan 14, 2025

Thanks, you have a Rollout object there, so maybe you're hitting this bug - #391
We're planning to fix.

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

No branches or pull requests

3 participants