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

Setting namespacedFiles.enabled to false in io.kestra.plugin.scripts.python.Script task throws NullPointerException exception #4078

Closed
aku opened this issue Jun 19, 2024 · 3 comments · Fixed by #4079
Assignees
Labels
bug Something isn't working

Comments

@aku
Copy link

aku commented Jun 19, 2024

Describe the issue

flow:

id: python_script_test
namespace: test

# s3://kestra//test/_files/test.py exists

tasks:
  - id: run_script
    type: io.kestra.plugin.scripts.python.Script
    namespaceFiles:
      enabled: false
    script: "{{ read('test.py') }}"

Execution error:

Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "io.kestra.core.models.tasks.NamespaceFiles.getEnabled()" is null
image

Environment

  • Kestra Version: 0.17.4
  • Operating System (OS/Docker/Kubernetes):
  • Java Version (if you don't run kestra in Docker):
@aku aku added the bug Something isn't working label Jun 19, 2024
@anna-geller
Copy link
Member

hey @aku, you need to explicitly set enabled to true to use the test.py in the read function. This is intended behavior as we aim to be declarative/explicit

feel free to ask via Slack #help channel if you need further explanation

@aku
Copy link
Author

aku commented Jun 20, 2024

hey @aku, you need to explicitly set enabled to true to use the test.py in the read function. This is intended behavior as we aim to be declarative/explicit

feel free to ask via Slack #help channel if you need further explanation

Hi Anna. The issue is not about read function behaviour. It is about exception/error that happens if you set this value to false.
It would be much more better to give a human-readable error message rather than some cryptic exception pops up in the logs.

I guess NullPointerException is not something you expect from the product )

@aku aku changed the title Setting namespacedFiles.enabled to false in io.kestra.plugin.scripts.python.Script task produces an error Setting namespacedFiles.enabled to false in io.kestra.plugin.scripts.python.Script task throws NullPointerException exception Jun 20, 2024
@loicmathieu
Copy link
Member

A NullPointerException is always a bug ;)

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
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants