question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FileInputPlugin causes InvalidPathException by using Japanese filename

See original GitHub issue

FileInputPlugin causes InvalidPathException by using Japanese filename (e.g. ほげ.csv). It seems that it’s influenced by the locale LANG.

vagrant@debian:~/docker-embulk$ docker exec test-embulk cat /var/log/cron.log
2017-03-31 13:56:05.856 +0000: Embulk v0.8.18
java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: ??????
        at sun.nio.fs.UnixPath.encode(sun/nio/fs/UnixPath.java:147)
        at sun.nio.fs.UnixPath.<init>(sun/nio/fs/UnixPath.java:71)
        at sun.nio.fs.UnixFileSystem.getPath(sun/nio/fs/UnixFileSystem.java:281)
        at java.nio.file.Paths.get(java/nio/file/Paths.java:84)
        at org.embulk.standards.LocalFileInputPlugin.listFiles(org/embulk/standards/LocalFileInputPlugin.java:107)
        at org.embulk.standards.LocalFileInputPlugin.transaction(org/embulk/standards/LocalFileInputPlugin.java:63)
        at org.embulk.spi.FileInputRunner.transaction(org/embulk/spi/FileInputRunner.java:65)
        at org.embulk.exec.SamplingParserPlugin.runFileInputSampling(org/embulk/exec/SamplingParserPlugin.java:34)
        at org.embulk.exec.PreviewExecutor.doPreview(org/embulk/exec/PreviewExecutor.java:96)
        at org.embulk.exec.PreviewExecutor.access$000(org/embulk/exec/PreviewExecutor.java:30)
        at org.embulk.exec.PreviewExecutor$1.run(org/embulk/exec/PreviewExecutor.java:70)
        at org.embulk.exec.PreviewExecutor$1.run(org/embulk/exec/PreviewExecutor.java:66)
        at org.embulk.spi.Exec.doWith(org/embulk/spi/Exec.java:25)
...

I’m assuming to use this on docker container. As a workaround, I am setting locale to docker. But I don’t want platfrom settings comprecated.

Paths#get seems to cause Exception, do you have some way to fix it?

    public List<String> listFiles(PluginTask task)
    {
     Path pathPrefix = Paths.get(task.getPathPrefix()).normalize();

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kooogecommented, Apr 3, 2017

This problem was caused by cron. 😅 cf. http://www.mk-mode.com/octopress/2013/11/26/linux-cron-locale-behavior/ (japenese)

This issue is also same behavior.

(I wrote "locale >> /var/log/cron.log" in docker-entrypoint.sh)
vagrant@vagrant-debian-jessie:~/docker-recipes/embulk$ docker exec test-embulk cat /var/log/cron.log
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

As a result, I have to set locale in Dockerfile… Thank you for your help! 🙇‍♂️

0reactions
hiroyuki-satocommented, Apr 3, 2017

Thank you for sharing your knowledge!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image uploader, formats file names when sending ... - GitHub
I was expecting that the filename as sent for AJAX uploads is consistent with the filename (input value) when doing form submissions. Or...
Read more >
bootstrap 4 file input doesn't show the file name - Stack Overflow
I have a problem with the custom-file-input class in Bootstrap 4. after I chose which file I want to upload the filename do...
Read more >
Bootstrap File Input - © Kartik - Krajee JQuery Plugins
The plugin allows you a simple way to setup an advanced file picker/upload control built to work specially with Bootstrap CSS3 styles. It...
Read more >
bs-custom-file-input - npm
A little plugin which makes Bootstrap 4 custom file input dynamic with no dependencies. You can use it on React and Angular too...
Read more >
Nice Clean File Input Plugin With jQuery and Bootstrap 5/4/3
js. purify: Needed if you wish to purify HTML content in your preview for HTML files. This must be loaded before fileinput.min.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found