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

[Bug] NameError: name 'xxxxxxx' is not defined #28

Closed
sjedlick opened this issue Nov 14, 2023 · 1 comment
Closed

[Bug] NameError: name 'xxxxxxx' is not defined #28

sjedlick opened this issue Nov 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@sjedlick
Copy link

Description

There are various error messages in log:

[2023-11-14 11:55:41,120] kopf.objects         [INFO    ] [obiwan/statefulset-solr-leader-solr] Working on statefulset-solr-leader-solr
[2023-11-14 11:55:41,122] kopf.objects         [ERROR   ] [obiwan/statefulset-solr-leader-solr] Handler 'send_to_dojo' failed with an exception. Will retry.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/kopf/_core/actions/execution.py", line 276, in execute_handler_once
    result = await invoke_handler(
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kopf/_core/actions/execution.py", line 371, in invoke_handler
    result = await invocation.invoke(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/kopf/_core/actions/invocation.py", line 139, in invoke
    await asyncio.shield(future)  # slightly expensive: creates tasks
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<decorator-gen-1>", line 2, in send_to_dojo
  File "/usr/local/lib/python3.11/site-packages/prometheus_client/context_managers.py", line 80, in wrapped
    return func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/src/handlers.py", line 79, in send_to_dojo
    settings.DEFECT_DOJO_PRODUCT_NAME = eval(settings.DEFECT_DOJO_PRODUCT_NAME)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
NameError: name 'defectdojo' is not defined

Helm values looks like this:

account:
  serviceAccount:
    annotations: {}
defectDojoApiCredentials:
  apiKey: "${DEFECT_DOJO_API_KEY}"
  url: "${DEFECT_DOJO_URL}"
operator:
  replicas: 1
  trivyDojoReportOperator:
    env:
      defectDojoActive: "true"
      defectDojoAutoCreateContext: "true"
      defectDojoCloseOldFindings: "false"
      defectDojoCloseOldFindingsProductScope: "false"
      defectDojoDeduplicationOnEngagement: "true"
      defectDojoMinimumSeverity: Info
      defectDojoProductTypeName: Research and Development
      defectDojoPushToJira: "false"
      defectDojoTestTitle: Kubernetes
      defectDojoVerified: "false"
      defectDojoEngagementName: "operator"
      defectDojoProductName: body["report"]["artifact"]["repository"]
      defectDojoEvalProductName: "true"
    image:
      repository: ghcr.io/telekom-mms/docker-trivy-dojo-operator
      tag: trivy-dojo-report-operator-0.3.3

Reproduction steps

with start of the pod these errors are in the log

Current Behavior

  • error messages like in the issue description
  • no data is sent to defectdojo

Expected Behavior

  • data is sent to defectdojo without any errors

Additional information

No response

@sjedlick sjedlick added the bug Something isn't working label Nov 14, 2023
@rndmh3ro
Copy link
Collaborator

problem was the re-using of variable-names. When I did this I already had a bad feeling about it but decided to do it anyway because of laziness. Fixed by 906650e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants