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

Smb: Download does not work if filename contains spaces/special chars and at least two dots #173

Open
filip-paczynski opened this issue Jan 21, 2025 · 0 comments
Assignees
Labels
area/plugin Plugin-related issue or feature request bug Something isn't working

Comments

@filip-paczynski
Copy link

filip-paczynski commented Jan 21, 2025

Describe the issue

For a file stored on a SMB or SFTP server server at path /share/some dir/file name with spaces .and some dots.txt

- id: download
  type: io.kestra.plugin.fs.smb.Download
  host: "server"
  username: "login"
  password: "password"
  from: "/share/some dir/file name with spaces .and some dots.txt"

An exception is thrown:

java.lang.IllegalArgumentException: Illegal character in path at index [SOMEIDX]: [REDACTED[/namespace/SOMEID.and some dots.txt
        at java.base/java.net.URI.create(URI.java:932)
        at java.base/java.net.URI.resolve(URI.java:1122)
        at io.kestra.core.storages.InternalStorage.putFile(InternalStorage.java:179)
        at io.kestra.core.storages.InternalStorage.putFile(InternalStorage.java:170)
        at io.kestra.plugin.fs.vfs.VfsService.download(VfsService.java:140)
        at io.kestra.plugin.fs.vfs.Download.run(Download.java:31)
        at io.kestra.plugin.fs.vfs.Download.run(Download.java:14)
        at io.kestra.core.runners.WorkerTaskCallable.doCall(WorkerTaskCallable.java:78)
        at io.kestra.core.runners.AbstractWorkerCallable.call(AbstractWorkerCallable.java:56)
        at io.kestra.core.runners.WorkerSecurityService.callInSecurityContext(WorkerSecurityService.java:10)
        at io.kestra.core.runners.Worker.callJob(Worker.java:779)
        at io.kestra.core.runners.Worker.runAttempt(Worker.java:738)
        at io.kestra.core.runners.Worker.run(Worker.java:589)
        at io.kestra.core.runners.Worker.handleTask(Worker.java:294)
        at io.kestra.core.runners.Worker.lambda$run$8(Worker.java:250)
        at io.micrometer.core.instrument.internal.TimedRunnable.run(TimedRunnable.java:49)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.net.URISyntaxException: Illegal character in path at index 149: /promonotes/nexo/auto_attach/tes>
        at java.base/java.net.URI$Parser.fail(URI.java:2995)
        at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
        at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
        at java.base/java.net.URI$Parser.parse(URI.java:3207)
        at java.base/java.net.URI.<init>(URI.java:645)
        at java.base/java.net.URI.create(URI.java:930)

I guess that it tries to use extension in internal kestra storage, but stops at first . instead of the last.

EDIT: I thought this only occurs with SMB, but after trying SFTP - it also failed in the same way

Environment

  • Kestra Version: 0.20.11
  • fs-plugin version: 0.20.0

config.yml:

kestra:
  storage:
    type: local
    local:
      base-path: /mnt/storage-kestra
@filip-paczynski filip-paczynski added area/plugin Plugin-related issue or feature request bug Something isn't working labels Jan 21, 2025
@kestrabot kestrabot bot added this to Issues Jan 21, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Issues Jan 21, 2025
@filip-paczynski filip-paczynski changed the title Smb: Download does not work if filename contains spaces/special chars Smb: Download does not work if filename contains spaces/special chars and at elast two dots Jan 21, 2025
@filip-paczynski filip-paczynski changed the title Smb: Download does not work if filename contains spaces/special chars and at elast two dots Smb: Download does not work if filename contains spaces/special chars and at least two dots Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugin Plugin-related issue or feature request bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants