Re: ExecuteStreamCommand fails to extract archived files

2022-09-21 Thread James McMahon
Now I see. So in the configuration of the ExecuteStreamCommand there was
one thing we had not touched on, and it allowed this to work: Ignore STDIN
must be set to true. I did that, I set my Command Arguments to
e;/mnt/in/${filename} , and it worked as expected.
Thanks again Mike.
Jim

On Wed, Sep 21, 2022 at 11:50 AM Mike Thomsen 
wrote:

> > ExecuteStreamCommand works on the contents of the incoming flowfile, is
> that understanding correct?
>
> 7za can't read the file from stdin. That's the problem AFAICT in your
> scenario.
>
> On Wed, Sep 21, 2022 at 11:26 AM James McMahon 
> wrote:
> >
> > Thank you Mike. May I ask a few follow-up Qs after trying this and
> failing still?
> >
> > ExecuteStreamCommand works on the contents of the incoming flowfile, is
> that understanding correct? If so, then why does it matter where the file
> sits on the filesystem if it will apply /bin/7za to the flowfile in the
> stream?
> >
> > So I have /bin/7za in the /bin directory, it's an executable program,
> and the user that the nif jvm is running as - user named nifi - has /bin in
> its path.
> >
> > I have an archive file I created in directory /mnt/in, and it is named
> testArchive.7z. I am successfully able to read that archive file in with a
> ListFile / FetchFile, and do get it in my stream. These are its attributes:
> > absolute.path   /mnt/in/
> > filename   testArchive.7z
> >
> > Is this java io exception telling us that it can't find the /bin/7za
> program, or it can't find the data itself? And if ExecuteStreamCommand is
> supposed to be applying that command to the flowfile in the stream, why is
> it important that the archive file exists on disk where
> ExecuteStreamCommand can find it?
> >
> > On Wed, Sep 21, 2022 at 11:07 AM Mike Thomsen 
> wrote:
> >>
> >> To do this, you need to do UpdateAttribute (to set the temp folder
> >> location) -> PutFile -> ExecuteStreamCommand to ensure the flowfile's
> >> contents are staged where 7za can find them.
> >>
> >> I think the appropriate parameter would be something like this:
> >>
> >> Command Arguments: e;${path}/${filename}
> >>
> >> Assuming ";" is the argument delimiter.
> >>
> >> On Wed, Sep 21, 2022 at 10:45 AM James McMahon 
> wrote:
> >> >
> >> > Hello. I have a program /bin/7za that I need to apply to flowfiles
> that were created by 7za. One of them is testArchive.7z.
> >> >
> >> > I try to employ an ExecuteStreamCommand to extract from an incoming
> flowfile to into N output flowfiles in output stream, each representing one
> file from the contents in the flowfile.
> >> >
> >> > ESC throws error=2, No such file or directory.
> >> >
> >> > java.io.Exception: Cannot run program "/bin/7za"": error=2, No such
> file or directory
> >> >
> >> > My ExecuteStreamCommand processor has this configuration:
> >> > Command Argumentse
> >> > Command Path   /bin/7za
> >> > Ignore STDIN   false
> >> > working Directory   no value set
> >> > Argument Delimiter   ;
> >> > (I do not set an Output Destination Delimiter, intending to send the
> output to output path "output stream" as separate flowfiles)
> >> >
> >> > How can I fix this problem?
> >> >
> >> > Thanks in advance,
> >> > Jim
>


Re: ExecuteStreamCommand fails to extract archived files

2022-09-21 Thread Mike Thomsen
> ExecuteStreamCommand works on the contents of the incoming flowfile, is that 
> understanding correct?

7za can't read the file from stdin. That's the problem AFAICT in your scenario.

On Wed, Sep 21, 2022 at 11:26 AM James McMahon  wrote:
>
> Thank you Mike. May I ask a few follow-up Qs after trying this and failing 
> still?
>
> ExecuteStreamCommand works on the contents of the incoming flowfile, is that 
> understanding correct? If so, then why does it matter where the file sits on 
> the filesystem if it will apply /bin/7za to the flowfile in the stream?
>
> So I have /bin/7za in the /bin directory, it's an executable program, and the 
> user that the nif jvm is running as - user named nifi - has /bin in its path.
>
> I have an archive file I created in directory /mnt/in, and it is named 
> testArchive.7z. I am successfully able to read that archive file in with a 
> ListFile / FetchFile, and do get it in my stream. These are its attributes:
> absolute.path   /mnt/in/
> filename   testArchive.7z
>
> Is this java io exception telling us that it can't find the /bin/7za program, 
> or it can't find the data itself? And if ExecuteStreamCommand is supposed to 
> be applying that command to the flowfile in the stream, why is it important 
> that the archive file exists on disk where ExecuteStreamCommand can find it?
>
> On Wed, Sep 21, 2022 at 11:07 AM Mike Thomsen  wrote:
>>
>> To do this, you need to do UpdateAttribute (to set the temp folder
>> location) -> PutFile -> ExecuteStreamCommand to ensure the flowfile's
>> contents are staged where 7za can find them.
>>
>> I think the appropriate parameter would be something like this:
>>
>> Command Arguments: e;${path}/${filename}
>>
>> Assuming ";" is the argument delimiter.
>>
>> On Wed, Sep 21, 2022 at 10:45 AM James McMahon  wrote:
>> >
>> > Hello. I have a program /bin/7za that I need to apply to flowfiles  that 
>> > were created by 7za. One of them is testArchive.7z.
>> >
>> > I try to employ an ExecuteStreamCommand to extract from an incoming 
>> > flowfile to into N output flowfiles in output stream, each representing 
>> > one file from the contents in the flowfile.
>> >
>> > ESC throws error=2, No such file or directory.
>> >
>> > java.io.Exception: Cannot run program "/bin/7za"": error=2, No such file 
>> > or directory
>> >
>> > My ExecuteStreamCommand processor has this configuration:
>> > Command Argumentse
>> > Command Path   /bin/7za
>> > Ignore STDIN   false
>> > working Directory   no value set
>> > Argument Delimiter   ;
>> > (I do not set an Output Destination Delimiter, intending to send the 
>> > output to output path "output stream" as separate flowfiles)
>> >
>> > How can I fix this problem?
>> >
>> > Thanks in advance,
>> > Jim


Re: ExecuteStreamCommand fails to extract archived files

2022-09-21 Thread James McMahon
Thank you Mike. May I ask a few follow-up Qs after trying this and failing
still?

ExecuteStreamCommand works on the contents of the incoming flowfile, is
that understanding correct? If so, then why does it matter where the file
sits on the filesystem if it will apply /bin/7za to the flowfile in the
stream?

So I have /bin/7za in the /bin directory, it's an executable program, and
the user that the nif jvm is running as - user named nifi - has /bin in its
path.

I have an archive file I created in directory /mnt/in, and it is named
testArchive.7z. I am successfully able to read that archive file in with a
ListFile / FetchFile, and do get it in my stream. These are its attributes:
absolute.path   /mnt/in/
filename   testArchive.7z

Is this java io exception telling us that it can't find the /bin/7za
program, or it can't find the data itself? And if ExecuteStreamCommand is
supposed to be applying that command to the flowfile in the stream, why is
it important that the archive file exists on disk where
ExecuteStreamCommand can find it?

On Wed, Sep 21, 2022 at 11:07 AM Mike Thomsen 
wrote:

> To do this, you need to do UpdateAttribute (to set the temp folder
> location) -> PutFile -> ExecuteStreamCommand to ensure the flowfile's
> contents are staged where 7za can find them.
>
> I think the appropriate parameter would be something like this:
>
> Command Arguments: e;${path}/${filename}
>
> Assuming ";" is the argument delimiter.
>
> On Wed, Sep 21, 2022 at 10:45 AM James McMahon 
> wrote:
> >
> > Hello. I have a program /bin/7za that I need to apply to flowfiles  that
> were created by 7za. One of them is testArchive.7z.
> >
> > I try to employ an ExecuteStreamCommand to extract from an incoming
> flowfile to into N output flowfiles in output stream, each representing one
> file from the contents in the flowfile.
> >
> > ESC throws error=2, No such file or directory.
> >
> > java.io.Exception: Cannot run program "/bin/7za"": error=2, No such file
> or directory
> >
> > My ExecuteStreamCommand processor has this configuration:
> > Command Argumentse
> > Command Path   /bin/7za
> > Ignore STDIN   false
> > working Directory   no value set
> > Argument Delimiter   ;
> > (I do not set an Output Destination Delimiter, intending to send the
> output to output path "output stream" as separate flowfiles)
> >
> > How can I fix this problem?
> >
> > Thanks in advance,
> > Jim
>


Re: ExecuteStreamCommand fails to extract archived files

2022-09-21 Thread Mike Thomsen
To do this, you need to do UpdateAttribute (to set the temp folder
location) -> PutFile -> ExecuteStreamCommand to ensure the flowfile's
contents are staged where 7za can find them.

I think the appropriate parameter would be something like this:

Command Arguments: e;${path}/${filename}

Assuming ";" is the argument delimiter.

On Wed, Sep 21, 2022 at 10:45 AM James McMahon  wrote:
>
> Hello. I have a program /bin/7za that I need to apply to flowfiles  that were 
> created by 7za. One of them is testArchive.7z.
>
> I try to employ an ExecuteStreamCommand to extract from an incoming flowfile 
> to into N output flowfiles in output stream, each representing one file from 
> the contents in the flowfile.
>
> ESC throws error=2, No such file or directory.
>
> java.io.Exception: Cannot run program "/bin/7za"": error=2, No such file or 
> directory
>
> My ExecuteStreamCommand processor has this configuration:
> Command Argumentse
> Command Path   /bin/7za
> Ignore STDIN   false
> working Directory   no value set
> Argument Delimiter   ;
> (I do not set an Output Destination Delimiter, intending to send the output 
> to output path "output stream" as separate flowfiles)
>
> How can I fix this problem?
>
> Thanks in advance,
> Jim


ExecuteStreamCommand fails to extract archived files

2022-09-21 Thread James McMahon
Hello. I have a program /bin/7za that I need to apply to flowfiles  that
were created by 7za. One of them is testArchive.7z.

I try to employ an ExecuteStreamCommand to extract from an incoming
flowfile to into N output flowfiles in output stream, each representing one
file from the contents in the flowfile.

ESC throws error=2, No such file or directory.

java.io.Exception: Cannot run program "/bin/7za"": error=2, No such file or
directory

My ExecuteStreamCommand processor has this configuration:
Command Argumentse
Command Path   /bin/7za
Ignore STDIN   false
working Directory   no value set
Argument Delimiter   ;
(I do not set an Output Destination Delimiter, intending to send the output
to output path "output stream" as separate flowfiles)

How can I fix this problem?

Thanks in advance,
Jim